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

Hey is there any way to add a new humanoid propertie? "Sheild" [closed]

Asked by
Tizzel40 243 Moderation Voter
5 years ago

i want to make a propertie called "sheild" which means the sheild health must be depleated in order for the actual health to be depleted.

Closed as Not Constructive by RubenKan

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
2
Answered by
Vezious 310 Moderation Voter
5 years ago

Yeah, you could do this various ways. Although, you would have to go through each script that takes damage and modify it.

The first way is the nooby number value way.

Create a Shield NumberValue and insert it into the character.

A better alternative is making a module.

local Table = {
    MaxShieldHealth = 50
    ShieldHealth = 20
}

local Humanoid = script.Parent:FindFirstChild("Humanoid")


function Table:TakeDamage(Damage)
    --script this yourself 
end

return Table

and in other scripts you can just do

local Character = Player.Character
local ShieldModule = require(Character.Shield)

print(ShieldModule.ShieldHealth) 
print(ShieldModule.MaxShieldHealth)
ShieldModule:TakeDamage(69) -- ;)

If this helped you, accept this answer Or feel my wrath.

0
feel his wrath! awesomeipod 607 — 5y
0
no Tizzel40 243 — 5y
Ad
Log in to vote
4
Answered by 5 years ago

can't add a property but you could manipulate one of the already existing properties. Say increased health, and when health is above a certain number it could be considered apart of the shield's durability metre. Unless you wanted them working separately and you'd have to use your own system cx.