Meliodas0_0

Free Camara

Jul 26th, 2019
24
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. lp = game:service'Players'.LocalPlayer
  3. mouse = lp:GetMouse()
  4. part = Instance.new('Part',workspace)
  5. part.Anchored = true
  6. part.Transparency = 1
  7. camera = workspace.CurrentCamera
  8. kdone = mouse.KeyDown:Connect(function(k)
  9. if k == 'U' or k == 'u' then
  10. freecam = true
  11. if lp.Character.HumanoidRootPart.Anchored ~= true then
  12. lp.Character.HumanoidRootPart.Anchored = true
  13. end
  14. if camera.CameraSubject ~= part then
  15. camera.CameraSubject = part
  16. end
  17. part.CFrame = camera.CFrame
  18. end
  19. end)
  20. kdtwo = mouse.KeyDown:Connect(function(k)
  21. if k == 'Y' or k == 'y' then
  22. loop:Disconnect()
  23. kdone:Disconnect()
  24. kdthree:Disconnect()
  25. kdfour:Disconnect()
  26. if lp.Character.HumanoidRootPart.Anchored then
  27. lp.Character.HumanoidRootPart.Anchored = false
  28. end
  29. if camera.CameraSubject == part then
  30. camera.CameraSubject = lp.Character:FindFirstChildOfClass'Humanoid'
  31. end
  32. kdtwo:Disconnect()
  33. end
  34. end)
  35. kdthree = mouse.KeyDown:Connect(function(k)
  36. if k == 'W' or k == 'w' then
  37. W = true
  38. end
  39. end)
  40. kdfour = mouse.KeyUp:Connect(function(k)
  41. if k == 'W' or k == 'w' then
  42. W = false
  43. end
  44. end)
  45. loop = game:service'RunService'.Heartbeat:Connect(function()
  46. if freecam then
  47. if W then
  48. part.CFrame = part.CFrame + workspace.CurrentCamera.CFrame.LookVector*5
  49. end
  50. end
  51. end)
RAW Paste Data