Advertisement
dahpiglz

Untitled

Oct 26th, 2017
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  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. for i,v in pairs(player.Character:GetChildren()) do
  19. if v.Name ~= ("b") then
  20. v.Parent = m1
  21. end
  22. end
  23.  
  24. for i,v in pairs(target.Parent:GetChildren()) do
  25. v.Parent = player.Character
  26. end
  27. --for i,v in pairs(m1:GetChildren()) do
  28. -- v.Parent = target.Parent
  29. --end
  30. player.Character.Humanoid.NameDisplayDistance = 0
  31. game.Workspace.Camera.CameraSubject = player.Character.Humanoid
  32. end
  33. end
  34. end
  35.  
  36. game:GetService("UserInputService").InputBegan:connect(onKeyPress)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement