Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- m1 = Instance.new("Model")
- m1.Parent = nil
- print(script.Name)
- 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
- print("Switch")
- local hold = player.Character.HumanoidRootPart
- for i,v in pairs(player.Character:GetChildren()) do
- if v.Name ~= ("b") then
- v.Parent = m1
- end
- end
- for i,v in pairs(target.Parent:GetChildren()) do
- n = v:Clone()
- if n.Name == ("HumanoidRootPart") then
- n.CFrame = hold.CFrame
- end
- n.Parent = player.Character
- end
- wait(0.1)
- game.Workspace.Camera.CameraSubject = player.Character.Humanoid
- end
- end
- end
- game:GetService("UserInputService").InputBegan:connect(onKeyPress)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement