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

CreatureEvent Level 300 > start again + get Level Storage.

=.= it isn't working in my tfs 0.3.5pl1!! I don't see the message when I look on myself
 
@up
You'll don't see it in player description...
-.- i know this is stupid but i haven't used the onLook function before so how does this works?
 
Doesn't seem to work on 0.2, would be wonderful if you made it for 0.2 aswell.

Anyways, great scripting there mate :thumbup:
 
[27/06/2002 00:56:48] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/playerAdvance.lua)
[27/06/2002 00:56:48] data/creaturescripts/scripts/playerAdvance.lua:6: unexpected symbol near '{'


that error D:!

You can making in talkation please ? :D!
 
are you too stupid for otserv's???

you can't use that as an talkaction, learn something about otserv's and after that you will understand this error and solve it yourself ;)
 
hello at all, i've a problem, when a character reaches Lvl 300, nothing happens, also no error in console(I am using latest TFS with PL1, for Client 8.5+)

My Code's:
LOGIN.LUA
PHP:
local config = {
	loginMessage = getConfigValue('loginMessage')
}

function onLogin(cid)
	setPlayerStorageValue(cid, 9000, 1) 
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")
	registerCreatureEvent(cid, "Idle")
	registerCreatureEvent(cid, "SkullCheck")
	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "BountyHunter")
	registerCreatureEvent(cid, "WOW_LIKE_QUESTS")
	registerCreatureEvent(cid, "ArenaKill")
	registerCreatureEvent(cid, "monsterPortals")
	registerCreatureEvent(cid, "DeathBroadcast") 
	registerCreatureEvent(cid, "PrepareDeath") 
    registerCreatureEvent(cid, "advance") 
    registerCreatureEvent(cid, "core")
    registerCreatureEvent(cid, "Look") 
    -- if he did not make full arena 1 he must start from zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 2 he must start from zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 3 he must start from zero
    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0) -- did not arena level
    end
    setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
    setPlayerStorageValue(cid, 42352, 0) -- is not in arena  
    return true
end

CREATURESCRIPTS.XML
PHP:
           registerCreatureEvent(cid, "Advance")
                registerCreatureEvent(cid, "Look")

PlayerLook.lua
PHP:
function onLook(cid, thing, position, lookDistance)
        if(isPlayer(thing.uid) == false) then
            return true
        end
local storage = 9000
        if(getPlayerStorageValue(thing.uid, storage)  < 1) then
                    doPlayerSendTextMessage(cid, 25, ""..getCreatureName(thing.uid).." doesn\'t have any Core\'s.")
            return true
                end
                if(getPlayerStorageValue(thing.uid, storage) >= 1) then
                        doPlayerSendTextMessage(cid, 25, ""..getCreatureName(thing.uid).." got a Core "..getPlayerStorageValue(thing.uid, storage)..".")
                        return true
                end
        return true
end

PlayerAdvance.lua
PHP:
function onAdvance(cid, skill, oldlevel, newlevel)
local config = {
        level = 300,
        storage = 9000,
        startLevel = 8
}
local tPos = {x =160, y =51, z =7}
        if(skill == SKILL__LEVEL and newlevel >= config.level) then
                setPlayerStorageValue(cid, getPlayerStorageValue(cid, config.storage) + 1)
                doTeleportThing(cid, tPos)
                setPlayerMaxMana(cid, 35)
                setCreatureMaxHealth(cid, 185)          
                doRemoveCreature(cid)
                db.executeQuery("UPDATE ´players´ SET ´level´ = '"..config.startLevel.."', ´experience´ = '"..getExperienceForLevel(config.startLevel).."' WHERE ´name´ = '"..getPlayerName(cid).."';")
                end
        return true
end
 
fixed, now i get this error:
PHP:
[10/11/2009 21:59:50] Lua Script Error: [CreatureScript Interface] 
[10/11/2009 21:59:50] data/creaturescripts/scripts/advance.lua:onAdvance

[10/11/2009 21:59:50] data/creaturescripts/scripts/advance.lua:59: attempt to call global 'setPlayerMaxMana' (a nil value)
[10/11/2009 21:59:50] stack traceback:
[10/11/2009 21:59:50] 	data/creaturescripts/scripts/advance.lua:59: in function <data/creaturescripts/scripts/advance.lua:49>
 
Dont work :S
[10/11/2009 21:59:50] Lua Script Error: [CreatureScript Interface]
[10/11/2009 21:59:50] data/creaturescripts/scripts/advance.lua:eek:nAdvance

[10/11/2009 21:59:50] data/creaturescripts/scripts/advance.lua:59: attempt to call global 'setPlayerMaxMana' (a nil value)
[10/11/2009 21:59:50] stack traceback:
[10/11/2009 21:59:50] data/creaturescripts/scripts/advance.lua:59: in function <data/creaturescripts/scripts/advance.lua:49>
 
moar return :D:D
Code:
		--[[
			Script coded by zonet.
			using storage = 9000   
		]]--
local storage = 9000
function onLook(cid, thing, position, lookDistance)
	return (isPlayer(thing.uid) == false) and true or (getPlayerStorageValue(thing.uid, storage) < 1) and doPlayerSendTextMessage(cid, 20, getCreatureName(thing.uid).." doesn't have any storage.") or (getPlayerStorageValue(thing.uid, storage) >= 1) and doPlayerSendTextMessage(cid, 20, getCreatureName(thing.uid).." got a storage "..getPlayerStorageValue(thing.uid, storage))
end
 
Last edited:
Back
Top