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

Windows Exp Egg

Status
Not open for further replies.

Kippetjee

Member
Joined
Jun 17, 2009
Messages
1,197
Reaction score
11
Location
The Netherlands
hello im try get my exp egg Fixed But it not help :(

When you use the egg you need get 300exp

im using this

Lua:
local experience = 300

function onUse (cid, item, fromPosition, itemEx, toPosition)
doPlayerAddExperience (cid, experience)
doCreatureSay(cid, ".. experience .." EXPERIENCE!")
return true
end

Lua:
 <action itemid="6542" event="script" value="exp.lua"/>


but when your using the egg it saids you canot use this opject
 
Last edited:
Code:
local config = {
funnyEffect = "YES", -- effects fireworks & Animated Text  (YES/NO) 
minimumLevel = 8,
maximumLevel = 1000, -- for infinite type math.huge
}
local addExp = {
[{config.minimumLevel, 40}] = 300,
[{8, 40}] = 300,
[{40, 60}] = 300,
[{60, 80}] = 300,
[{80, 100}] = 300,
[{100, 120}] = 300,
[{120, 140}] = 300,
[{140, 1000}] = 300
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local level = getPlayerLevel(cid)
    local effect = math.random(CONST_ME_FIREWORK_YELLOW,CONST_ME_FIREWORK_BLUE) 

    if level < config.minimumLevel then
        doPlayerSendCancel(cid, "You need to be at least "..config.minimumLevel.." to use a egg.")
        return FALSE 
    end
    
    if level >= config.maximumLevel then
        doPlayerSendCancel(cid, "Your level is too high for using a egg.")
        return FALSE 
    end

    for k, v in pairs(addExp) do 
        if level >= k[1] and level < k[2] then 
            doPlayerAddExp(cid, v)
            doRemoveItem(item.uid, 1)
            break 
        end 
    end  

        if config.funnyEffect == "YES" then
        local pos = getPlayerPosition(cid)
        local positions = {
                {x=pos.x+1,y=pos.y-1,z=pos.z},
                {x=pos.x-1,y=pos.y-1,z=pos.z},
                {x=pos.x+1,y=pos.y+1,z=pos.z},
                {x=pos.x-1,y=pos.y+1,z=pos.z},
                {x=pos.x+1,y=pos.y,z=pos.z},
                {x=pos.x-1,y=pos.y,z=pos.z},
                {x=pos.x,y=pos.y+1,z=pos.z},
                {x=pos.x,y=pos.y-1,z=pos.z}
        }

        for i = 1, table.getn(positions) do
            doSendAnimatedText(getThingPos(cid), "Yeah! Exp!", TEXTCOLOR_RED) 
            doSendMagicEffect(positions[i],effect)
        end
    end
    return TRUE 
end
 
Here is the easy one :p
Lua:
local experience = 300
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
doPlayerAddExperience(cid, experience)
doCreatureSay(cid, "".. experience .." EXPERIENCE!")
return true
end

Try again please
 
post errors from loading it and what shows when you use it(everything from console)
but Trexos one should work if function names are correct,
or no, sorry, you forget talktype in creaturesay, you probably want talktype 19
doCreatureSay(cid, "".. experience .." EXPERIENCE!", 19)
?
 
Try this:
function onUse (cid, item, fromPosition, itemEx, toPosition)
doPlayerAddExperience (cid, experience)
doPlayerSay(cid, ".. experience .." EXPERIENCE!")
return true
end
 
Status
Not open for further replies.
Back
Top