• 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!

Simple & Easy script// +++REP for who makes it.

Nightyz

New Member
Joined
Feb 5, 2013
Messages
24
Reaction score
0
A simple script that if a player uses x item, gets promoted 1 group, like if he is a player (He gets promoted to tutor if he uses that item), if he used again (he gets promoted to Senior Tutor), thanks,
And I want another script, that if someone used x item, gets promoted 2 groups, okay?
Simple, right?
Thanks in advance.
 
For the first one:

Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
local pG = getPlayerGroupId(cid)
doRemoveItem(item.uid, 1)
doPlayerSetGroupId(cid, pG + 1)
return true
end

For the second one:
Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
local pG = getPlayerGroupId(cid)
doRemoveItem(item.uid, 1)
doPlayerSetGroupId(cid, pG + 2)
return true
end
 
For the first one:

Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
local pG = getPlayerGroupId(cid)
doRemoveItem(item.uid, 1)
doPlayerSetGroupId(cid, pG + 1)
return true
end

For the second one:
Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
local pG = getPlayerGroupId(cid)
doRemoveItem(item.uid, 1)
doPlayerSetGroupId(cid, pG + 2)
return true
end
Thank you, a lot! Rep'ed.
If you'd gimme what should I put in actions.xml, I'd be thankful.
Please!

- - - Updated - - -

Tried to put this, and it just work if I make the item have (actionID), but I want the current item (5952 by example) to be the item that if I use, it makes me 1groupadd or 2groupadd.
Try to fix me a .xml thingy.
 
data/actions/actions.xml
Lua:
<action itemid="ITEMID HERE" event="script" value="gr1.lua"/>
Lua:
<action itemid="ITEMID HERE" event="script" value="gr2.lua"/>

data/actions/scripts
g1
Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
local pG = getPlayerGroupId(cid)
doRemoveItem(item.itemid, 1)
doPlayerSetGroupId(cid, pG + 1)
return true
end

gr2
Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
local pG = getPlayerGroupId(cid)
doRemoveItem(item.itemid, 1)
doPlayerSetGroupId(cid, pG + 2)
return true
end

try that :)
 
data/actions/actions.xml
Lua:
<action itemid="ITEMID HERE" event="script" value="gr1.lua"/>
Lua:
<action itemid="ITEMID HERE" event="script" value="gr2.lua"/>

data/actions/scripts
g1
Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
local pG = getPlayerGroupId(cid)
doRemoveItem(item.itemid, 1)
doPlayerSetGroupId(cid, pG + 1)
return true
end

gr2
Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
local pG = getPlayerGroupId(cid)
doRemoveItem(item.itemid, 1)
doPlayerSetGroupId(cid, pG + 2)
return true
end

try that :)
Works very well, rep'ed.
 
Back
Top