• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Action Exp Scroll

Aardappel

Learning LUA
Joined
Dec 24, 2007
Messages
145
Reaction score
0
Hi guys this is one of my first script this is an exp scroll


I did'nt tested cause i can't run servers over here

ill hope it works:)


Code:
function onUse(cid, item, frompos, item2, topos)
local exp = math.random(5000, 10000)
if item.itemid == 6119 then
doPlayerAddExp(cid,exp)
doCreatureSay(cid, "hmm i like exp", 17)
doPlayerRemoveItem(cid,6119,1)
else
doPlayerSendCancel(cid,"Sorry, not possible")
return TRUE
end

and add to actions.xml :
Code:
<action itemid="6119" event="script" value="tools/exp.lua"/>
 
it will be better if you use this one

PHP:
function onUse(cid, item, frompos, item2, topos)
config = 
     exp = math.random(
                      5000,      -- min exp
                      10000      -- max exp
),
     text = "hmm i like exp"     -- text
)
     doPlayerAddExp(cid,config.exp)
     doCreatureSay(cid,config.text, 17)
     doPlayerRemoveItem(cid,item.itemid,1)
return TRUE
end
 
Won't even work, Shawak. And it's his first script so tell him why.

You should use local config = { <here the crap like exp> }

And you forgot one '('.


Oh and I think math.random(5000, 10000) looks better than with the enters between it.
 
You can not use this object. :( Can someone fix this script please? Or tell me where to find exp scroll script?


Thank you!
 
Back
Top