hey, ive been making a dummy script which allows me to put catalog accessories on that specific dummy, for people to buy these hats using prompt purchase, and players can also try on specific accessories by clicking a try button. The try feature used to work, but somehow doesnt anymore, i mightve changed something accidentally but can’t seem to see where. These are my scripts:
server script:
local debounce = {}
game.ReplicatedStorage.trySingle.OnServerEvent:Connect(function(player, selectedHatID)
if not debounce[player.UserId] then
local desc = player.Character.Humanoid:GetAppliedDescription()
-- Append the new item to the existing accessories list
if selectedHatID then
if desc.HatAccessory == "" then
desc.HatAccessory = selectedHatID
else
desc.HatAccessory = desc.HatAccessory .. "," .. selectedHatID
end
end
if selectedHatID then
if desc.FaceAccessory == "" then
desc.FaceAccessory = selectedHatID
else
desc.FaceAccessory = desc.FaceAccessory .. "," .. selectedHatID
end
end
player.Character.Humanoid:ApplyDescription(desc)
debounce[player.UserId] = true
wait(1)
debounce[player.UserId] = nil
end
end)
local script (specifically where the trySingle is being fired):
for _, v in ipairs(script.Parent.Items.ScrollingFrame:GetChildren()) do
if v:IsA("ImageButton") then
local buy = v.Frame.Buy
if buy and buy:IsA("TextButton") then
buy.Activated:Connect(function()
mps:PromptPurchase(player, v.Name)
end)
end
local try = v.Frame.Try
if try and try:IsA("TextButton") then
try.Activated:Connect(function()
local selectedHatID = v.Name
game.ReplicatedStorage.trySingle:FireServer(selectedHatID)
end)
end
v.Activated:Connect(function()
for _, child in ipairs(script.Parent.Items.ScrollingFrame:GetChildren()) do
if child:IsA("ImageButton") and child.Frame then
child.Frame.Visible = false
end
end
v.Frame.Visible = true
end)
end
end
this is the error that i am currently experiencing:
