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

How to make a destroyable gate?

Asked by 9 years ago

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

Log in to vote
1
Answered by
Validark 1580 Snack Break Moderation Voter
9 years ago

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.

0
Thank and I am using guns so what should I do for that? CybeTech 37 — 9y
0
Pretty much the same thing, I think. Depends on the gun Validark 1580 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

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.)

Answer this question