dahpiglz

bswap

Oct 31st, 2017
117
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. 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)
  37.  
  38. function onKeyPress(inputObject, gameProcessedEvent)
  39. print("Key")
  40. local key = inputObject.KeyCode
  41. if key == Enum.KeyCode.Q then
  42. print("Q")
  43. m = Instance.new("Model")
  44. m.Parent = game.Workspace
  45. h = Instance.new("Humanoid")
  46. h.Parent = m
  47. for i,v in pairs(player.Character:GetChildren()) do
  48. if v ~= script then
  49. if v.ClassName == ("Part") then
  50. local c = Instance.new("Part")
  51. c.CFrame = v.CFrame
  52. c.Position = v.Position + Vector3.new(0,10,0)
  53. c.Parent = m
  54. c.Size = v.Size
  55. c.Color = v.Color
  56. c.Name = v.Name
  57. end
  58. end
  59. end
  60. end
  61. end
  62.  
  63. game:GetService("UserInputService").InputBegan:connect(onKeyPress)
Add Comment
Please, Sign In to add comment