Advertisement
dahpiglz

Untitled

Oct 30th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local player = game.Players.LocalPlayer
  2. local mouse = player:GetMouse()
  3.  
  4. m1 = Instance.new("Model")
  5. m1.Parent = nil
  6.  
  7. print(script.Name)
  8.  
  9. function onKeyPress(inputObject, gameProcessedEvent)
  10. print("Key")
  11. local key = inputObject.KeyCode
  12. if key == Enum.KeyCode.E then
  13. print("E")
  14. local target = mouse.Target
  15. if target.Parent:FindFirstChild("HumanoidRootPart") ~= nil then
  16. print("Switch")
  17.  
  18. local hold = player.Character.HumanoidRootPart
  19.  
  20. for i,v in pairs(player.Character:GetChildren()) do
  21. if v.Name ~= ("b") then
  22. v.Parent = m1
  23. end
  24. end
  25. for i,v in pairs(target.Parent:GetChildren()) do
  26. n = v:Clone()
  27. if n.Name == ("HumanoidRootPart") then
  28. n.CFrame = hold.CFrame
  29. end
  30. n.Parent = player.Character
  31. end
  32. wait(0.1)
  33. game.Workspace.Camera.CameraSubject = player.Character.Humanoid
  34. end
  35. end
  36. end
  37.  
  38. game:GetService("UserInputService").InputBegan:connect(onKeyPress)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement