When a player touches a part it takes damage, but when the player dies then respawns and touches the same part the player isn't taking damage.
LocalScript inside StarterPlayerScripts:
local player = game.Players.LocalPlayer local playername = player.Name local humanoid = game.Workspace:WaitForChild(playername) local realhumanoid = humanoid.Humanoid
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function(player, hit) print("ok,ok") realhumanoid:TakeDamage(10) end)
Script in Part in Workspace:
script.Parent.Touched:Connect(function(hit) print(hit) local realplayer = hit.Parent.Name local realplayer2 = game.Players:FindFirstChild(realplayer) if hit.Parent:FindFirstChild("Humanoid")then print("ok") game.ReplicatedStorage.RemoteEvent:FireClient(realplayer2, hit) end end)

1 comment
You should not deal damage locally. You should be dealing it from the server.