Hi! Are you talking about touching a part and they die for touching it? If so, here’s the script.
local Brick = script.Parent
local function PlayerTouched(Part)
local Parent = Part.Parent
if game.Players:GetPlayerFromCharacter(Parent) then
Parent.Humanoid.Health = 0
end
end
Brick.Touched:connect(PlayerTouched)
Is there any particular reason you are listening for a Touched event on the client?
If you switch to a server script you can use this:
local function onTouched(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if (player ~= nil and player.Character ~= nil and player.Character:FindFirstChild("Humanoid") ~= nil and not player.Character.Humanoid.Sit) then
player.Character.Humanoid:TakeDamage(100)
end
end
script.Parent.Touched:Connect(onTouched)