Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Character removed event not working in client when called?

Asked by 4 years ago

Context, I'm trying to obtain the death position of a character model using characterremoving event. I am handling this in a local script attached to the starter PlayerScripts.

Additionally, the game is set so the player doesn't autoload the character, this is handled through the remote event "repS.loadcharacter"

lp in the code is the local player.

--This function doesn't play when player dies
lp.CharacterRemoving:Connect(function(c)
    print("Died")
    local hum = c:WaitForChild("Humanoid")
    local hrp = c:WaitForChild("HumanoidRootPart")
    repS.event.loadcharacter:FireServer(hrp.CFrame,hrp)
end)
--This function plays when player respawns
lp.CharacterAdded:Connect(function()
    print("Added")
end)


repS.event.loadcharacter:FireServer()

Is this an issue with using character removed in the client?

Answer this question