Hello, I'm kinda new to Lua, so if you could be specific as possible, that would be great.
I'm trying to make a script where every time a player spawns, they get a hat, which I've put in ServerStorage. (And yes, the hat works)
Here's what I've tried:
game.Players.PlayerAdded:connect(function(ply)
ply.CharacterAdded:connect(function(char)
if ply.Name=="iRzPWNzr" or "Player1" then --Player1 is in there for Studio testing
game.ServerStorage.DevDominus:Clone().Parent = ply.char
end end) end)
Any help is appreciated. Thank you!

3 comments
I'm not sure you can get the name with a PlayerAdded connect function, I would you for i,v in pairs (game.Workspace:GetChildren()) do if v.Name == "Player1" then
Yes, you can get the name from the PlayerAdded Event.
Oops sorry, my bad.