Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local startpos = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
- function tp(x,y,z)
- local valtomove = 4
- moving = true
- if x < game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X then
- while x < game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X do
- wait()
- game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X-valtomove,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z))
- end
- end
- if z < game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z then
- while z < game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z do
- wait()
- game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z-valtomove))
- end
- end
- if x > game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X then
- while x > game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X do
- wait()
- game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X+valtomove,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z))
- end
- end
- if z > game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z then
- while z > game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z do
- wait()
- game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z+valtomove))
- end
- end
- if y < game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y then
- while y < game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y do
- wait()
- game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y-valtomove,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z))
- end
- end
- if y > game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y then
- while y > game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y do
- wait()
- game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(game.Players.LocalPlayer.Character.HumanoidRootPart.Position.X,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Y+valtomove,game.Players.LocalPlayer.Character.HumanoidRootPart.Position.Z))
- end
- end
- moving = false
- end
- spawn (function()
- game:getService("RunService"):BindToRenderStep("",0,function()
- if not game.Players.LocalPlayer.Character:findFirstChildOfClass("Humanoid") then return end
- if moving == true then
- game.Players.LocalPlayer.Character:findFirstChildOfClass("Humanoid"):ChangeState(11)
- end
- end)
- end)
- game.Players.LocalPlayer.Character:MoveTo(Vector3.new(x,y,z))
- function tp2(x)
- tp(x.Position.X,x.Position.Y,x.Position.Z)
- end
- for i,v in pairs(game.Workspace:GetChildren()) do
- if v.Name == "Gold Chest" or "Silver Chest" then
- tp2(v)
- wait(1)
- end
- end
- game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = startpos
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement