Mokiros

Head as Tool

Oct 15th, 2020 (edited)
1,544
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local Players = game:GetService("Players")
  2. for _,Player in pairs(Players:GetPlayers()) do
  3.     Player.Chatted:Connect(function(msg)
  4.         if msg == 'headtool/me' or msg == 'toolhead/me' then
  5.             local Character = Player.Character
  6.             if not Character then return end
  7.             local Humanoid = Character:FindFirstChildOfClass("Humanoid")
  8.             if not Humanoid then return end
  9.             local Head = Character:FindFirstChild("Head")
  10.             if not Head then return end
  11.            
  12.             local Tool = Instance.new("Tool")
  13.             local Handle = Instance.new("Part")
  14.             Handle.Name = "Handle"
  15.             Handle.Size = Vector3.new(1,1,1)
  16.             Handle.CanCollide = false
  17.             Handle.Transparency = 1
  18.             Handle.Parent = Tool
  19.  
  20.             Humanoid.RequiresNeck = false
  21.             local Neck = Character:FindFirstChild("Neck",true)
  22.             if Neck then Neck:Destroy() end
  23.            
  24.             Head.Shape = "Ball"
  25.             Head.Size = Vector3.new(1,1,1)
  26.  
  27.             local Weld = Instance.new("Weld")
  28.             Weld.Part0 = Handle
  29.             Weld.Part1 = Head
  30.             Weld.Parent = Handle
  31.  
  32.             Tool.Name = Character.Name.."'s Head"
  33.  
  34.             Tool.Parent = Player:FindFirstChildOfClass("Backpack") or Player
  35.             Humanoid:EquipTool(Tool)
  36.         end
  37.     end)
  38. end
  39.  
RAW Paste Data