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

How do I add health properties to items like Planes for when they`re shot at?

Asked by 10 years ago

I don`t want to use the ROBLOX Humanoid service, but rather another method hopefully. Thanks everyone!

2 answers

Log in to vote
0
Answered by
Sublimus 992 Moderation Voter
10 years ago

You can use a IntValue and have it when they are hit it subtracts from the value.

Ad
Log in to vote
0
Answered by 10 years ago

Add a value, like this.

val = 0

Then, make it everytime it is shot, add a number(that you want)

--lets say the planes wing will get damaged. Its named wing.--
--lets say the bullet is named b.--
Workspace.Wing.Touched:connect(function(s)
if s.Name == "b" then
val = val + 10
end
end)

Now that we have that, we have to check if the damage value is 100, and if it is it destroys the planes wing.

if val == 100 then
Workspace.Wing:Destroy()
end

I hope this helped.

Answer this question