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

How to make a destroyable gate?

So I have been sitting here thinking about all the ways I could make this but I just don't know how it would work I know I would most likely need a humanoid and a way to track the health so when it reaches 0 The gate will have an exploding event(or instance I forget which one it is) and then whom ever can pour in sort of like the gates at medieval warfare reforged also I** AM NOT asking for you to make this for me** I simply want to know HOW I can like reference me to a source or video so I can understand and comprehend the code myself.

2 answers

You could put a Humanoid or an IntValue inside of the gate. If you are using a sword to break it, swords usually check if the brick they hit was a character by checking if it has a humanoid, so you could use a humanoid or make it so the sword script checks for an IntValue and subtracts from there.

2 comments

0

Thank and I am using guns so what should I do for that?

0

Pretty much the same thing, I think. Depends on the gun

Simple. Add a humanoid and a torso and a head. Then weld the head:

local h,t = script.Parent.Head,script.Parent.Torso
local w = Instance.new("Weld", t)
w.Part0 = t
w.Part1 = h
script.Parent:MakeJoints()

Now add a humanoid and make the Head part invisible. So now, the gun will hurt both the player and the gun!. Amazing!


Hope it helps!(This is more like a building question.)

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