You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I want it so that only 3 parts can drop from my dropper until being collected before more can be spawned in.
What is the issue? Include screenshots / videos if possible!
I do not know what to change about my code.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked on here, but nobody has any answers.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
local replicatedstorage = game.ReplicatedStorage
local drop = replicatedstorage:WaitForChild("Drop")
local dropper = script.Parent
local droplimit = script.DropLimit.Value
boo = true
task.spawn(function()
repeat
wait(math.random(1,5))
print("cloning...")
local new = drop:Clone()
new.Parent = dropper
new.CFrame = dropper.CFrame
droplimit = droplimit + 1
if droplimit == 3 then
boo = false
print("stopped")
end
until not boo
end)
is this good enough?
btw put this script on your dropper (also add number value in the script)
Create a number_of_dropped variable set to 0.
Make a while loop that runs every time the number_of_dropped <4, and do number_of_dropped += 1 every time it drops.
Aaaallllllright, just add NumberValue on your DropHandler and name it that I said before (Not variable, just click the “+” in the right of your DropHandler and type numbervalue then add it)