Hello, surprised to see me here?
I have made a script that spawns a boulder than rolls down the hill, but it doesn’t work!
I am very new to scripting so yeah
Workspace

Code
local coal = script.Parent.Coal
coal.transparency = 1
local function copyCoal()
local newCoal = coal:Clone()
newCoal.Anchored = false
newCoal.CanCollied = true
newCoal.transparency = 0
newCoal.Parent = script.Parent
end
while true do
wait(3)
copyCoal()
end
Help very much appreciated!
Thanks! -Trainzy
Fixed your code.
local coal = script.Parent -- The script's parent is the main Coal, so you don't have to locate it by doing `script.Parent.Coal` since it is the Script's Parent, so I put it back as a script.Parent.
coal.Transparency = 1
local function copyCoal()
local newCoal = coal:Clone()
newCoal.Anchored = false
newCoal.CanCollide = true -- You typed CanCollide like this: CanCollied, I fixed
newCoal.Transparency = 0
newCoal.Parent = game.Workspace
newCoal.Position = coal.Position
end
while true do
wait(3)
copyCoal()
end
If that doesn’t work, you can show us if your output is getting an error when you test the game. So we can help you better.
1 Like
Hmm it hides but doesn’t spawn

Try to put one more end at the end of the while true do, this is saying that it is to close the “do”.
1 Like