RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"script to make all parts tagged with "Kill" to kill the player. add detailed comments."
-- Server script to make all parts tagged with "Kill" to kill the player -- Get the service local Players = game:GetService("Players") -- Connect the player added event Players.PlayerAdded:Connect(function(player) -- Connect the character added event player.CharacterAdded:Connect(function(character) -- Connect the part touched event character.HumanoidRootPart.Touched:Connect(function(part) -- Check if the part has the tag "Kill" if part:FindFirstChild("Tag") and part.Tag.Value == "Kill" then -- Kill the character character.Humanoid.Health = 0 end end) end) end)