I wanted to make my first minigame, but it doesn't seem to work. It's supposed to have cannons on one side shoot at the players on a bridge to knock them off, but it doesn't even shoot. This is what I'm using:
local Cannon = script.Parent
local CannonBody = Cannon.Union
local Cannonball = game.Workspace.Cannonball
local Wall = game.Workspace.Wall
local GameStart = false
local x = 13
local y = 5.312
local z = -62.5
if GameStart == true then
local Clone = Cannonball:Clone()
Clone.Position = Vector3.new(x, y, z)
wait(1)
Clone.Position = Vector3.new(x, y + 1, z + 1)
if Wall.Touched == true then
Clone:Destroy()
end
end
wait(10)
GameStart = true
What can I do to fix this? Any help is appreciated!

3 comments
You checked if GameStart is true but, at the beginning you declared it as true.
As false*
You need a function, not an if statement, on line 10. The if statement says, "If GameStart is currently true, then do these actions", not "When GameStart becomes true, do these actions". Turn it into a function and call it instead of "GameStart = true". Likewise, on line 15 you need an event, not an if statement.