Advertisement
dahpiglz

Untitled

Oct 31st, 2017
159
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. local container = Instance.new("Model")
  5. container.Parent = lighting
  6.  
  7. local hc = Instance.new("Model")
  8. hc.Parent = player.Character
  9.  
  10. function onKeyPress(inputObject, gameProcessedEvent)
  11. print("Key")
  12. local key = inputObject.KeyCode
  13. if key == Enum.KeyCode.E then
  14. print("E")
  15. local target = mouse.Target
  16. if target.Parent:FindFirstChild("HumanoidRootPart") ~= nil then
  17. target.Parent.Parent = container
  18. if target.Parent:FindFirstChild("Humanoid") ~= nil then
  19. target.Parent.Humanoid.Name = (target.Parent.Name)
  20. target.Parent.Humanoid.Parent = hc
  21. end
  22. end
  23. end
  24. end
  25.  
  26. game:GetService("UserInputService").InputBegan:connect(onKeyPress)
  27.  
  28. function onKeyPress(inputObject, gameProcessedEvent)
  29. print("Key")
  30. local key = inputObject.KeyCode
  31. if key == Enum.KeyCode.Q then
  32. for i,v in pairs(container:GetChildren()) do
  33. print("Release")
  34. v.HumanoidRootPart.CFrame = mouse.Hit
  35. v.Parent = game.Workspace
  36. end
  37. wait(0.02)
  38. for i,v in pairs(hc:GetChildren()) do
  39. v.Parent = game.Workspace:FindFirstChild(v.Name)
  40. v.Name = ("Humanoid")
  41. end
  42. end
  43. print(core.Parent.Name)
  44. end
  45.  
  46. game:GetService("UserInputService").InputBegan:connect(onKeyPress)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement