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 5 years ago

I nee d help scripting a killbrick

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

2 answers

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

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

1--Vortex_Vasne's KillScript
2function onTouch(part)
3    local humanoid = part.Parent:FindFirstChild("Humanoid")
4    if (humanoid ~= nil) then  
5    humanoid.Health = 0 --set if you want to heal/kill
6end
7end
8 
9script.Parent.Touched:connect(onTouch)
0
thanks for the answer, plesae make sure to put your code inside of a code block though. royaltoe 5144 — 5y
0
o Vortex_Vasne 89 — 5y
0
do you know how to do it? royaltoe 5144 — 5y
0
no Vortex_Vasne 89 — 5y
View all comments (2 more)
0
late reply, but i think you figured it out royaltoe 5144 — 5y
0
use :Connect() not :connect() WideSteal321 773 — 5y
Ad
Log in to vote
0
Answered by
Fla_res 13
5 years ago
Edited 5 years ago

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

01--This code is from roblox dev wiki. By flares!
02    local Part = script.Parent
03 
04    local function onPartTouch(Part)
05        local PartParent = Part.Parent
06        local humanoid = PartParent:FindFirstChildWhichIsA("Humanoid")
07        if humanoid then
08            -- Set player's health to 0
09            humanoid.Health = 0
10        end
11    end
12   Part.Touched:Connect(onPartTouch)

hope you enjoy!

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

Answer this question