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

Help with Skill Egg Usage 10 times!

Wartio

Any game ideas?
Joined
Apr 2, 2010
Messages
457
Reaction score
29
Location
Sweden
is there any lua scripter that could do this to me :p?

Only Knights can use that(10 times in game)! It gives about 1 Sword, Axe and Club Fighting. 00:52 You see a coloured egg. It weighs 0.30 oz.

Coloured egg id. 6542

can only by used 10 times!
 
colouredegg.lua
Code:
function onUse(cid, item, frompos, item2, topos)
if isKnight(cid) == TRUE then
	if getCreatureStorage(cid, 97568) < 9 then
		local stor = getCreatureStorage(cid, 97568) + 1

		doSendMagicEffect(getThingPos(cid),13)
		doPlayerAddSkill(cid, 1, 1)
		doPlayerAddSkill(cid, 2, 1)
		doPlayerAddSkill(cid, 3, 1)
		doRemoveItem(item.uid,1)
		doCreatureSetStorage(cid, 97568, stor)

	else

	doSendMagicEffect(getThingPos(cid),2)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You used egg 10 times already.")

	end

	
else
	doSendMagicEffect(getThingPos(cid),2)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are not knight.")


end




end
actions.xml
Code:
<action itemid="6542" event="script" value="colouredegg.lua"/>

Why do you have "* Lua * Scripter * " under your nickname if you can't do basic scripts? :|

PS. Check this script, i'm not 100% sure about it
 
Lua:
local storage = 1234
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isKnight(cid) then
		if getCreatureStorage(cid, storage) < 9 then
			doSendMagicEffect(getCreaturePosition(cid), 13)
			for i = 1, 3 do
				doPlayerAddSkill(cid, i, 1)
			end
			doRemoveItem(item.uid, 1)
			setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
		else
			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You used egg 10 times already.")
		end
	else
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are not knight.")
	end
	return true
end
 
I tried both of those scripts by , Streamside, Syaroan but those scripts aint adding level, its just giving me 90 % of club,axe,sword fight then it does not give anymore, but if you guys could login to my server and help me faster ingame, that would be better, will pm you the ip of server

- - - Updated - - -

Searching for Scripters, PM Me Fast!
 
can some one help me and make this add sword,axe,club ??

and make it can only by used 10 times max by knights

local config = {maxlvl = 80, trys = 1000, skilltype = 3}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerSkill(cid,3) <= config.maxlvl then
doPlayerAddSkillTry(cid, 3, math.ceil((getPlayerRequiredSkillTries(cid, 3, getPlayerSkillLevel(cid, 3) + 1) - getPlayerSkillTries(cid, 3)) / getConfigInfo('rateSkill')))
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid,TALKTYPE_BROADCAST, "CONGRATULATIONS! You've gained 1 axe fighting skill from the skill up badge!")
else
doPlayerSendCancel(cid, "Your skill level is too high.")
end
return TRUE
end
 
Lua:
local storage = 1234
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isKnight(cid) then
		if getCreatureStorage(cid, storage) < 9 then
			doSendMagicEffect(getCreaturePosition(cid), 13)
			for i = 1, 3 do
				doPlayerAddSkillTry(cid, i, getPlayerRequiredSkillTries(cid, i, getPlayerSkillLevel(cid, i) + 1) - getPlayerSkillTries(cid, i), false)
			end
			doRemoveItem(item.uid, 1)
			setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
		else
			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You used egg 10 times already.")
		end
	else
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are not knight.")
	end
	return true
end

It's the script StreamSide made, I only changed the addskill part.

Btw, if you don't know which number is which skill:
Lua:
SKILL_FIST = 0
SKILL_CLUB = 1
SKILL_SWORD = 2
SKILL_AXE = 3
SKILL_DISTANCE = 4
SKILL_SHIELD = 5
SKILL_FISHING = 6
SKILL__MAGLEVEL = 7
SKILL__LEVEL = 8
 
Last edited:
Lua:
local storage = 1234
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if isKnight(cid) then
		if getCreatureStorage(cid, storage) < 9 then
			doSendMagicEffect(getCreaturePosition(cid), 13)
			for i = 1, 3 do
				doPlayerAddSkillTry(cid, i, getPlayerRequiredSkillTries(cid, i, getPlayerSkillLevel(cid, i) + 1) - getPlayerSkillTries(cid, i), false)
			end
			doRemoveItem(item.uid, 1)
			setPlayerStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
		else
			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You used egg 10 times already.")
		end
	else
		doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are not knight.")
	end
	return true
end

It's the script StreamSide made, I only changed the addskill part.

Btw, if you don't know which number is which skill:
Lua:
SKILL_FIST = 0
SKILL_CLUB = 1
SKILL_SWORD = 2
SKILL_AXE = 3
SKILL_DISTANCE = 4
SKILL_SHIELD = 5
SKILL_FISHING = 6
SKILL__MAGLEVEL = 7
SKILL__LEVEL = 8

ye sorry, I dont have access to the last svn and i dont know all the functions aswell, i just use the addskill function from the first answer :)
thanks Limos.
 
Back
Top