Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why wont this script Clone any Blocks even tough Output is empty?

Asked by 4 years ago

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

1 answer

Log in to vote
0
Answered by
Fifkee 2017 Community Moderator Moderation Voter
4 years ago

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).

0
If this helped, please upvote and select as answer. Thanks! Fifkee 2017 — 4y
0
At what line would i have to put it? Stuffy_flowerx3 19 — 4y
Ad

Answer this question