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

Simple request but i cant do

Luciano

Member
Joined
Feb 18, 2010
Messages
998
Reaction score
24
Its a lever script.
I use lever id 9825 with uniqueid = 5794 and it remove like hm... 1kk and add a iten with id 8299.
BUT just one iten of that.
I dont have any lever script ;/

ty,
Legendary Druid
 
Code:
local money = 1000000
local item = 8299

function onUse(cid, item, fromPosition, itemEx, toPosition)
  if item.itemid == 9825 then
    doPlayerRemoveMoney(cid, money)
    doPlayerAddItem(cid, item)
  end
  return true
end

I'm not sure if this works but try it... btw u must set a lever in the map editor with uid 5794 and in actions.xml..
 
Last edited:
Code:
local money = 1000000
local item, count = 8299, 1

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if doPlayerRemoveMoney(cid, money) then
		doPlayerAddItem(cid, item, count)
	else
		doPlayerSendCancel(cid, "You don't have enough money.")
	end
return true
end
 
JDB - [01/04/2010 13:23:38] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/megasd test.lua)
[01/04/2010 13:23:38] data/actions/scripts/megasd test.lua:1: unexpected symbol near '{'
 
Code:
local money = 1000000
local item, count = 8299, 1

function onUse(cid, item, fromPosition, itemEx, toPosition)
  if item.uid == 5794 then
    doPlayerRemoveMoney(cid, money)
    doPlayerAddItem(cid, item, count)
  end
  return true
end

actions.xml

Code:
	<action itemid="ID" event="script" value="tools/lever.lua"/>
 
[01/04/2010 13:52:11] [Error - LuaScriptInterface::loadFile] data/actions/scripts/megasd test.lua:1: unexpected symbol near '{'
[01/04/2010 13:52:11] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/megasd test.lua)
[01/04/2010 13:52:11] data/actions/scripts/megasd test.lua:1: unexpected symbol near '{'

STILL no work.
But in map editor, i should put 5794 in action id unique id or both?
 
Last edited by a moderator:
Did you even try mine?

actions/scripts/lever.lua
Code:
local money = 1000000
local item, count = 8299, 1

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if doPlayerRemoveMoney(cid, money) then
		doPlayerAddItem(cid, item, count)
	else
		doPlayerSendCancel(cid, "You don't have enough money.")
	end
return true
end

actions/actions.xml
PHP:
<action uniqueid="5794" event="script" value="lever.lua"/>
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cfg = {
		cash = 1000000,
		id = 8299
	}
	if(getPlayerMoney(cid) > cfg.cash) then
		local reward = doCreateItemEx(cfg.id, 1)
		if(doPlayerAddItemEx(cid, reward, true) ~= RETURNVALUE_NOERROR) then
			return false
		else
			doPlayerRemoveMoney(cid, cash)
			doCreatureSay(cid, "" .. getItemNameById(cfg.id) .. "!", TALKTYPE_ORANGE_1)
		end
	else
		doPlayerSendCancel(cid, "You do not have enough money.")
	end
	return true
end
 
lever.lua
LUA:
local config = {
cost = 1000000
item = 8299
},

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.uid == 5794 then
		if doPlayerRemoveMoney(cid, config.cost) == true then
			doPlayerAddItem(cid, config.item, 1)
		else
			doPlayerSendCancel(cid, "You don't have enough money.")
		end
	end
return true
end

in actions.xml
Code:
<action uniqueid="5794" event="script" value="lever.lua"/>
 
Ill try all us. BUT, PLEASE. wait. My hard disck just dead. I will buy a sata cable (i was using IDE) and put one new and do all things. my leptop is near over-heart runing server
 
:peace:

despion0:
[01/04/2010 23:56:18] [Error - LuaScriptInterface::loadFile] data/actions/scripts/troyhelmet.lua:1: unexpected symbol near '{'
[01/04/2010 23:56:18] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/troyhelmet.lua)
[01/04/2010 23:56:18] data/actions/scripts/troyhelmet.lua:1: unexpected symbol near '{'

JDB:
[01/04/2010 23:58:01] [Error - LuaScriptInterface::loadFile] data/actions/scripts/troyhelmet.lua:1: unexpected symbol near '{'
[01/04/2010 23:58:01] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/troyhelmet.lua)
[01/04/2010 23:58:01] data/actions/scripts/troyhelmet.lua:1: unexpected symbol near '{'

Sypher:
[01/04/2010 23:58:47] [Error - LuaScriptInterface::loadFile] data/actions/scripts/troyhelmet.lua:1: unexpected symbol near '{'
[01/04/2010 23:58:47] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/troyhelmet.lua)
[01/04/2010 23:58:47] data/actions/scripts/troyhelmet.lua:1: unexpected symbol near '{'
 
Last edited by a moderator:
Back
Top