You don’t need to make multiple remotes for each hat. You can FireServer with a string of text, with the text being the hat ID. Here’s an example of passing a string through a remote event:
LocalScript:
local replicatedStorage = game:GetService("ReplicatedStorage")
local event = replicatedStorage.RemoteEvent
event:FireServer("Hello")
Server Script:
local replicatedStorage = game:GetService("ReplicatedStorage")
local event = replicatedStorage.RemoteEvent
event.OnServerEvent:Connect(function(player, text)
print(text) -- Output: "Hello"
end)
local plr = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
if plr.Character:FindFirstChild("Scarf") then
else
game.ReplicatedStorage.Hat:FireServer("Scarf")
end
end)
—Server—
game.ReplicatedStorage.Hat.OnServerEvent:Connect(function(plr, scarf)
if scarf == "Scarf" then
local scarfc = game.ReplicatedStorage.EnlistedAccessories.Scarf:Clone(plr.Character)
scarfc.Parent = plr.Character
end
end)
No it’s not a model and I’ve welded all the parts together in the accessory and tested it on a dummy.
I’ve done this before, but not with a single remote event so maybe that’s the problem.