I made as script so where, when you jump on a the object that you're touching, it's suppose to fling the character who touched it back. but for some reason it's not working, nor is it outputting errors. Help!
Local Script
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("UpperTorso") then script.Parent.PushBack:FireServer(hit) end end)
Server Script
db = true script.Parent.PushBack.OnServerEvent:Connect(function(hit) if db then db = false local torso = hit.Parent.UpperTorso torso.Velocity = (torso.CFrame.lookVector) * -100 wait(2) db = true end end) [
](https://gyazo.com/57e9c28f23aa7914662dace8f404c515)
Turns out I didn't even have to use a Remote Event, Server and Local Script at all. All I needed was a regular script and I just used BodyVelocity instead of Torso.
local debris = game:GetService("Debris") db = false script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("UpperTorso") then if not db then db = true local torso = hit.Parent.UpperTorso local bv = Instance.new("BodyVelocity",torso) bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge) bv.Velocity = torso.CFrame.lookVector * -500 debris:AddItem(bv,0.5) wait(2) db = false end end end)