Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.