There are no errors. The goal is to change a hat based on several variables.
plr = game.Players.LocalPlayer
char = plr.Character
plrstats = script.Parent.Parent.PlayerStats
hatval = plrstats.ActiveHat
function onChanged(property)
if property == hatval then
if hatval.Value == "TempleSoldier1" then
game.ReplicatedStorage.Hats.TempleSoldier1:clone().Parent = char
elseif hatval.Value == "TempleSoldier2" then
game.ReplicatedStorage.Hats.TempleSoldier2:clone().Parent = char
elseif hatval.Value == "TempleSoldier3" then
game.ReplicatedStorage.Hats.TempleSoldier3:clone().Parent = char
end
end
end
plr.Changed:connect(onChanged)
THANKS

2 comments
Still not working...
Let me re-create the whole thing to see what's wrong. I'll get back to you as soon as I can