Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onTargetTile_1(cid, pos)
- local target = getTopCreature(pos)
- if target.itemid > 0 and isPlayer(target.uid) then
- target = target.uid
- local addStun = false
- if not playerStunAdd[cid] or (playerStunAdd[cid] and playerStunAdd[cid] < os.time()) then
- addStun = true
- end
- if addStun and (not playerStunGet[target] or (playerStunGet[target] and playerStunGet[target] < os.time())) then
- doCreatureSetNoMove(target, true)
- playerStunGet[cid] = os.time() + nextStunTimeCanGet
- addEvent(removeStun, stunTime*1000, target)
- doPlayerSendTextMessage(target, MESSAGE_STATUS_DEFAULT, 'Stuned!!')
- else
- addStun = false
- end
- if addStun then
- playerStunAdd[cid] = os.time() + nextStunTimeCanAdd
- end
- end
- end
- return true
- end
- setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTile_1")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement