How can i do so the server knows that just i have died and make so like speficic object destroys

So i’m making thats kinda like lab experiment, each player gets teleported to a plate and then some
random stuff happens. When a player dies thier platform that they spawned on destroys, and i can’t figure out how i can do that.

So simply i want to know how to get the server know that a i died and the platform that i spawned destroys.

I would really apreciate any sugestions.

local plrs = game:GetService("Players")

plrs.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		char:WaitForChild("Humanoid").Died:Connect(function()
			print("character has died!")
		-- insert code here
		end)
	end)
end)

To avoid a memory leak, you’ll want to clean-up all the connections, especially when a player leaves.
Hope this helps!

Oh tysm, idk if it was me that was dumb or you that was smart well thanks i really apreciate it

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.