|
I trying to mimic the shield found in the Halo games but everytime the Shield Humanoid gets hurt so does the original humanoid this is the onRespawned script:
function onPlayerRespawned(newPlayer)
local hScript = script.Humanoid:clone()
local name = newPlayer.Name
local player = script.Parent:findFirstChild(name)
hScript.Parent = player
hScript.Disabled = false
end
script.Parent.ChildAdded:connect(onPlayerRespawned)
and this is the Humanoid script:
local p = script.Parent
local h = p.Humanoid
h.Name = "Health"
local h2 = Instance.new("Humanoid")
h2.Parent = p
h2.Sit==true
h2.Died:connect(function() h2:Remove() h.Name = "Humanoid" end)
I also made it into a model:
http://www.roblox.com/Item.aspx?ID=17832538
Any help would be appreciated =D |
|
0364831Join Date: 2008-10-14 Post Count: 178 |
Er..Erm...
Whats wrong with it? |
|
|
Did you even read the thread at all?
"Everytime the Shield Humanoid gets hurt so does the original humanoid" |
|
|
The output also says nothing. |
|
0364831Join Date: 2008-10-14 Post Count: 178 |
So....Whut. |
|
KagrenacJoin Date: 2008-02-16 Post Count: 847 |
Make two humans, make one take damage and the other keep refilling until the second ( shield ) 's health is 0 |
|
|
I know but if the Shield takes damage so does the original Humanoid |
|
KagrenacJoin Date: 2008-02-16 Post Count: 847 |
So make it regen
script.Parent.Changed:connect(function(prop)
if prop == "Health" then
script.Parent.Health = 100
end
end) |
|
|
The problem is it doesn't rename the Humanoids or make the shield one sit |
|
|
|
|
Why doesn't it rename the Humanoid's? |
|
KagrenacJoin Date: 2008-02-16 Post Count: 847 |
Well I don't understand what you mean by rename... |
|
|
|
Why not just take the humanoid's health before its attack and after an attack make it so it is restored to the last health... |
|
|
kension19Join Date: 2008-01-17 Post Count: 6964 |
I remember trying to make something like this. You gotta use a value in the character, and when the bullet/damaging brick tries to deal damage, it checks the value to see if its at 0, then it looks at the humanoid and takes health from it. Its really simple if you set it up the right way. |
|
|
Really? I've been working at it for 2 weeks and I don't find it all that simple. Well thanks anyways I'll try that. |
|
|
@ kension19
I think your way is the most reasonable |
|