I want to make a cannon shoot a cannonball which is a clone of the original. However, it is not cloning and if it did, it wasn't moving. This is one of the codes that I was using:
local Cannon = script.Parent local CannonBody = Cannon.Union local Cannonball = game.Workspace.Cannonball local Wall = game.Workspace.Wall local GameStart = false local x = 14.5 local y = 3.312 local z = -72.5 function Cannonfire() if GameStart == true then local Clone = Cannonball:Clone() Clone.Position = Vector3.new(x, y, z) repeat wait(.5) Clone.Position = Vector3.new(x, y + .152, z - 1) until Wall.Touched == true if Wall.Touched == true then Clone:Destroy() end end end wait(5) GameStart = true Cannonfire()
What am I doing wrong and how do I fix it? Any help is appreciated!
Some problems I noticed were: - GameStart set to false