Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lp = game:service'Players'.LocalPlayer
- mouse = lp:GetMouse()
- part = Instance.new('Part',workspace)
- part.Anchored = true
- part.Transparency = 1
- camera = workspace.CurrentCamera
- kdone = mouse.KeyDown:Connect(function(k)
- if k == 'U' or k == 'u' then
- freecam = true
- if lp.Character.HumanoidRootPart.Anchored ~= true then
- lp.Character.HumanoidRootPart.Anchored = true
- end
- if camera.CameraSubject ~= part then
- camera.CameraSubject = part
- end
- part.CFrame = camera.CFrame
- end
- end)
- kdtwo = mouse.KeyDown:Connect(function(k)
- if k == 'Y' or k == 'y' then
- loop:Disconnect()
- kdone:Disconnect()
- kdthree:Disconnect()
- kdfour:Disconnect()
- if lp.Character.HumanoidRootPart.Anchored then
- lp.Character.HumanoidRootPart.Anchored = false
- end
- if camera.CameraSubject == part then
- camera.CameraSubject = lp.Character:FindFirstChildOfClass'Humanoid'
- end
- kdtwo:Disconnect()
- end
- end)
- kdthree = mouse.KeyDown:Connect(function(k)
- if k == 'W' or k == 'w' then
- W = true
- end
- end)
- kdfour = mouse.KeyUp:Connect(function(k)
- if k == 'W' or k == 'w' then
- W = false
- end
- end)
- loop = game:service'RunService'.Heartbeat:Connect(function()
- if freecam then
- if W then
- part.CFrame = part.CFrame + workspace.CurrentCamera.CFrame.LookVector*5
- end
- end
- end)
RAW Paste Data