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

script refil soft and firewalker

kermmm

New Member
Joined
Feb 1, 2009
Messages
68
Reaction score
4
Hello, i have problem in script.. What is bad?!

Error :

[Error - LuaScriptInterface::loadFile] data/actions/scripts/firewalkerrefil.lua:17: '=' expected near '<eof>'
[Warning - Event::loadScript] Cannot load script (data/actions/scripts/firewalkerrefil.lua)
data/actions/scripts/firewalkerrefil.lua:17: '=' expected near '<eof>'

[Error - Action Interface]
data/actions/scripts/softrefil.lua
Description:
data/actions/scripts/softrefil.lua:5: attempt to index global 'item' (a nil value)
[Warning - Event::loadScript] Cannot load script (data/actions/scripts/softrefil.lua)
data/actions/scripts/firewalkerrefil.lua:17: '=' expected near '<eof>'
My script :

Firewallker boots

#by Aulus
local stare = 6530
local id = 2640
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 1945 then
if(doPlayerRemoveItem(cid, stare, 1) == TRUE) then
doPlayerAddItem(cid, id, 1)
doTransformItem(item.uid, item.itemid+1)
elseif item.itemid == 1946 then
if(doPlayerRemoveItem(cid, stare, 1) == TRUE) then
doPlayerAddItem(cid, id, 1)
doTransformItem(item.uid, item.itemid+1)
if(doPlayerRemoveItem(cid, 2160, 1) == TRUE) then
end
end
return true
end end

Soft boots :

#by Aulus
local stare = 6530
local id = 2640
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 1945 then
if(doPlayerRemoveItem(cid, stare, 1) == TRUE) then
doPlayerAddItem(cid, id, 1)
doTransformItem(item.uid, item.itemid+1)
elseif item.itemid == 1946 then
if(doPlayerRemoveItem(cid, stare, 1) == TRUE) then
doPlayerAddItem(cid, id, 1)
doTransformItem(item.uid, item.itemid+1)
if(doPlayerRemoveItem(cid, 2160, 1) == TRUE) then
end
end
return true
end end
 
Code:
local t = {
	[UID of lever for soft boots] = {old = 6530, new = 6132, money = 10000},
	[UID of lever for fw boots] = {old = 9934, new = 9933, money = 10000},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local i = t[item.uid]
	if getPlayerMoney(cid) < i.money then
		return doPlayerSendCancel(cid, 'You don\'t have ' .. i.money .. ' gold.')
	elseif not doPlayerRemoveItem(cid, i.old, 1) then
		return doPlayerSendCancel(cid, 'You don\'t have ' .. getItemInfo(i.old).article .. ' ' .. getItemInfo(i.old).name .. '.')
	else
		doPlayerRemoveMoney(cid, i.money)
		doPlayerAddItem(cid, i.new, 1)
		doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
		return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
	end
end
 
Hey man i must add to actions!! This is actions script:

<action uniqueid="8101" script="firewalker refil.lua" />
<action uniqueid="8100" script="soft refil.lua" />
 
The Forgotten Server, version 0.3.6..

?????????????????????????

I must add to actions/scripts/softrefil.lua?????? :

local t = {
[UID of lever for soft boots] = {old = 6530, new = 6132, money = 10000},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local i = t[item.uid]
if getPlayerMoney(cid) < i.money then
return doPlayerSendCancel(cid, 'You don\'t have ' .. i.money .. ' gold.')
elseif not doPlayerRemoveItem(cid, i.old, 1) then
return doPlayerSendCancel(cid, 'You don\'t have ' .. getItemInfo(i.old).article .. ' ' .. getItemInfo(i.old).name .. '.')
else
doPlayerRemoveMoney(cid, i.money)
doPlayerAddItem(cid, i.new, 1)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
end

And fireworkboots :

local t = {
[UID of lever for fw boots] = {old = 9934, new = 9933, money = 10000},
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
local i = t[item.uid]
if getPlayerMoney(cid) < i.money then
return doPlayerSendCancel(cid, 'You don\'t have ' .. i.money .. ' gold.')
elseif not doPlayerRemoveItem(cid, i.old, 1) then
return doPlayerSendCancel(cid, 'You don\'t have ' .. getItemInfo(i.old).article .. ' ' .. getItemInfo(i.old).name .. '.')
else
doPlayerRemoveMoney(cid, i.money)
doPlayerAddItem(cid, i.new, 1)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
end
????
 
look see this example :
i go to actions--> scripts--> make a new refill.lua and paste
Code:
local t = {
	[B][COLOR="red"][9000][/COLOR][/B] = {old = 6530, new = 6132, money = 10000},   -- this for soft boots
	[COLOR="red"][B][9001] [/B][/COLOR]= {old = 9934, new = 9933, money = 10000},   -- this for fire boots
} 

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local i = t[item.uid]
	if getPlayerMoney(cid) < i.money then
		return doPlayerSendCancel(cid, 'You don\'t have ' .. i.money .. ' gold.')
	elseif not doPlayerRemoveItem(cid, i.old, 1) then
		return doPlayerSendCancel(cid, 'You don\'t have ' .. getItemInfo(i.old).article .. ' ' .. getItemInfo(i.old).name .. '.')
	else
		doPlayerRemoveMoney(cid, i.money)
            
		doPlayerAddItem(cid, i.new, 1)
		doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
		return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
	end
end

so you see this red numbers marked , they are unique id you will put on lever to refill the boots.[lets go to the action.xml part first]

now go to actions--> action.xml and paste this line
Code:
<action uniqueid="[COLOR="red"][B]9000-9001[/B][/COLOR]" event="script" value="refill.lua"/>
so the numbers in the uniqueid place are the same we added in the main script.


Now in the game make 2 levers :
1-first one put uid--> 9000 [This will be for soft boots]
2- second one pit uid--> 9001 [This will be for fire boots]
 
Last edited:

Similar threads

Back
Top