Hello dear scripters
Im beginner in lua, i started writting in this language from yesterday xD
I made my second script and it's not working. Could someone explain me whats wrong and correct it?
Script is checking character (cid) level.
participate level by 10 ( level / 10 )
Nextly getting resault and integer it up ex.(if 1.5 get to 2.0 [math.ceil("..cc..")])
And giving player as much cc as is in the resault (cc)
Im beginner in lua, i started writting in this language from yesterday xD
I made my second script and it's not working. Could someone explain me whats wrong and correct it?
PHP:
local level = 1
function onUse(cid, item, fromPosition, itemEx, toPosition)
if itemEx.itemid == 2283 then
level = getPlayerLevel(cid)
local cc = (level / 10)
math.ceil(cc)
doPlayerAddItem(cid,2160,cc)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You gain "..cc.." as a reward!")
doRemoveItem(item.uid)
else
doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You cant use it.")
end
end
Script is checking character (cid) level.
participate level by 10 ( level / 10 )
Nextly getting resault and integer it up ex.(if 1.5 get to 2.0 [math.ceil("..cc..")])
And giving player as much cc as is in the resault (cc)
Last edited: