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

Xikini's Free Scripting Service. [0.3.7 & (0.3.6/0.4)]

Status
Not open for further replies.

Xikini

I whore myself out for likes
Senator
Joined
Nov 17, 2010
Messages
6,827
Solutions
586
Reaction score
5,408
Doing quick (30 min or less) scripts for [0.3.7 & (0.3.6/0.4)]
I am not here to fix your broken scripts, although I will give advice if requested.
I am here for script requests of scripts not already available on the forum.
If you require support for your scripting issues please make a thread in the support section.

For clarity's sake,
I will script actionscripts, creaturescripts, globalevents, talkactions, movements, npcs for you.
I will not script spells, weapons, raids or monster scripts.
Additionally, source editing, websites and database queries are a no go as well.

Code:
How to make shorter links to posts.
https://otland.net/threads/234306/page-14#post-2330703
 
Last edited:
it doesnt work :(

You could try this. I'm not sure it will work. But it's worth a try i guess.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<stages>
<config enabled="1"/>
<world id="0" multiplier="1">
<stage minlevel="1" maxlevel="80" multiplier="300"/>
<stage minlevel="81" maxlevel="123" multiplier="250"/>
<stage minlevel="124" maxlevel="130" multiplier="225"/>
<stage minlevel="131" maxlevel="150" multiplier="200"/>
<stage minlevel="151" maxlevel="230" multiplier="150"/>
<stage minlevel="231" maxlevel="350" multiplier="100"/>
<stage minlevel="351" multiplier="50"/>
</world>
</stages>
 
Than
You could try this. I'm not sure it will work. But it's worth a try i guess.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<stages>
<config enabled="1"/>
<world id="0" multiplier="1">
<stage minlevel="1" maxlevel="80" multiplier="300"/>
<stage minlevel="81" maxlevel="123" multiplier="250"/>
<stage minlevel="124" maxlevel="130" multiplier="225"/>
<stage minlevel="131" maxlevel="150" multiplier="200"/>
<stage minlevel="151" maxlevel="230" multiplier="150"/>
<stage minlevel="231" maxlevel="350" multiplier="100"/>
<stage minlevel="351" multiplier="50"/>
</world>
</stages>
thank you!! it works thanks!! :D
 
Is it possible to make a !prestige command (lvl 717k back to lvl 8) that has a cooldown of a player using it every 8sec only one player can use it every 8 sec so it would not cause lag to a server like 1 player every 8 sec could use it
 
Is it possible to make a !prestige command (lvl 717k back to lvl 8) that has a cooldown of a player using it every 8sec only one player can use it every 8 sec so it would not cause lag to a server like 1 player every 8 sec could use it
Code:
local storage = 45001
local seconds = 8
function onSay(cid,words,param)
    time = os.time()
    if getGlobalStorageValue(storage) + seconds > time then
       doPlayerSendCancel(cid, "Please wait a few seconds.")
       return true
    end

    -- rest of script
   
    setGlobalStorageValue(storage, os.time())
    return true
end
 
I am looking for a script that allows players to step on tile with specific rebirth/prestige so i can use it on hunt area.
like for example: a tile that requires (1) Rebirth to be able to step on.
 
I also need a prestige npc that prestiges players at lvl 717k because the ones i used it always were buggy :( and gives a new spell at 1,5,10,15,25,50,100 prestige and it costs 2cc first time and 3*number of prestiges after prestige 1

Btw do you have upgrade item scripts? I cant find any that works :(
like use this item to upgrade to this item 90% to sucessfully upgrade for armor,helms,swords,shields,wands,boots,leggings,spears
like the upgrade gives items +500 ml each time its upgraded
 
Last edited by a moderator:
Its only 1 player per 8 sec right?
every time my character attacks he crashes even with other chars on my server
If you read the 6 lines of code.. xD
It set's a global storage according your your os.time + 8 seconds.
If your storage is greater then the current time, it returns a cancel message to the player.
Since it's using a global storage, this affects all players on the server.
The rest of the code is whatever script your currently using.
I am looking for a script that allows players to step on tile with specific rebirth/prestige so i can use it on hunt area.
like for example: a tile that requires (1) Rebirth to be able to step on.
Doing this in a normal notepad from memory at work on my cellphone.. lol
I can't guarantee if it will work 100% or not.
But if the storage value is not equal to the one chosen, it will not allow the player to access the area.
This is what you requested.. however if you want specific rebirth and above to access an area.. then change ~= to <
Code:
local storage = 45001
local storage_value = 1

function onStepIn(cid, item, position, fromPosition)
    if not isPlayer(cid) then
        return false
    end
    if getPlayerStorageValue(cid, storage) ~= storage_value then
        doTeleportThing(cid, fromPosition)
    end
    return true
end
I also need a prestige npc that prestiges players at lvl 717k because the ones i used it always were buggy :( and gives a new spell at 1,5,10,15,25,50,100 prestige and it costs 2cc first time and 3*number of prestiges after prestige 1
There's many prestige npc's on the forum. You'll have to search for one and fix the error's / problems you have with them.
Or simply code each prestige manually instead of using loops and tables if your comfortable enough to use them.
Btw do you have upgrade item scripts? I cant find any that works :(
like use this item to upgrade to this item 90% to sucessfully upgrade for armor,helms,swords,shields,wands,boots,leggings,spears
like the upgrade gives items +500 ml each time its upgraded
Magic level without a source and/or client update can only go to 156 maximum.
Giving 500 magic level is impossible with a vanilla client because of this limitation.

Beyond that, stackable items such as spears/arrows can be modified, but whenever they are merged with another of the same type, the modification will either be undone, crash the client, or crash the server, depending on how stable each of them are.
 
Thanks for your effort, but would that work like a tile require 10 reb, then the other one 20 reb and so on, would that work?
 
Thanks for your effort, but would that work like a tile require 10 reb, then the other one 20 reb and so on, would that work?
It's currently exactly as you requested.
If they have 1 reb they can pass. If they have 0 or 2+ reb they cannot pass.
If you change ~= to < then....
If they have 1+ reb they can pass.

~= does not equal
< less then

So if your reading the script..

Code:
if getPlayerStorageValue(cid, storage) ~= storage_value then
    doTeleportThing(cid, fromPosition)
end

if the player's storage does not equal storage_value then
teleport them to their previous position.​
end
Code:
if getPlayerStorageValue(cid, storage) < storage_value then
    doTeleportThing(cid, fromPosition)
end

if the player's storage is less then storage_value then
teleport them to their previous position.​
end
 
Need script when monster dies script checks all players attacking monster before it dies and does X
 
Need script when monster dies script checks all players attacking monster before it dies and does X
I'll have to look into it, but I'm pretty sure the damage map is already there loaded within the function.
 
Hey could you help me make this system make players go back to lvl 8? this is the lua of a npc and could you also make it require a promotion before prestigeing please?
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}

local reborn = 4500 -- free storage
local spellReborn = {
    [1] = 'Reborn1',
    [2] = 'Reborn2',
    [5] = 'Reborn5',
    [7] = 'Reborn7',
    [10] = 'Reborn10',
    [100] = 'Reborn100',
    [250] = 'Reborn250',
    [500] = 'Reborn500'
}
local level = 500
local maxReborns = 10
local toLevel = 8

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)            npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                    npcHandler:onThink() end

function greetCallback(cid)
    Topic[cid] = nil
    return true
end

function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    elseif Topic[cid] then
        if msgcontains(msg, 'yes') then
            if getCreatureStorage(cid, reborn) < maxReborns then
                doCreatureSetStorage(cid, reborn, math.max(0, getCreatureStorage(cid, reborn)) + 1)
                for k, v in pairs(spellReborn) do
                    if getCreatureStorage(cid, reborn) == k then
                        doPlayerLearnInstantSpell(cid, v)
                        doSendMagicEffect(getThingPosition(cid), CONST_ME_FIREWORK_RED)
                        break
                    end
                end
           
                local guid = getPlayerGUID(cid)
                npcHandler:releaseFocus(cid)
                doRemoveCreature(cid)
                db.executeQuery("UPDATE `players` SET level = " .. level .. " WHERE id = " .. guid .. ";")
            else
                npcHandler:say('You reached maximum amount of prestiges.', cid)
            end
        else
            npcHandler:say('Maybe next time.', cid)
        end
        Topic[cid] = nil
    else
        if msgcontains(msg, 'prestige') then
            if getPlayerLevel(cid) >= level then
                npcHandler:say('Are you sure that you want to make a prestige?',cid)
                Topic[cid] = 1
            else
                npcHandler:say('You don\'t have enough level. ['..level..']',cid)
                Topic[cid] = nil
            end
        end
    end
    return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Hey could you help me make this system make players go back to lvl 8? this is the lua of a npc and could you also make it require a promotion before prestigeing please?
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}

local reborn = 4500 -- free storage
local spellReborn = {
    [1] = 'Reborn1',
    [2] = 'Reborn2',
    [5] = 'Reborn5',
    [7] = 'Reborn7',
    [10] = 'Reborn10',
    [100] = 'Reborn100',
    [250] = 'Reborn250',
    [500] = 'Reborn500'
}
local level = 500
local maxReborns = 10
local toLevel = 8

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)            npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                    npcHandler:onThink() end

function greetCallback(cid)
    Topic[cid] = nil
    return true
end

function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    elseif Topic[cid] then
        if msgcontains(msg, 'yes') then
            if getCreatureStorage(cid, reborn) < maxReborns then
                doCreatureSetStorage(cid, reborn, math.max(0, getCreatureStorage(cid, reborn)) + 1)
                for k, v in pairs(spellReborn) do
                    if getCreatureStorage(cid, reborn) == k then
                        doPlayerLearnInstantSpell(cid, v)
                        doSendMagicEffect(getThingPosition(cid), CONST_ME_FIREWORK_RED)
                        break
                    end
                end
          
                local guid = getPlayerGUID(cid)
                npcHandler:releaseFocus(cid)
                doRemoveCreature(cid)
                db.executeQuery("UPDATE `players` SET level = " .. level .. " WHERE id = " .. guid .. ";")
            else
                npcHandler:say('You reached maximum amount of prestiges.', cid)
            end
        else
            npcHandler:say('Maybe next time.', cid)
        end
        Topic[cid] = nil
    else
        if msgcontains(msg, 'prestige') then
            if getPlayerLevel(cid) >= level then
                npcHandler:say('Are you sure that you want to make a prestige?',cid)
                Topic[cid] = 1
            else
                npcHandler:say('You don\'t have enough level. ['..level..']',cid)
                Topic[cid] = nil
            end
        end
    end
    return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
https://otland.net/threads/prestige-npc-help.242019/#post-2343443
 
How do I make this prestige command work? I added the scripts in the middle
Code:
local storage = 4500
local seconds = 8
function onSay(cid,words,param)
    time = os.time()
    if getGlobalStorageValue(storage) + seconds > time then
       doPlayerSendCancel(cid, "Please wait a few seconds.")
       return true
    end

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}

local reborn = 4500 -- free storage
local spellReborn = {
    [1] = 'Reborn1',
    [2] = 'Reborn2',
    [5] = 'Reborn5',
    [7] = 'Reborn7',
    [10] = 'Reborn10',
    [100] = 'Reborn100',
    [250] = 'Reborn250',
    [500] = 'Reborn500'
}
local level = 500
local maxReborns = 10
local toLevel = 8

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)            npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                    npcHandler:onThink() end

function greetCallback(cid)
    Topic[cid] = nil
    return true
end

function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    elseif Topic[cid] then
        if msgcontains(msg, 'yes') then
            if getCreatureStorage(cid, reborn) < maxReborns then
                doCreatureSetStorage(cid, reborn, math.max(0, getCreatureStorage(cid, reborn)) + 1)
                for k, v in pairs(spellReborn) do
                    if getCreatureStorage(cid, reborn) == k then
                        doPlayerLearnInstantSpell(cid, v)
                        doSendMagicEffect(getThingPosition(cid), CONST_ME_FIREWORK_RED)
                        break
                    end
                end
           
                player_guid = getPlayerGUID(cid)
                doRemoveCreature(cid)
                db.executeQuery("UPDATE `players` SET `level` = 8 WHERE `id` = " ..player_guid.. ";")
                npcHandler:releaseFocus(cid)
            else
                npcHandler:say('You reached maximum amount of prestiges.', cid)
            end
        else
            npcHandler:say('Maybe next time.', cid)
        end
        Topic[cid] = nil
    else
        if msgcontains(msg, 'prestige') then
            if getPlayerLevel(cid) >= level then
                npcHandler:say('Are you sure that you want to make a prestige?',cid)
                Topic[cid] = 1
            else
                npcHandler:say('You don\'t have enough level. ['..level..']',cid)
                Topic[cid] = nil
            end
        end
    end
    return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

setGlobalStorageValue(storage, os.time())
    return true
end

Also, How do I make this prestige command require 50cc every time to prestige?
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}

local reborn = 4500 -- free storage
local spellReborn = {
    [1] = 'Reborn1',
    [2] = 'Reborn2',
    [5] = 'Reborn5',
    [7] = 'Reborn7',
    [10] = 'Reborn10',
    [100] = 'Reborn100',
    [250] = 'Reborn250',
    [500] = 'Reborn500'
}
local level = 500
local maxReborns = 10
local toLevel = 8

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)            npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                    npcHandler:onThink() end

function greetCallback(cid)
    Topic[cid] = nil
    return true
end

function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    elseif Topic[cid] then
        if msgcontains(msg, 'yes') then
            if getCreatureStorage(cid, reborn) < maxReborns then
                doCreatureSetStorage(cid, reborn, math.max(0, getCreatureStorage(cid, reborn)) + 1)
                for k, v in pairs(spellReborn) do
                    if getCreatureStorage(cid, reborn) == k then
                        doPlayerLearnInstantSpell(cid, v)
                        doSendMagicEffect(getThingPosition(cid), CONST_ME_FIREWORK_RED)
                        break
                    end
                end
           
                player_guid = getPlayerGUID(cid)
                doRemoveCreature(cid)
                db.executeQuery("UPDATE `players` SET `level` = 8 WHERE `id` = " ..player_guid.. ";")
                npcHandler:releaseFocus(cid)
            else
                npcHandler:say('You reached maximum amount of prestiges.', cid)
            end
        else
            npcHandler:say('Maybe next time.', cid)
        end
        Topic[cid] = nil
    else
        if msgcontains(msg, 'prestige') then
            if getPlayerLevel(cid) >= level then
                npcHandler:say('Are you sure that you want to make a prestige?',cid)
                Topic[cid] = 1
            else
                npcHandler:say('You don\'t have enough level. ['..level..']',cid)
                Topic[cid] = nil
            end
        end
    end
    return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}

local reborn = 4500 -- free storage
local spellReborn = {
    [1] = 'Reborn1',
    [2] = 'Reborn2',
    [5] = 'Reborn5',
    [7] = 'Reborn7',
    [10] = 'Reborn10',
    [100] = 'Reborn100',
    [250] = 'Reborn250',
    [500] = 'Reborn500'
}
local level = 500
local maxReborns = 10
local toLevel = 8
local cost = 50000

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)            npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                    npcHandler:onThink() end

function greetCallback(cid)
    Topic[cid] = nil
    return true
end

function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    elseif Topic[cid] then
        if msgcontains(msg, 'yes') then
            if getCreatureStorage(cid, reborn) < maxReborns then
                if doPlayerRemoveMoney(cid, cost) then
                doCreatureSetStorage(cid, reborn, math.max(0, getCreatureStorage(cid, reborn)) + 1)
                for k, v in pairs(spellReborn) do
                    if getCreatureStorage(cid, reborn) == k then
                        doPlayerLearnInstantSpell(cid, v)
                        doSendMagicEffect(getThingPosition(cid), CONST_ME_FIREWORK_RED)
                        break
                    end
                end
          
                player_guid = getPlayerGUID(cid)
                doRemoveCreature(cid)
                db.executeQuery("UPDATE `players` SET `level` = 8 WHERE `id` = " ..player_guid.. ";")
                npcHandler:releaseFocus(cid)
                else
                npcHandler:say('You must pay 50k for a rebirth.', cid)
                end
            else
                npcHandler:say('You reached maximum amount of prestiges.', cid)
            end
        else
            npcHandler:say('Maybe next time.', cid)
        end
        Topic[cid] = nil
    else
        if msgcontains(msg, 'prestige') then
            if getPlayerLevel(cid) >= level then
                npcHandler:say('Are you sure that you want to make a prestige?',cid)
                Topic[cid] = 1
            else
                npcHandler:say('You don\'t have enough level. ['..level..']',cid)
                Topic[cid] = nil
            end
        end
    end
    return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

This charges 50cc
 
How do I make this prestige command work? I added the scripts in the middle
Code:
local storage = 4500
local seconds = 8
function onSay(cid,words,param)
    time = os.time()
    if getGlobalStorageValue(storage) + seconds > time then
       doPlayerSendCancel(cid, "Please wait a few seconds.")
       return true
    end

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}

local reborn = 4500 -- free storage
local spellReborn = {
    [1] = 'Reborn1',
    [2] = 'Reborn2',
    [5] = 'Reborn5',
    [7] = 'Reborn7',
    [10] = 'Reborn10',
    [100] = 'Reborn100',
    [250] = 'Reborn250',
    [500] = 'Reborn500'
}
local level = 500
local maxReborns = 10
local toLevel = 8

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)            npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                    npcHandler:onThink() end

function greetCallback(cid)
    Topic[cid] = nil
    return true
end

function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    elseif Topic[cid] then
        if msgcontains(msg, 'yes') then
            if getCreatureStorage(cid, reborn) < maxReborns then
                doCreatureSetStorage(cid, reborn, math.max(0, getCreatureStorage(cid, reborn)) + 1)
                for k, v in pairs(spellReborn) do
                    if getCreatureStorage(cid, reborn) == k then
                        doPlayerLearnInstantSpell(cid, v)
                        doSendMagicEffect(getThingPosition(cid), CONST_ME_FIREWORK_RED)
                        break
                    end
                end
          
                player_guid = getPlayerGUID(cid)
                doRemoveCreature(cid)
                db.executeQuery("UPDATE `players` SET `level` = 8 WHERE `id` = " ..player_guid.. ";")
                npcHandler:releaseFocus(cid)
            else
                npcHandler:say('You reached maximum amount of prestiges.', cid)
            end
        else
            npcHandler:say('Maybe next time.', cid)
        end
        Topic[cid] = nil
    else
        if msgcontains(msg, 'prestige') then
            if getPlayerLevel(cid) >= level then
                npcHandler:say('Are you sure that you want to make a prestige?',cid)
                Topic[cid] = 1
            else
                npcHandler:say('You don\'t have enough level. ['..level..']',cid)
                Topic[cid] = nil
            end
        end
    end
    return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

setGlobalStorageValue(storage, os.time())
    return true
end

Also, How do I make this prestige command require 50cc every time to prestige?
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}

local reborn = 4500 -- free storage
local spellReborn = {
    [1] = 'Reborn1',
    [2] = 'Reborn2',
    [5] = 'Reborn5',
    [7] = 'Reborn7',
    [10] = 'Reborn10',
    [100] = 'Reborn100',
    [250] = 'Reborn250',
    [500] = 'Reborn500'
}
local level = 500
local maxReborns = 10
local toLevel = 8

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)            npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                    npcHandler:onThink() end

function greetCallback(cid)
    Topic[cid] = nil
    return true
end

function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    elseif Topic[cid] then
        if msgcontains(msg, 'yes') then
            if getCreatureStorage(cid, reborn) < maxReborns then
                doCreatureSetStorage(cid, reborn, math.max(0, getCreatureStorage(cid, reborn)) + 1)
                for k, v in pairs(spellReborn) do
                    if getCreatureStorage(cid, reborn) == k then
                        doPlayerLearnInstantSpell(cid, v)
                        doSendMagicEffect(getThingPosition(cid), CONST_ME_FIREWORK_RED)
                        break
                    end
                end
          
                player_guid = getPlayerGUID(cid)
                doRemoveCreature(cid)
                db.executeQuery("UPDATE `players` SET `level` = 8 WHERE `id` = " ..player_guid.. ";")
                npcHandler:releaseFocus(cid)
            else
                npcHandler:say('You reached maximum amount of prestiges.', cid)
            end
        else
            npcHandler:say('Maybe next time.', cid)
        end
        Topic[cid] = nil
    else
        if msgcontains(msg, 'prestige') then
            if getPlayerLevel(cid) >= level then
                npcHandler:say('Are you sure that you want to make a prestige?',cid)
                Topic[cid] = 1
            else
                npcHandler:say('You don\'t have enough level. ['..level..']',cid)
                Topic[cid] = nil
            end
        end
    end
    return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Your code screams 'npc'. I'm not sure what you mean by command.
And Itutorial's post above shows how to check for money.
 
Status
Not open for further replies.
Back
Top