#I need a working cap system that has max 300 tix and spawns more tix as soon as the cap isnt hit

72 messages · Page 1 of 1 (latest)

gray summit
#

anymore
tixCNT - number of tix in the game - works
tixCD - spawn cooldown

game.Players.PlayerAdded:Connect(function(plr)




while true do
        
           task.wait(tixCD) 
           tixCL = tix:Clone()
           tixCL.Parent = game.Workspace
           tixCL.Position = Vector3.new(math.random(-200,200), spawn.Position.Y, math.random(-200, 200))
           tixCNT += 1
    
end

    
    
    
end)
fiery wigeon
#

Can you explain what a cap system is please I can help no jus don’t understand

normal templeBOT
#

studio** You are now Level 1! **studio

fiery wigeon
#

Are you saying you want tix to be added to player?

vestal pumice
#

If that's what you meant

#

¯_(ツ)_/¯

gray summit
vestal pumice
gray summit
gray summit
vestal pumice
#

It should

#

You don't have any waits in the loop

#

So it should work instantly anyways

gray summit
#

i do

#

task.wait

#

but it should work

#

wait imma send u my current script

#
while tixCNT <= 300 do
        
           task.wait(tixCD) 
           tixCL = tix:Clone()
           tixCL.Parent = game.Workspace
           tixCL.Position = Vector3.new(math.random(-200,200), spawn.Position.Y, math.random(-200, 200))
           tixCNT += 1
    
end

    

fiery wigeon
#

If you want it to climb up to that number you must put a wait() wit an in value

#

That’s waiting for the the number 300 to be hit

#

It hits right of way so the script ends

gray summit
#

wait a sec

normal templeBOT
#

studio** You are now Level 8! **studio

fiery wigeon
#

The wait you have there is to wait for the value to hit 300

#

That’s why it ends so quick

#

The tick idk a value

#

Is a value

gray summit
#

yeah but what if someone collects those ticks

#

i need

#

stay

fiery wigeon
#

Wdym

gray summit
#

so you want me to put a wait and calculate how much time it would take to hit the cap?

#

or smthng else?

#

so do you have an answer to this?

#

here u go

#

okay i understand but how to achieve that

#

which loops for what

#

or idk some 26th service or something

#

okay and then?

#

if what then what

fiery wigeon
#

If it’s true then do

#

If tixXD == true do

#

I’m think

#

Right? @willow geyser

gray summit
#

what is XD

#

i didnt type that

fiery wigeon
#

Hollo

gray summit
#

what

fiery wigeon
#

TixCND

#

Should be

gray summit
#

CNT?

#

it means tix count

#

to me

#

wait im confused

#

i got a brainfart

#

honestly just scripting this and sending to me is easier than explaining stuff to me

#

just saying

#

dont act like i didnt tell you

fiery wigeon
#

Im too busy for that

normal templeBOT
#

studio** You are now Level 2! **studio

fiery wigeon
#

Ask ChatGPT if still confused

gray summit
#

okay

#

thanks for effort tho

#

chat gpt gave me this

#

local maxTix = 300

-- Function to count the number of tix in the workspace
local function getTixCount()
local count = 0
for _, item in pairs(game.Workspace:GetChildren()) do
if item.Name == "Tix" then -- Assuming Tix are named "Tix"
count += 1
end
end
return count
end

-- Main loop
while true do
-- Check the current number of Tix in the workspace
local tixCNT = getTixCount()

-- If the number of Tix is below the limit, spawn more
if tixCNT < maxTix then
    task.wait(tixCD) 
    local tixCL = tix:Clone()
    tixCL.Parent = game.Workspace
    tixCL.Position = Vector3.new(math.random(-200,200), spawn.Position.Y, math.random(-200, 200))
else
    -- If the number of Tix is at or above the limit, wait a bit before checking again
    task.wait(1)
end

end

#

IT WORKS

#

no wayyy

terse dagger