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