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

Eggs

thecycles

Member
Joined
Apr 7, 2010
Messages
620
Reaction score
5
Do somebody have THE Eggs Script,
I want the egg to give u 5000 exp for like 5 cc.
Can somebody give the script? :D
 
em.. Please wait 24h before bumping youre thread. But low post = dont know alot ;)...

heres the code.
Lua:
local cost = 50000,
local experience = 5000,
local player = {}
function onUse(cid, item, frompos, item2, topos)
		if getPlayerMoney(cid, .. cost ..) then
				doPlayerRemoveMoney(cid, .. cost ..)   AND doPlayerAddExperience(cid, .. experience ..)
					doPlayerSendMessage(cid, You got ".. experience .." and you lost ".. cost ..")
						else
								doPlayerSendCancel(cid, Sorry you dont have the money to make this.)
									  return player 
							end
									end
 
em.. Please wait 24h before bumping youre thread. But low post = dont know alot ;)...

Your code looks very bad and You bad use tabs ;)

It will be better.

Lua:
local cost = 50000,
local experience = 5000,
function onUse(cid, item, frompos, item2, topos)
	if doPlayerRemoveMoney(cid, cost) == true then
		doPlayerAddExperience(cid, experience)
		doPlayerSendMessage(cid, "You got " .. experience .. " and you lost " .. cost .. ".")
	else
		doPlayerSendCancel(cid, Sorry you dont have the money to make this.)	
	end
return true	
end
 
im not the best on stabs but why did u use return true return player is alot easier for us to read and see in the brain.. same for the serv.

+ I made it in webacton not note ect.
 
Code:
local experience = 5000
local cost = 50000

function onUse (cid, item, fromPosition, itemEx, toPosition)

if doPlayerRemoveMoney (cid, cost) then
doPlayerAddExperience (cid, experience)
doPlayerRemoveMoney (cid, cost)
doPlayerSendTextMessage (cid, 25, "You received "..experience.." and lost "..cost.." gold!")
else
doPlayerSendCancel (cid, "You need to have "..cost.." gold!")
end
return true
end

Put this in actions..
 
Lua:
if doPlayerRemoveMoney (cid, cost) then
doPlayerAddExperience (cid, experience)
doPlayerRemoveMoney (cid, cost)
wtf?

doPlayerRemoveMoney(cid, .. cost ..)
dont space on money - (cid) ..>Money(cid,)

+ dont make "locals" like doPlayerRemoveMoney(cid, cost)

Lua:
   local .player = {}
doPlayerRemoveMoney(cid, .. cost ..)
return .player
end
 
Code:
local experience = 5000
local cost = 50000

function onUse (cid, item, fromPosition, itemEx, toPosition)

[B][COLOR="SeaGreen"]if doPlayerRemoveMoney (cid, cost) then[/COLOR][/B]
doPlayerAddExperience (cid, experience)
[COLOR="SeaGreen"][B]doPlayerRemoveMoney (cid, cost)[/B][/COLOR]
doPlayerSendTextMessage (cid, 25, "You received "..experience.." and lost "..cost.." gold!")
else
doPlayerSendCancel (cid, "You need to have "..cost.." gold!")
end
return true
end

Put this in actions..

doPlayerRemoveMoney 2x ?


My script is good i dont know why you gave other code.

Create hydra_egg.lua and paste my code and next to actions.xml add:

HTML:
<action itemid="4850" event="script" value="hydra_egg.lua"/>
 
Last edited:
Lua:
local cost = 50000,
local experience = 5000,
local player:end = {}
function onUse(cid, item, frompos, item2, topos)
   if getPlayerMoney(cid, .. cost ..) then
      doPlayerRemoveMoney(cid, .. cost ..)   AND doPlayerAddExperience(cid, .. experience ..)
          doPlayerSendMessage(cid, You got ".. experience .." and you lost ".. cost ..")
            else
               doPlayerSendCancel(cid, Sorry you dont have the money to make this.)
                   return player:end 
                       end

tested and workes on 0.2 & 0.4 (old ver.)
 
Lua:
local cost = 50000,
local experience = 5000,
local player:end = {}
function onUse(cid, item, frompos, item2, topos)
   if getPlayerMoney(cid, .. cost ..) then
      doPlayerRemoveMoney(cid, .. cost ..)   AND doPlayerAddExperience(cid, .. experience ..)
          doPlayerSendMessage(cid, You got ".. experience .." and you lost ".. cost ..")
            else
               doPlayerSendCancel(cid, Sorry you dont have the money to make this.)
                   return player:end 
                       end

tested and workes on 0.2 & 0.4 (old ver.)

Worked? How? You between "" have constant not text and in my opinion player dont get the message.

I tested your script and when server started was error:

Code:
[06/06/2010 13:56:09] [Error - LuaScriptInterface::loadFile] data/actions/scripts/hydra_egg.lua:2: unexpected symbol near 'local'
[06/06/2010 13:56:09] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/hydra_egg.lua)
[06/06/2010 13:56:09] data/actions/scripts/hydra_egg.lua:2: unexpected symbol near 'local'

beacuse u script is very very bad.

Check this:
how to use
and how to use:
script
 
Last edited:
Worked? How? You between "" have constant not text and in my opinion player dont get the message.

I tested your script and when server started was error:

Code:
[06/06/2010 13:56:09] [Error - LuaScriptInterface::loadFile] data/actions/scripts/hydra_egg.lua:2: unexpected symbol near 'local'
[06/06/2010 13:56:09] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/hydra_egg.lua)
[06/06/2010 13:56:09] data/actions/scripts/hydra_egg.lua:2: unexpected symbol near 'local'

beacuse u script is very very bad.

Check this:
how to use
and how to use:
script


learn lua plox

Lua:
doPlayerRemoveMoney (cid, cost)
bad

Lua:
doPlayerRemoveMoney(cid, .. cost ..)
good
 
Mhm Mhm but u script dont work. Maybe im not pro with lua scripts but my scripts working. And man its good:

Code:
doPlayerRemoveMoney (cid, cost)
 
@Wibben:
"Learn LUA" you fuckin' dumbass.

@OP:
Code:
local cfg = {
	cost = 50000,
	experience = 50000
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerMoney(cid) >= cfg.cost) then
		doPlayerRemoveMoney(cid, cfg.cost)
		doPlayerAddExperience(cid, cfg.experience)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought ".. cfg.experience .." for ".. cfg.cost .." gold coins.")
		doSendAnimatedText(fromPosition, "+".. cfg.experience, TEXTCOLOR_WHITE)
		doRemoveItem(item.uid)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have enough money.")
	end
	return true
end
 
Last edited:
wups, I copied a script from some1 and I forgot to delete the second "remove money" line xd

Code:
local cost = 50000
local exp = 5000

function onUse (cid, item, fromPosition, itemEx, toPosition)

if doPlayerRemoveMoney (cid, cost) then
doPlayerAddExperience (cid, exp)
doPlayerSendTextMessage (cid, 25, "You received "..exp.." experience and lost "..cost.." gold!")
doRemoveItem (item.uid)
else
doPlayerSendCancel (cid, "You need "..cost.." to use this egg.")
end
return true
end
 
Back
Top