Upon respawning (but not necessarily respawning), I want the client to access its character. The server controls when the client does this by firing a remote event. For now it is simply when the character is added. The issue is that if the client reset, upon respawning, once the remote event fire is received, the client believes its character is the character it had before dying. Code:
--server
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
game.ReplicatedStorage.RemoteEvent:FireClient(plr)
end)
end)
--client
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(data)
if (game.Players.LocalPlayer.Character == nil) then
game.Players.LocalPlayer.CharacterAdded:wait()
end
print(game.Players.LocalPlayer.Character:GetChildren())
end)
I have included a video that shows how when the children of the character is printed locally, after the character spawns in, it includes an instance that I added to the character before it died.
I’d like for the client to recognize its new character after respawning rather than referencing its old one. Any help would be appreciated.