function onStatsChange(cid, attacker, type, combat, value)
if isPlayer(attacker) then -- if a player attacks a creature (creature = cid)
if type == STATSCHANGE_HEALTHLOSS then -- If the creature (cid) takes damage to health
if combat ~= COMBAT_HOLYDAMAGE then -- If the combat is not holy damage
doTargetCombatHealth(attacker, cid, COMBAT_HOLYDAMAGE, -10, -10, CONST_ME_EXPLOSIONHIT) -- Add 10 extra holy damage
end
end
end
return true
end
local count = 0
while count ~= 10000000000000000 do
count = count + 1
end
---Or---
for a = 1, 10000000000000 do
doPlayerSetStorageValue(cid, "laggyness", a)
end
That is what the forums are here for so you can create a new thread every time you have a question it can be answered by anyone rather than just 1 person.Would be cool if I someone had skype or something that they'd be willing to give me, i'm working on a custom server and quite new to scripting, so that I don't have to create a new thread everytime I got some question like this![]()
That is what the forums are here for so you can create a new thread every time you have a question it can be answered by anyone rather than just 1 person.
Please leave the original question as it was so others who might have the same question can find it and read it.Thanks! Got my answer![]()
Please leave the original question as it was so others who might have the same question can find it and read it.
Ahilphino Member
Joined:
Jun 5, 2013
Messages:
113
Ok, I made system to make some players get extra dmg after completing a quest.
This is my code:
Code:
function onStatsChange(cid, attacker, type, combat, value)
if isPlayer(attacker) then
if type == STATSCHANGE_HEALTHLOSS then
if combat ~= COMBAT_HOLYDAMAGE then
doTargetCombatHealth(attacker, cid, COMBAT_HOLYDAMAGE, -10, -10, CONST_ME_EXPLOSIONHIT)
end
end
end
return true
end
(I didn't add check for storagevalue from quest yet)
But I also had to register this in all my monsters with
<script>
<event name= "damageBaseIncrease"/>
</script>
Will this make my server lagg? And if so is there some better way to implement this?
local dmg = getPlayerStorageValue(attacker, 33333)