Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is my accessory giving script unreliable?

Ok so i have this script ive been working on for a while i changed a few things like CharacterAdded to CharacterAppearenceLoaded but nothing works here is the code

Hat = workspace["Accessory"] 
 
game.Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAppearanceLoaded:Connect(function(Character)
        Hat:Clone().Parent = Character
    end)
end)

1 comment

0

Try changing the variable for the hat to: hat = workspace:WaitForChild("Accessory")

1 answer

✓ Accepted answer

What I'd do is put the accessory in a folder in ReplicatedStorage.

local hat = game.ReplicatedStorage.FOLDER_NAME_HERE:WaitForChild("Accessory") --waits for the accessory to load in

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAppearanceLoaded:Connect(function(char)
		hat:Clone().Parent = char
	end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.