I am making a minigame thing where where players are spawned, there's multiple places they can hide, while a ball rolls down a hill and if the player is hit they die. How to I make sure the ball is created over and over? Here's my attempt (im awful at scripting):
ball = game.Workspace.Ball
wait(3)
Instance.new("Ball")
ball.Position = Vector3.new( x, y, z)
ball.Anchored = false
"Ball" isn't something Lua can recognize. Instead, you can set the shape after you create the standard part itself.
-- Search for the first Ball ball = game.Workspace:WaitForChild('Ball') wait(3) -- Create a Brick, then set it's shape to Ball local newball Instance.new('Part', game.Workspace) newball.Name = 'InstancedBall' -- Set a new name for the part newball.Shape = 'Ball' newball.Position = Vector3.new(x,y,z) ball:Destroy() -- You can destroy something by addressing it with :Destroy()
To have this repeat over and over, you can put the bottom part in a function and then create a loop that triggers said function every (x) seconds.
Another way that you could do this could be using clones.
-- Have a ball already somewhere in the workspace ball = game.Workspace:WaitForChild('Ball') wait(3) -- Create a clone of it, then make the clone do what you want local cball = ball:Clone() cball.Parent = game.Workspace cball.Position = Vector3.new(x,y,z)