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

How do you put health in a brick? But...

Asked by
Mystdar 352 Moderation Voter
10 years ago

How would you do that but it can only be damaged by certain objects, for example.

local damager=game.workspace.block -- name of the block
if.damager=function onTouch(hit) -- If the Part touches it
-- Then it will remove a certain amount of health

This isn't an accurate script just a hazy explanation of what I require

1 answer

Log in to vote
-2
Answered by 10 years ago

Maybe you could replace part of this VIP door script

Original

local allow = player.Name == "MrDoomBringer" 
           or player.Name == "JulienDethurens"
           or player.Name == "blocco"
           or player.Name == "NXTBoy"
           or player:IsInGroup(127081) and player:IsFriendsWith(game.CreatorId)
           or game:GetService('BadgeService'):UserHasBadge(player.userId, 1032571)
           or game.CreatorId == player.userId

if allow then
    open()
    delay(4, close)
end

Modified

local allow = game.workspace.block - the damagers
          or game.workspace.otherblock

local brick = Workspace.Part - part with health

 function onTouch(part)
if allow then
damage() - damage function
end

brick.Touched:connect(onTouch)

Again not sure if this would work but it's worth a shot

Ad

Answer this question