Advertisement
Cizzy

Untitled

Mar 14th, 2021
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. getgc = getgc or debug.getgc or get_gc_objects
  2. hookfunction = hookfunction
  3.  
  4. _STYLE = nil
  5. _NPC = nil
  6. workstation = nil
  7.  
  8. local hairassets_colors = game.ReplicatedStorage.GameObjects.HairAssets.Colors
  9.  
  10. for i,v in pairs(getgc(true)) do
  11. if type(v) == "function" and getinfo(v).name == "AttachHat" then
  12. old = hookfunction(v, function(...)
  13. local a = old(...)
  14. local style = ({...})[2]
  15. local npc = ({...})[3]
  16. if _NPC ~= nil and npc == _NPC then
  17. _STYLE = style.Name
  18. end
  19.  
  20. return a
  21. end)
  22. elseif type(v) == "function" and getinfo(v).name == "CreateChatBubble" then
  23. old2 = hookfunction(v, function(...)
  24. local order = old2(...)
  25. _NPC = ({...})[2].Parent
  26. if not _NPC.Order:FindFirstChild("Style") then
  27. return order
  28. end
  29.  
  30. local npccolor, npcstyle
  31. npcstyle = _NPC.Order.Style.Value
  32. npccolor = _NPC.Order.Color.Value
  33.  
  34. for _,workstation in pairs(workspace.Environment.Locations.StylezHairStudio.HairdresserWorkstations:GetChildren()) do
  35. if not workstation.Mirror.HairdresserGUI.Used.Visible and workstation.Occupied.Value == _NPC then
  36. local k = workstation.Mirror.HairdresserGUI.Frame
  37. local style = k:FindFirstChild("Style")
  38. local color = k:FindFirstChild("Color")
  39. local style_done, hair_done = false
  40. for i = 1,18 do
  41. if not hair_done then
  42. for i,v in pairs(getconnections(color.Next.Activated)) do
  43. v:Fire()
  44. end
  45. end
  46. if not style_done then
  47. for i,v in pairs(getconnections(style.Next.Activated)) do
  48. v:Fire()
  49. end
  50. end
  51. if _STYLE ~= nil and tostring(_STYLE) == tostring(npcstyle) then
  52. _STYLE = nil
  53. style_done = true
  54. end
  55.  
  56. if hairassets_colors[npccolor].Value == workstation.HairdresserDummy.Hair.BrickColor then
  57. hair_done = true
  58. if style_done then
  59. for i,v in pairs(getconnections(k.Done.Activated)) do
  60. v:Fire()
  61. end
  62. break
  63. end
  64. end
  65. end
  66. end
  67. end
  68.  
  69. return order
  70. end)
  71. end
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement