local Hat = game.ReplicatedStorage:WaitForChild("Hat_1")
local Player = game.Players.LocalPlayer
local Char = Player.Character
local Humanoid = Char:WaitForChild("Humanoid")
function GetPlayers()
for _,v in pairs(game.Players:GetChildren()) do
if v.Name == "Player1" then
Humanoid:AddAccessory(Hat)
end
end
-- print ("No errors found.")
end
GetPlayers()
This is a LocalScript. I'm almost certain it has something to do with an if statement. I also know that functions repeat but apparently not this one.
UPDATE
local Hat = game.ReplicatedStorage:WaitForChild("Hat_1")
local Player = game.Players.LocalPlayer
local Char = Player.Character
local Humanoid = Char:WaitForChild("Humanoid")
if Player.Name == "Player1" then
Humanoid:AddAccessory(Hat)
print ("Fluid.")
end
So apparently you can't reset the function AddAccessory(). I've tried cloning with the Add() function and it did not work. I have been told that I can "repeat" this by adding the accessory every time they respawn however I don't know how to go about this. Any help?

1 comment
Why would you want to do this with all the players? Why just the specific player?