✓ Accepted answer
I think a practical way to accomplish this would be using the CharacterAdded event, then have it disconnect itself after the code inside the function has terminated. Here's an example:
Local script
respawnevent:FireServer()
Server script
local SpawnPos = workspace.SpawnPart
respawnevent.OnServerEvent:connect(function(Client)
local PlayerRespanwed
PlayerRespanwed = Client.CharacterAdded:connect(function(Char)
local Torso = Char:WaitForChild("Torso")
Torso.CFrame = CFrame.new(SpawnPos.Position+Vector3.new(0,3,0))
PlayerRespanwed:disconnect()
end)
end)
A better suggestion?
Now, that's how that'd be done using remotes. However in this case, I don't think it's very necessary. Since we know this event should take place every time the player dies, we can simply avoid using remotes and just use this code in a server script:
local Players = game:GetService("Players")
local SpawnPos = workspace.SpawnPart
Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Char)
local Torso = Char:WaitForChild("Torso")
Torso.CFrame = CFrame.new(SpawnPos.Position+Vector3.new(0,3,0))
end)
end)
Hope this helped, let me know if you have any questions.