So im trying to make a simple soccer goal in my game to give players something to do while they wait in the lobby. Everything is basically done except for one issue.
When the Ball enters the goal, i have some ramps which lead it towards a touch part. When the Ball collides with the touch part, it is teleported above into a eject ramp and the ball leaves the goal.
Issue is the .touched in the script only fires the first time. Here is an example
Here is the script in the touch part
local debounce = false local TweenService = game:GetService("TweenService") local Ball = script.Parent.Parent.Parent.SoccerBallModel script.Parent.Touched:Connect(function(hit) print("so it happpend") -- this tells me in devconsole whether the function was fired or not if hit.Parent == Ball then if debounce == false then debounce = true hit.CFrame = CFrame.new(hit.Position.X,96.601,hit.Position.Z) task.wait(4) debounce = false else hit.CFrame.AssemblyLinearVelocity = Vector3.new(-20,0,0) end end end)
Ive been stuck on this for like 3 days trying to make different ball eject systems and im starting to lose hope that i cant even make a simple soccer goal. Can anybody help?