I want to know if you can repeat a part of a script a random number of times instead of a set number of times, for a game I am making.
Heres the script I am wanting to repeat for a random number of times:
local candy = r.Candy:GetChildren()
local randomCandy = candy[math.random(1, #candy)]:Clone()
randomCandy.Parent = workspace
randomCandy.Position = script.Parent.CandySpawn.Position