irevoid

Chest Teleport

Jun 21st, 2020
1,157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. local ts = game:GetService("TweenService")
  2. local LP = game:GetService("Players").LocalPlayer
  3. local root = LP.Character:FindFirstChild("HumanoidRootPart")
  4. local function delete()
  5. for i,v in pairs(workspace.Map:GetDescendants()) do
  6. if v:IsA("BoolValue") and v.Name == "Open" then
  7. v.Parent:Destroy()
  8. end
  9. end
  10. end
  11. local function Tween(part, endpos, speed)
  12. if part and endpos then
  13. local Time = (endpos - part.Position).magnitude/speed
  14. local Info = TweenInfo.new(Time, Enum.EasingStyle.Linear)
  15. local Tween = ts:Create(part,Info,{CFrame = CFrame.new(endpos.X,endpos.Y,endpos.Z)})
  16. Tween:Play()
  17. wait(Time)
  18. end
  19. end
  20. local function chest(root,part)
  21. Tween(root, part.Position, 100)
  22. end
  23. LP.Character:WaitForChild("Humanoid"):ChangeState(11)
  24. game:GetService("RunService").RenderStepped:Wait()
  25. wait(0.2)
  26. delete()
  27. game:GetService("RunService").RenderStepped:Wait()
  28. for i,v in pairs(game:GetService("Workspace").Map:GetDescendants()) do
  29. if v:IsA("Model") and v.Name == "Chest" then
  30. chest(root,v:FindFirstChild("Base"))
  31. wait(5)
  32. end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment