Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my accessory giving script unreliable?

Asked by 4 years ago

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)
0
Try changing the variable for the hat to: hat = workspace:WaitForChild("Accessory") AlmostADemon 50 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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)
Ad

Answer this question