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

How do u script a brick (to kill peaple)??

Asked by 10 years ago

How do u script a brick (to kill peaple)??

0
Yo man, go to the wiki. It's like, on the front page. http://wiki.roblox.com OniiCh_n 410 — 10y

4 answers

Log in to vote
1
Answered by 10 years ago

Make a brick called KilledBrick then make a script and put it in the ServerScriptService

Put this in the script

for I, part in pairs(game.Workspace:GetChildren()) do
   if part.Name == "KillBrick" then
         part.Touched:connect(function(object)
          if object.Parent:IsA("Model") then
            local Hum = object.Parent:FindFirstChild("Humanoid")
            if Hum ~= nil then
             Hum.Health = 0
            end
          end
         end
   end
end
Ad
Log in to vote
0
Answered by 10 years ago

I made one the other day with this script:

script.Parent.Touched:connect(function(touched)
    local found = touched.Parent:FindFirstChild("Humanoid")
        if found then
            touched.Parent.Humanoid.Health = 0
                end
                    end)

Hope this helps.

Log in to vote
0
Answered by
Ekkoh 635 Moderation Voter
10 years ago

If you just want one part to kill people, put this script in it.

local part = script.Parent
part.Touched:connect(function(hit)
    local hum = hit.Parent:FindFirstChild("Humanoid")
    if hit.Parent:IsA("Model") and hum then
        -- this means that a player or an NPC touched the part
        hit.Parent:BreakJoints()
    end
end)
Log in to vote
0
Answered by 10 years ago

1 local part = script.Parent 2 part.Touched:connect(function(hit) 3 local hum = hit.Parent:FindFirstChild("Humanoid") 4 if hit.Parent:IsA("Model") and hum then 5 -- this means that a player or an NPC touched the part 6 hit.Parent:BreakJoints() 7 end 8 end)

Answer this question