So I'm making a game and I want to have a GUI and when you click it your character respawns but I don't know how to code that, any help?
Actually, a nicer method would be to use player:LoadCharacter(), this will reload their character immediately. To use this script create a Remote Event object and place it in workspace. Call it "reload".
In a Local Script:
script.Parent.MouseButton1Down:connect(function() workspace.reload:FireServer() end)
In a Server Script:
workspace.reload.OnServerEvent:connect(function(player) player:LoadCharacter() end