Im trying to do a Cannon. If u touch the stepped pad the cannon will shoot. I tried it already without a local function and without the steppedpad and it worked. But I tried to add the stepped pad and it wont work. Can anyone fix the script so it will Work?
local cannon = script.Parent local barrel = cannon.Barrel local fireball = game.ServerStorage.Fireball local steppedpad = cannon.steppedOn local function gethit(part) local parent = part.Parent if game.Players:GetPlayerFromCharacter(parent) then local fireballCopy = fireball:Clone() fireballCopy.Parent = game.Workspace fireballCopy.Position = barrel.Position fireballCopy.Velocity = Vector3.new(-100,0,0) wait(3) end end steppedpad.Touched:connect(gethit)
I will tell you more information: the script is inside a model named Cannon. but if you stay on steppedpad then
fireballCopy.Parent = game.Workspace fireballCopy.Position = barrel.Position fireballCopy.Velocity = Vector3.new(-100,0,0) wait(3)
Won't work, and the fireball won't even spawn! can anyone help me?