Guest User

Untitled

a guest
Apr 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. function onStepIn(cid, item, position, fromPosition)
  2.  
  3.     local damages = {
  4.         300,
  5.         600,
  6.         2400,
  7.         3600,
  8.         6000,
  9.         getCreatureHealth(cid)
  10.     }
  11.    
  12.     local strActionID = tostring(item.actionid)
  13.    
  14.     local playerVocation = getPlayerVocation(cid)
  15.    
  16.     local currentVocation = string.sub(strActionID, 3, 3)  
  17.    
  18.     if((currentVocation ~= playerVocation) and ((currentVocation + 4) ~= playerVocation)) then
  19.    
  20.         local index = tonumber(string.sub(strActionID, 4, 4))
  21.         local damage = tonumber(damages[index])
  22.        
  23.         doCreatureAddHealth(cid, -damage, CONST_ME_FIREAREA, COLOR_RED)
  24.    
  25.         doPlayerSendCancel(cid, "You are in the wrong path!")
  26.     end
  27.    
  28.     return true
  29.    
  30. end
Add Comment
Please, Sign In to add comment