Advertisement
Guest User

aiujduja

a guest
Feb 23rd, 2020
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1.  
  2. local m = game.Players.LocalPlayer:GetMouse()
  3. db = true
  4. m.KeyDown:connect(function(k)
  5. k = k:lower()
  6. if k == "z" then
  7. if db == true then
  8. local targetname = game.Players.LocalPlayer.Name
  9.  
  10. local LocalPlayer = game:GetService("Players").LocalPlayer
  11. local ran1 = false
  12. local ran2 = false
  13. local equipped = false
  14. local savepos = LocalPlayer.Character.HumanoidRootPart.CFrame
  15. local target = game:GetService("Players")[targetname]
  16. if #LocalPlayer.Backpack:GetChildren() < 2 then
  17. repeat
  18. for _, tool in pairs(LocalPlayer.Backpack:GetChildren()) do
  19. if tool:IsA("Tool") then
  20. tool.Parent = LocalPlayer
  21. end
  22. end
  23. LocalPlayer.Character:ClearAllChildren()
  24. local char = Instance.new("Model", workspace)
  25. char.Name = "character"
  26. Instance.new("Part", char).Name = "Torso";
  27. Instance.new("Part", char).Name = "Head";
  28. Instance.new("Humanoid", char).Name = "Humanoid";
  29. LocalPlayer.Character = char
  30. repeat wait() until LocalPlayer.Character
  31. until #LocalPlayer:GetChildren() - 4 >= 2
  32. for _, char in pairs(workspace:GetChildren()) do
  33. if char.Name == "character" and char:IsA("Model") then
  34. char:Destroy()
  35. end
  36. end
  37. repeat wait() until LocalPlayer.Character.HumanoidRootPart ~= nil
  38. for _, tool in pairs(LocalPlayer:GetChildren()) do
  39. if tool:IsA("Tool") then
  40. tool.Parent = LocalPlayer.Backpack
  41. end
  42. end
  43. end
  44. LocalPlayer.Character.HumanoidRootPart.CFrame = savepos
  45. LocalPlayer.Backpack:FindFirstChildOfClass("Tool").Parent = LocalPlayer.Character
  46. LocalPlayer.Backpack:FindFirstChildOfClass("Tool").Parent = LocalPlayer.Character
  47. local tool = LocalPlayer.Character:FindFirstChildOfClass("Tool")
  48. tool.Parent = workspace
  49. local attacher = LocalPlayer.Character:FindFirstChildOfClass("Tool")
  50. attacher.Parent = workspace
  51. LocalPlayer.Character.Humanoid:EquipTool(tool)
  52. repeat wait() until LocalPlayer.Character:FindFirstChildOfClass("Tool") ~= nil
  53. LocalPlayer.Character.Humanoid:UnequipTools()
  54. attacher.AncestryChanged:connect(function()
  55. if ran1 == false then
  56. ran1 = true
  57. equipped = true
  58. end
  59. end)
  60. db = false
  61. wait(0.5)
  62. db = true
  63. end
  64. end
  65. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement