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

[release] onAdvance

Hi,
i use niller's onAdvance system on 0.2 TFS Server,But i want when player got 100 Level with broadcaster "Congratulations,(Playername) has been 100 Level...someone msg?

Thanks.
 
PHP:
--onAdvance system by 4220niller
--Script by Rizz

function onAdvance(cid, oldlevel, newlevel)


	if newlevel == 100 then
		playerName = getCreatureName(cid)
		broadcastMessage(playerName .. ' reached level 100!', MESSAGE_STATUS_WARNING)

	end
end
 
not have error but ,dont working. player reached 100 level but not broadcast msg
 
Hello, Could thi sbe updated to the latest tfs please?
The parts being put into the onThink functions and what
not are outdated.
 
Then you need to make a new directory in data/creaturescritps/scripts/ and name it advances.

then in data/creaturescripts/scripts/advances/ add the following files: axe.lua, club.lua, distance.lua, fishing.lua, fist.lua, level.lua, maglevel.lua, shield.lua, sword.lua.

how to do this?
 
Code:
<event type="login" name="PlayerLogin" script="login.lua"/>
	<event type="logout" name="PlayerLogout" script="logout.lua"/>
	<event type="death" name="PlayerDeath" script="playerdeath.lua"/>
	<event type="think" name="PlayerThink" script="think.lua"/>


If you have another PlayerLogin/PlayerThink event then add the above things in that/those file(s)

why the fuck Logout?<_<
 
working for tfs 0.2.2? can't find OnThink >.<
 
Works with 0.2.5 mystic spirit?

Can somebody make a script where it does a random effect from all the effects list? (Like it has a certain chance to do an effect)
 
I also don't understand the Think.lua, do I make a new .lua file for think.lua and put those lines in it?
 
@up if you ain't got think.lua on creaturescripts then create it:
Lua:
dofile("./data/creaturescripts/scripts/onAdvance.lua")

function onThink(cid, interval)
    onAdvanceController(cid)
    return TRUE
end

then add to creaturescripts.xml:
Lua:
<event type="think" name="PlayerThink" script="think.lua"/>

then add to creaturescripts/scripts/login.lua
Lua:
    registerCreatureEvent(cid, "PlayerThink")
 
Code:
	OLD_LEVELS[cid] = getPlayerLevel(cid)
	OLD_MAGLEVELS[cid] = getPlayerMagLevel(cid)
	OLD_FIST[cid] = getPlayerSkill(cid,SKILL_FIST)
	OLD_CLUB[cid] = getPlayerSkill(cid,SKILL_CLUB)
	OLD_AXE[cid] = getPlayerSkill(cid,SKILL_AXE)
	OLD_SWORD[cid] = getPlayerSkill(cid,SKILL_SWORD)
	OLD_DISTANCE[cid] = getPlayerSkill(cid,SKILL_DISTANCE)
	OLD_SHIELD[cid] = getPlayerSkill(cid,SKILL_SHIELD)
	OLD_FISHING[cid] = getPlayerSkill(cid,SKILL_FISHING

I get a error when i put this n login.lua, shouldnt i put a function into it ?, could someone show how to do it ?
 
[13/10/2009 10:00:52] Error: [CreatureEvent::configureEvent] No valid type for creature event.advance
[13/10/2009 10:00:52] Warning: [BaseEvents::loadFromXml] Can not configure event


That Warning In Console Using Tfs 0.2.2
 
Back
Top