joshclark756

control npc t to uncontrol

Jan 4th, 2022
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. local LocalPlayerPla = game:GetService("Players").LocalPlayer
  2. local LocalPlayerCHAR = LocalPlayerPla.Character
  3. local Player = game:GetService("Players").LocalPlayer
  4. local Mouse = Player:GetMouse()
  5. Mouse.Button1Down:connect(function()
  6. if Mouse.Target ~= nil and Mouse.Target.Parent.Name ~= "Workspace" and Mouse.Target.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
  7.  
  8. local Char = Mouse.Target.Parent
  9. Player.Character = Mouse.Target.Parent
  10. workspace.CurrentCamera.CameraSubject = Char
  11. Char.Animate.Disabled = true
  12. wait(0.01)
  13. Char.Animate.Disabled = false
  14. end
  15. end)
  16. game:GetService("UserInputService").InputBegan:Connect(function(Key)
  17. if Key.KeyCode == Enum.KeyCode.T then
  18.  
  19. Player.Character = LocalPlayerCHAR
  20. workspace.CurrentCamera.CameraSubject = LocalPlayerCHAR
  21. LocalPlayerCHAR.Animate.Disabled = true
  22. wait(0.01)
  23. LocalPlayerCHAR.Animate.Disabled = false
  24. end
  25. end)
  26. local LocalPlayerPla = game:GetService("Players").LocalPlayer
  27. local LocalPlayerCHAR = LocalPlayerPla.Character
  28. local Player = game:GetService("Players").LocalPlayer
  29. local Mouse = Player:GetMouse()
  30. Mouse.Button1Down:connect(function()
  31. if Mouse.Target ~= nil and Mouse.Target.Parent.Name ~= "Workspace" and Mouse.Target.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
  32.  
  33. local Char = Mouse.Target.Parent
  34. Player.Character = Mouse.Target.Parent
  35. workspace.CurrentCamera.CameraSubject = Char
  36. wait()
  37. Char.Animate.Disabled = false
  38. end
  39. end)
  40. game:GetService("UserInputService").InputBegan:Connect(function(Key)
  41. if Key.KeyCode == Enum.KeyCode.T then
  42.  
  43. Player.Character = LocalPlayerCHAR
  44. workspace.CurrentCamera.CameraSubject = LocalPlayerCHAR
  45. wait()
  46. Char.Animate.Disabled = false
  47. end
  48. end)
Advertisement
Add Comment
Please, Sign In to add comment