• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Money when specific lvl is taken!

Tofflarn

New Member
Joined
Mar 22, 2008
Messages
360
Reaction score
1
Location
Sweden
As the title says, i need a script that give the character money when he reach a specific lvl.. Can someone help me with this? I've seen many ots whit this script today and i need i to.


Thanks in advanced!
 
Code:
local config = {
	level = 50,
	skill = SKILL__LEVEL,
	item = 2160,
	count = 5,
	storage = 1337
}
function onAdvance(cid, skill, oldlevel, newlevel)
	if(skill == config.skill and newlevel >= config.level and getPlayerStorageValue(cid, config.storage) < 1) then
		setPlayerStorageValue(cid, config.storage, 1)
		doPlayerAddItem(cid, config.item, config.count)
	end
	return true
end

Not made by me. I found it by SEARCHING


Rep++? :)
 
And how do i add this? Actions?
save the script as data/creaturescripts/scripts/advance.lua

creaturescripts.xml
Code:
	<event type="advance" name="PlayerAdvance" event="script" value="advance.lua"/>
login.lua
Code:
	registerCreatureEvent(cid, "PlayerAdvance")
 
I have done like this..

Made a file in C:\Users\USERNAME\Desktop\server\data\creaturescripts\scripts\advandes.lua
"Add a S behind it since there where another file that called Advande.

Add text to login..
registerCreatureEvent(cid, "levelmoney")

And to creature.xml
<event type="advance" name="levelmoney" event="script" value="advances.lua"/>

have i done anything wrong?
 
Im sorry but i was writing to fast last post! It is not Advandes.. Still doesn't work.. I post a screen..

felk.jpg
 
Try:
LUA:
local config = {
 level = 50,
 skill = SKILL__LEVEL,
 item = 2160,
 count = 5,
 storage = 55885
}
function onAdvance(cid, skill, oldLevel, newLevel)
 if(skill == config.skill and newLevel >= config.level and getPlayerStorageValue(cid, config.storage) == -1) then  setPlayerStorageValue(cid, config.storage, 1)
  doPlayerAddItem(cid, config.item, config.count)
 end
 return true
end

rep to bilmattan xd.
 
Well, as I can see it will only work for those whom have storageValue = -1.
Probably if the script you used before gave you storageValue = 1, then this one will not react on your character. Check your characters storageValue. Or in-game write with your GOD character /storage playername, storage, -1. Hope you will understand and that you will get the script to work.

Also, try to use name = "PlayerAdvance" and registerCreatureEvent(cid, "PlayerAdvance")
 
Still doesn't work. Before i tested the script i cleaned up my player_storage.. Don't get any storage id :S



registerCreatureEvent(cid, "PlayerAdvance")

should be placed in "C:\Users\USERNAME\Desktop\server\data\creaturescripts\scripts\login.lua? Im right?
 
Last edited:
Menfes? Don't really understand :S


I got one erros in my console when i start the server...

[Warning - MoveEvents::addEvent} Dublicate move event found 2660

But i belive that this error don't have anything to do with this scripts...

btw. Still doesn't work :( I have never had a problem like this with a so easy script.. :S
 
Back
Top