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

how do i make a brick that kill?

Asked by 4 years ago

I nee d help scripting a killbrick

0
This is scriptinghelpers not scriptingmakers. Freddan2006YT 88 — 4y
0
Yea he needs help with a script Vortex_Vasne 89 — 4y

2 answers

Log in to vote
2
Answered by 4 years ago
Edited 4 years ago

I got the script hope this helps :D im editing cuz i made a better one

--Vortex_Vasne's KillScript
function onTouch(part) 
    local humanoid = part.Parent:FindFirstChild("Humanoid") 
    if (humanoid ~= nil) then   
    humanoid.Health = 0 --set if you want to heal/kill
end 
end

script.Parent.Touched:connect(onTouch)

0
thanks for the answer, plesae make sure to put your code inside of a code block though. royaltoe 5144 — 4y
0
o Vortex_Vasne 89 — 4y
0
do you know how to do it? royaltoe 5144 — 4y
0
no Vortex_Vasne 89 — 4y
View all comments (2 more)
0
late reply, but i think you figured it out royaltoe 5144 — 4y
0
use :Connect() not :connect() WideSteal321 773 — 4y
Ad
Log in to vote
0
Answered by
Fla_res 13
4 years ago
Edited 4 years ago

alright, i know someone has already posted, but ill do this in lua script so its easier to understand.

--This code is from roblox dev wiki. By flares!
    local Part = script.Parent

    local function onPartTouch(Part)
        local PartParent = Part.Parent
        local humanoid = PartParent:FindFirstChildWhichIsA("Humanoid")
        if humanoid then
            -- Set player's health to 0
            humanoid.Health = 0
        end
    end
   Part.Touched:Connect(onPartTouch) 

hope you enjoy!

0
uh u wrote the same thing as him EmbeddedHorror 299 — 4y

Answer this question