Only use the CharacterAdded event. Try Players[i].Character:MoveTo(vector3) instead of setting the CFrame maybe but its weird that it would freeze them. I’m not sure
turns out the event is only firing the first time i die. it actually doesnt matter whether I reset or die from a kill block now?
the event will only fire once any help?
just use a connection.
local respawnConnection
function characterAdded(character)
--code
respawnConnection:Disconnect()
respawnConnection = players[i].CharacterAdded:Connect(characterAdded)
end
respawnConnection = players[i].CharacterAdded:Connect(characterAdded)
I don’t understand what you mean by that, but why exactly does this event only run once?
because, you’re setting the player’s character to another character, and never changing the connection to the new character so the event only fires for the old character
Oh great explanation. Is there a simple fix for that besides connections though, because I don’t quite under that.
Actually i do understood what the connections mean. You really helped me sir, thank you.
I understood when i saw you reconnected it to the character added right after the disconnect in the post above. You just made me learn a useful new concept ty!
glad to hear you understand it. using connections:
local deathConnection
local hum = players[i].Character.Humanoid
function died()
players[i]:LoadCharacter()
hum.Health = 100
--whatever this line is, can't see it
players[i].Character.Parent = workspace.GameSystem.playersInGame
print("teleported?")
hum = players[i].Character:WaitForChild("Humanoid")
deathConnection:Disconnect()
deathConnection = players[i].Character.Humanoid.Died:Connect(characterAdded) --set the event for the new character
end
deathConnection = hum.Died:Connect(died) --for the old character
Wow i understand that (like just now), but never would have figured it out on my own even if i understood connections. You seem smart lol and im a bit intimidated now lol.
Bruh i still dont get this. What function do i add in the characterAdded spot?
What do you mean by set the event for the new character there?
when you respawn the character, the game automatically sets the new character, which will be the ‘new character’
do you not have a characteradded event?
Wait? But why would i establish a connection to an event? I thought you can only connect to functions?
Ohh did you want me to right the characterAdded function above cus that would make more sense.
the connection is the event and the function combined.
so when an event is called, the function gets called too.
the connection is variable for it
Yes i understand, but I didn’t realize at first that i had to make the respawn connection too sorry!
that is alright, that was the first example that made you understand connections completely new anyway