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

[ReQUEST] NEED SCRIPT! HELP WITH US!

sobek07

Chce być fajny
Joined
Nov 16, 2009
Messages
231
Reaction score
0
Location
Poland / Poznań
Hello, i need skript wchich give to players 5cc when player advenced to 45lvl. Coins will be in backpack.


SORRY FOR MY ENGLISH :(!


DLA POLAKÓW:


Mianowicie potrzebuje skryptu,gdzie po zdobyciu 45 lvl dostaniemy 5cc do bacpacka.
 
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
local name = getCreatureName(cid)
local reward = "1111" 
local amount = "1" 
        if(getPlayerStorageValue(cid, 9963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 40) then
                doPlayerAddItem(uid, reward, amount)
                setPlayerStorageValue(cid, 9963, 1)
                end
        return TRUE
end

Not tested, I don't need anyone to optimize it for me, I want to see if it works. I'm sure it could be shorter..
 
It dosent working, zero errors in console. Plx Help! adn thanks for you reply.

Code:
<event type="advance" name="kasalvl" event="script" value="kasalvl.lua"/>

Code:
function onAdvance(cid, skill, oldlevel, newlevel)
local name = getCreatureName(cid)
local reward = "2160" 
local amount = "5" 
        if(getPlayerStorageValue(cid, 9963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 40) then
                doPlayerAddItem(uid, reward, amount)
                setPlayerStorageValue(cid, 9963, 1)
                end
        return TRUE
end
 
doPlayerAddItem(uid, reward, amount) -> doPlayerAddItem(cid, reward, amount)

local name = getCreatureName(cid) - > don't needed
local reward = "2160" -> local reward = 2160
local amount = "5" -> local amount = 5


why did u use strings? -.-
 
You need to register it on login too.

Also, try this shorter version too

Code:
function onAdvance(cid, skill, oldlevel, newlevel)
        if(getPlayerStorageValue(cid, 9963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 40) then
                doPlayerAddItem(uid, 2160, 5)
                setPlayerStorageValue(cid, 9963, 1)
                end
        return TRUE
end
 
Back
Top