Code:
script.Parent.Value.Character.Humanoid.Died:Connect(function()
script.Parent.Parent.Events.SpawnEvents.DeathEvent:Fire()
print("death")
end)
Value is the player.
After detecting once, it doesnt detect again.
Code:
script.Parent.Value.Character.Humanoid.Died:Connect(function()
script.Parent.Parent.Events.SpawnEvents.DeathEvent:Fire()
print("death")
end)
Value is the player.
After detecting once, it doesnt detect again.
Could you proivde more context on the script? Is it a server-script? Is it a local one? Where is it parented?
The script its located in a value, which is in a folder in workspace. Its a normal script.
And why is the player “Value” for some reason?
The player is associated with an object value, which is that one.
The reason it doesn’t work is because the character object inside of the player is nil when it dies, meaning it won’t detect it dying multiple times. Try detecting when the character dies inside of a CharacterAdded function and lmk how that works.
Here’s some code if you still can’t get my gist.
script.Parent.Value.Character.Humanoid.Died:Connect(function()
print("death")
end)
script.Parent.Value.CharacterAdded:Connect(function(char)
char.Humanoid.Died:Connect(function()
print("death")
end)
end)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.