I nee d help scripting a killbrick
I got the script hope this helps :D im editing cuz i made a better one
1 | --Vortex_Vasne's KillScript |
2 | function 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 |
6 | end |
7 | end |
8 |
9 | script.Parent.Touched:connect(onTouch) |
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!