Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait(1)
- local controlserv = game:GetService("ControllerService")
- local inputserv = game:GetService("UserInputService")
- local char = game.Players.LocalPlayer.Character
- local left,right = false,false
- local cam = workspace.CurrentCamera
- cam.CameraType = 'Scriptable'
- for i, v in pairs(controlserv:GetChildren()) do
- v:Destroy()
- end
- inputserv.InputBegan:connect(function(Input)
- if Input.KeyCode == Enum.KeyCode.A then
- right = false
- left = true
- elseif Input.KeyCode == Enum.KeyCode.D then
- left = false
- right = true
- elseif Input.KeyCode == Enum.KeyCode.Space then
- char.Humanoid.Jump = true
- end
- inputserv.InputEnded:connect(function(Input)
- if Input.KeyCode == Enum.KeyCode.A then
- left = false
- elseif Input.KeyCode == Enum.KeyCode.D then
- right = false
- end
- end)
- end)
- coroutine.wrap(function()
- while wait() do
- local pos = char.Torso.CFrame + Vector3.new(0,7,20)
- cam:Interpolate(
- pos,
- char.Torso.CFrame,
- .1
- )
- end
- end)()
- while wait() do
- local pos
- if left == true then
- pos = char.Torso.Position - Vector3.new(5, 0, 0)
- elseif right == true then
- pos = char.Torso.Position - Vector3.new(-5, 0, 0)
- end
- pos = pos or char.Torso.Position
- char.Humanoid:MoveTo(pos)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement