Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- local container = Instance.new("Model")
- container.Parent = lighting
- local hc = Instance.new("Model")
- hc.Parent = player.Character
- function onKeyPress(inputObject, gameProcessedEvent)
- print("Key")
- local key = inputObject.KeyCode
- if key == Enum.KeyCode.E then
- print("E")
- local target = mouse.Target
- if target.Parent:FindFirstChild("HumanoidRootPart") ~= nil then
- target.Parent.Parent = container
- if target.Parent:FindFirstChild("Humanoid") ~= nil then
- target.Parent.Humanoid.Name = (target.Parent.Name)
- target.Parent.Humanoid.Parent = hc
- end
- end
- end
- end
- game:GetService("UserInputService").InputBegan:connect(onKeyPress)
- function onKeyPress(inputObject, gameProcessedEvent)
- print("Key")
- local key = inputObject.KeyCode
- if key == Enum.KeyCode.Q then
- for i,v in pairs(container:GetChildren()) do
- print("Release")
- v.HumanoidRootPart.CFrame = mouse.Hit
- v.Parent = game.Workspace
- end
- wait(0.02)
- for i,v in pairs(hc:GetChildren()) do
- v.Parent = game.Workspace:FindFirstChild(v.Name)
- v.Name = ("Humanoid")
- end
- end
- print(core.Parent.Name)
- end
- game:GetService("UserInputService").InputBegan:connect(onKeyPress)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement