What im trying to do here is: I have multiple parts called "Block" in a folder named Obstacles inside Serverstorage. I want the Blocks to be cloned ON TOP of a Part so i made the coordinates. But nothing is happening. I dont know if this will help but what im trying to overall create is a game where the Player stands on a Part that increases Velocity over time and the Cloning blocks are supposed to be obstacles said player has to dodge to not be pushed to a Blackhole
while wait(math.random(10,20)) do local a = -275.37 local b = -268.97 local function randcontinuous(a, b) local x = game.ServerStorage.Obstacles.Block:Clone() x.Anchored = false x.Parent = workspace:WaitForChild("Space",24) wait (24) return a + math.random()*(b - a) end end
Call the function!
A function won't run if it's not being called, no matter where you put it. Unless it's in a spawn. OR in a delay. OR in a callback.
You know what, you get my point. Just call the function. You can call a function by doing it like this:
FunctionName(ArgumentsHere, ArgumentsAlsoHere, ButWait, ArgumentsCanBeHereToo)
In your case, it would be randcontinuous(a, b)
.