Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local seat = script.Parent
- -- Function to fling the player off the seat
- local function flingPlayer(player)
- -- Check if the player is sitting on the seat
- if seat:IsPointTouching(seat.Position + Vector3.new(0, seat.Size.Y/2, 0)) then
- -- Calculate the fling direction
- local flingDirection = (seat.Position - player.Character.HumanoidRootPart.Position).unit
- -- Apply a force to fling the player
- player.Character.HumanoidRootPart.Velocity = flingDirection * 50 -- Adjust the fling force as needed
- end
- end
- -- Touched event handler
- seat.Touched:Connect(function(KickOffSled)
- local KickOffSled = game.Workspace.otherPart
- if KickOffSled then
- flingPlayer(KickOffSled)
- print("it worked!1!")
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement