Matheus Vieira
Member
- Joined
- Apr 11, 2015
- Messages
- 102
- Reaction score
- 6
Hello guys, Im having trouble trying to identify a party member in this script:
This script works fine, it only activates if the person in the party with the storage takes damage, but I want something different. I want: If the Party Member takes a hit, the script should activate.
I just want the STATSCHANGE_HEALTHLOSS work for the party members, not only when the storage player takes a hit
If this may have been confusing for you, ask me and I will try to explain in another way
Lua:
function onStatsChange(cid, attacker, type, combat, value)
if getCreatureStorage(cid, 1111111) >= 1 then
if isInParty(cid) == true then
for _, party in ipairs(getPartyMembers(cid)) do
if type == STATSCHANGE_HEALTHLOSS and value >= 1 then
if math.random(1, 100) <= 50 then
print ("worked")
end
end
end
This script works fine, it only activates if the person in the party with the storage takes damage, but I want something different. I want: If the Party Member takes a hit, the script should activate.
I just want the STATSCHANGE_HEALTHLOSS work for the party members, not only when the storage player takes a hit
If this may have been confusing for you, ask me and I will try to explain in another way