local char = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:wait()
For some reason it don't work, can someone help?
The local player can only be accessed from the client, it won't work on the server as the server is not associated with any of the clients therefore local player will be nil.
To fix this, you'd have to use a local script to get the local player, or use a RemoteEvent if you need this to be done on the server.