SxScripting

Snap Gate Script

Dec 7th, 2020
1,233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. local TweenService = game:GetService("TweenService")
  2. local Info = TweenInfo.new(2, Enum.EasingStyle.Sine)
  3.  
  4. local v2 = {Size = Vector3.new(0.05, 7, 7)}
  5. local v3 = {Size = Vector3.new(0.05,0.05,0.05)}
  6.  
  7.  
  8. game.Players.PlayerAdded:Connect(function(Player)
  9. Player.Chatted:Connect(function(msg)
  10. for i,v in pairs(game.Workspace.TeleportLocations:GetChildren()) do
  11. if msg:lower() == v.Name then
  12. local LoadAnim = Player.Character.Humanoid:LoadAnimation(script.SnapGate)
  13. local TeleportPad = game.ReplicatedStorage.TeleportPad
  14. local TPD = TeleportPad:Clone()
  15.  
  16. Player.Character.Humanoid.WalkSpeed = 0
  17. Player.Character.Humanoid.JumpPower = 0
  18.  
  19. TPD.Position = Player.Character.HumanoidRootPart.Position + Vector3.new(0,-3,0)
  20. TPD.Parent = workspace
  21. LoadAnim:Play()
  22. local Tweenv1 = TweenService:Create(TPD, Info, v2)
  23. Tweenv1:Play()
  24.  
  25. TPD.Touched:Connect(function(Hit)
  26. if Hit.Parent:FindFirstChild("Humanoid") and Hit.Parent ~= Player.Character then
  27. Hit.Parent.HumanoidRootPart.Position = v.Position
  28. end
  29. end)
  30.  
  31. Tweenv1.Completed:Connect(function()
  32. Player.Character.HumanoidRootPart.Position = v.Position
  33. wait(1)
  34. local Reversev1 = TweenService:Create(TPD, Info, v3):Play()
  35. Player.Character.Humanoid.WalkSpeed = 16
  36. Player.Character.Humanoid.JumpPower = 50
  37. TPD:Destroy()
  38. end)
  39. end
  40. end
  41. end)
  42. end)
Advertisement
Add Comment
Please, Sign In to add comment