I want to make a cannon that shoots players that sits on it but when i added
if script.Parent.Occupant ~= nil then
it then didnt work when i left the seat and then came back to sit on the cannon
local Debounce = false
local debris = game:GetService("Debris")
script.Parent.Touched:Connect(function(Ball)
if Debounce ~= true then
if Ball.Parent:FindFirstChild("HumanoidRootPart") then
Debounce = true
local bodyv = Instance.new("BodyVelocity")
wait(3)
if script.Parent.Occupant ~= nil then
Ball.Parent.Humanoid.Sit = false
Ball.Parent.Humanoid.Jump = true
smokeclone.Parent = script.Parent
bodyv.Parent = Ball.Parent.HumanoidRootPart
Ball.Parent.HumanoidRootPart.BodyVelocity.Velocity = script.Parent.CFrame.LookVector * 100
debris:AddItem(bodyv, 5)
wait(1)
Debounce = false
end
end
end
end)