Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

I'm not dieing? [closed]

Asked by
FiredDusk 1466 Moderation Voter
8 years ago
script.Parent.Touched:connect(function()
    if Touched then
        game.Players.ChildAdded.humanoid = 0
    end
end)

Locked by MessorAdmin, EzraNehemiah_TF2, User#5978, and NotSoNorm

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
1
Answered by 8 years ago
local Brick = script.Parent

Brick.Touched:connect(function(Obj) -- When you touch it gets the "Leg" or "Arm"
    local Player = game:GetService("Players"):GetPlayerFromCharacter(Obj.Parent)
    -- Gets the Instance "Player"
    if Player and Player.Character then -- Obv its gonna be there... but check it anyways.
        local Humanoid  = Player.Character:WaitForChild("Humanoid") -- Find the Humanoid
        Humanoid:TakeDamage(100) -- Easy damage function.. :)
    end
 end)
Ad