Advertisement
artbarte

Remote Camera

Apr 30th, 2017
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local mouse = Player:GetMouse()
  3.  
  4. a = 0
  5.  
  6. mouse.KeyDown:connect(function(key)
  7. if key == "l" then
  8.  
  9. for i, v in pairs(game.Workspace:GetChildren()) do
  10.  
  11. if v.Name == "loose camera 1" then
  12. v:remove()
  13. end
  14. end
  15.  
  16. meh = Instance.new("Part")
  17. meh.Name = ("loose camera 1")
  18. meh.Parent = game.Workspace
  19. meh.CanCollide = false
  20. meh.Anchored = true
  21. meh.Transparency = 1
  22. meh.Size = Vector3.new(1,1,1)
  23. meh.Position = (game.Players.LocalPlayer.Character.Head.Position + Vector3.new(0,3,0))
  24.  
  25. end
  26. end)
  27.  
  28.  
  29.  
  30.  
  31. mouse.KeyDown:connect(function(key)
  32. if key == "n" then
  33.  
  34. pol = ("loose camera 1")
  35. game.Workspace.CurrentCamera.CameraSubject = (game.Workspace[pol])
  36. game.Workspace.CurrentCamera.CameraType = "Custom"
  37.  
  38. end
  39. end)
  40.  
  41.  
  42.  
  43.  
  44. mouse.KeyDown:connect(function(key)
  45. if key == "m" then
  46.  
  47. game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
  48. game.Workspace.CurrentCamera.CameraType = "Custom"
  49.  
  50.  
  51. end
  52. end)
  53.  
  54. mouse.KeyDown:connect(function(key)
  55. if key == "k" then
  56.  
  57. pol = "loose camera 1"
  58.  
  59. me = game.Players.LocalPlayer
  60. me.Character.HumanoidRootPart.CFrame = CFrame.new(game.Workspace[pol].Position + Vector3.new(0,2,0))
  61.  
  62.  
  63. end
  64. end)
  65.  
  66.  
  67. camera=Instance.new("HopperBin",game.Players.LocalPlayer.Backpack)
  68. camera.Name = "Teleport Camera"
  69.  
  70. function teleportPlayer(pos)
  71.  
  72. local player = game.Players.LocalPlayer
  73. if player == nil or player.Character == nil then return end
  74. cam = "loose camera 1"
  75.  
  76. local char = game.Workspace[cam]
  77. char.Position = (pos + Vector3.new(0,5,0))
  78.  
  79. end
  80.  
  81.  
  82. enabled = true
  83. function onButton1Down(mouse)
  84. if not enabled then
  85. return
  86. end
  87.  
  88. local player = game.Players.LocalPlayer
  89. if player == nil then return end
  90. local cf = mouse.Hit
  91. teleportPlayer(cf.p)
  92.  
  93. end
  94.  
  95. function onSelected(mouse)
  96. mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
  97. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  98. end
  99.  
  100. camera.Selected:connect(onSelected)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement