antoniorigo4

Hatman local and server together :)

Aug 11th, 2020
1,787
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.23 KB | None | 0 0
  1. local player = owner
  2. local cha = player.Character
  3. cha.Humanoid.Health = math.huge
  4. cha.Humanoid.MaxHealth = math.huge
  5. local hatmod = Instance.new("Model",cha)
  6. local main = Instance.new("Part",hatmod)
  7. local top = Instance.new("Part",hatmod)
  8. local misc = Instance.new("Part",hatmod)
  9.  
  10. main.Size = Vector3.new(0.5, 3, 3)
  11. top.Size = Vector3.new(2, 2, 2)
  12. misc.Size = Vector3.new(0.558, 2.03, 3.045)
  13.  
  14. local maintopw = Instance.new("Motor6D",hatmod)
  15. local topmiscw = Instance.new("Motor6D",hatmod)
  16.  
  17. maintopw.Part0 = main
  18. maintopw.Part1 = top
  19.  
  20.  
  21. topmiscw.Part0 = top
  22. topmiscw.Part1 = misc
  23.  
  24. maintopw.C1 = CFrame.new(1,0,0)
  25. topmiscw.C1 = CFrame.new(0.3,0,0)
  26.  
  27. main.Shape = "Cylinder"
  28. top.Shape = "Cylinder"
  29. misc.Shape = "Cylinder"
  30.  
  31. local headweld = Instance.new("Weld",main)
  32. headweld.Part0 = cha.Head
  33. headweld.Part1 = main
  34. headweld.C1 = CFrame.new(0.75,0,0) *CFrame.Angles(0,0,math.rad(90))
  35.  
  36. main.BrickColor = BrickColor.Black()
  37. top.BrickColor = BrickColor.Black()
  38. local light = Instance.new("PointLight",misc)
  39. light.Brightness = 90
  40. light.Range = 8
  41. --this is where the real party starts
  42. local sound = Instance.new("Sound",cha.Head)
  43. sound.Looped = true
  44. sound.Volume = 5
  45. local remote = Instance.new("RemoteEvent",cha)
  46. remote.OnServerEvent:Connect(function(player,value)
  47.     misc.Color = Color3.new(value/math.random(2,5),value/math.random(2,5),value/math.random(2,5))
  48. light.Color = misc.Color   
  49. end)
  50. player.Chatted:Connect(function(msg)
  51.         if msg:sub(1,5) == "/play" then
  52.         local victim = msg:sub(1,5)
  53.         local soundid = string.gsub(msg,victim,"")
  54.         sound.SoundId = "rbxassetid://"..soundid
  55.         remote:FireClient(player,"macaroniman",soundid)
  56.         sound:Play()
  57.     elseif msg:sub(1,5) == "/stop" then
  58.         sound:Stop()
  59.     end
  60. end)
  61. script.Parent = cha
  62. NLS([[local player = game.Players.LocalPlayer
  63. local sound = Instance.new("Sound",script)
  64. sound.Looped = true
  65. local remote = game.Players.LocalPlayer.Character:WaitForChild("RemoteEvent")
  66. remote.OnClientEvent:Connect(function(macaroni,id)
  67.     sound.SoundId = "rbxassetid://"..id
  68.     sound:Play()
  69. end)
  70. player.Chatted:Connect(function(msg)
  71.     if msg:sub(1,5) == "/stop" then
  72.         sound:Stop()
  73.     end
  74. end)
  75. while true do
  76.     wait()
  77.     remote:FireServer(sound.PlaybackLoudness)
  78. end]],owner.PlayerGui)
Advertisement
Add Comment
Please, Sign In to add comment