Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getgc = getgc or debug.getgc or get_gc_objects
- hookfunction = hookfunction
- _STYLE = nil
- _NPC = nil
- workstation = nil
- local hairassets_colors = game.ReplicatedStorage.GameObjects.HairAssets.Colors
- for i,v in pairs(getgc(true)) do
- if type(v) == "function" and getinfo(v).name == "AttachHat" then
- old = hookfunction(v, function(...)
- local a = old(...)
- local style = ({...})[2]
- local npc = ({...})[3]
- if _NPC ~= nil and npc == _NPC then
- _STYLE = style.Name
- end
- return a
- end)
- elseif type(v) == "function" and getinfo(v).name == "CreateChatBubble" then
- old2 = hookfunction(v, function(...)
- local order = old2(...)
- _NPC = ({...})[2].Parent
- if not _NPC.Order:FindFirstChild("Style") then
- return order
- end
- local npccolor, npcstyle
- npcstyle = _NPC.Order.Style.Value
- npccolor = _NPC.Order.Color.Value
- for _,workstation in pairs(workspace.Environment.Locations.StylezHairStudio.HairdresserWorkstations:GetChildren()) do
- if not workstation.Mirror.HairdresserGUI.Used.Visible and workstation.Occupied.Value == _NPC then
- local k = workstation.Mirror.HairdresserGUI.Frame
- local style = k:FindFirstChild("Style")
- local color = k:FindFirstChild("Color")
- local style_done, hair_done = false
- for i = 1,18 do
- if not hair_done then
- for i,v in pairs(getconnections(color.Next.Activated)) do
- v:Fire()
- end
- end
- if not style_done then
- for i,v in pairs(getconnections(style.Next.Activated)) do
- v:Fire()
- end
- end
- if _STYLE ~= nil and tostring(_STYLE) == tostring(npcstyle) then
- _STYLE = nil
- style_done = true
- end
- if hairassets_colors[npccolor].Value == workstation.HairdresserDummy.Hair.BrickColor then
- hair_done = true
- if style_done then
- for i,v in pairs(getconnections(k.Done.Activated)) do
- v:Fire()
- end
- break
- end
- end
- end
- end
- end
- return order
- end)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement