So, I've been trying to work around a hat removal script when a player first enters a server, but they have not been working. Does anyone know how to do so? My entire script is:
1 | local player = game:GetService( "Players" ).LocalPlayer |
2 | game.Players.PlayerAdded:connect( function () |
3 | for _, object in pairs (player.Characer:GetChildren()) do |
4 | if object:IsA( "Hat" ) then |
5 | object:Destroy() |
6 | end |
7 | end |
8 | end ) |