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

MoveEvent Remove/Add wall (first script)

Oscar Lyis

Donator
Joined
May 30, 2008
Messages
633
Reaction score
1
Location
Sweden
OK, actually I don't know if it works or not so I want someone experience LUA scripter to check this.

addwall:
Code:
--Movement script with removal + add wall by Lord Ockero--

function onStepIn(cid, item, position, fromPosition)
local wall1 = getThingfromPos ({x=1234,y=1234,z=7, stackpos=1} // Set positions
	if (item.actionid == 416) then
	if isPlayer(cid) == 1 then
		doRemoveItem(wall1.uid,1)
		doTransformItem(item.uid, item.itemid+1)

end
end
	return 1
end


function onStepOut(cid, item, position, fromPosition)

local wall1 = getThingfromPos ({x=1234,y=1234,z=7, stackpos=1} // Set positions

	if(item.actionid == 416) then
	if isPlayer(cid) == 1 then
		doCreateItem(1060,1,wall1)
		doTransformItem(item.uid, item.itemid-1)

end
end
	return 1
end

Code:
-- Movement by Lord ockero --
<movevent event="StepIn" actionid="416" script="addwall.lua" />
<movevent event="StepOut" actionid="416" script="addwall.lua" />

add comments on how i can improve it ty
 
someone tested?? i need to know cuz im not home atm and i wont be for 15 days :( so i cant test myself
 
Code:
local cfg = {
	pos = {x=1234,y=1234,z=7},
	itemid = 1060
}
function onStepIn(cid, item, position, fromPosition)
	local v = getTileItemById(cfg.pos, cfg.itemid).uid
	return
		isPlayer(cid) == TRUE and
		v > 0 and
		doRemoveItem(v) and
		doTransformItem(item.uid, item.itemid + 1)
end
function onStepOut(cid, item, position, fromPosition)
	local v = getTileItemById(cfg.pos, cfg.itemid).uid
	return
		isPlayer(cid) == TRUE and
		v == 0 and
		doCreateItem(cfg.itemid, 1, cfg.pos) and
		doTransformItem(item.uid, item.itemid + 1)
end
bleh, this is too advanced for you
 
Code:
local cfg = {
	pos = {x=1234,y=1234,z=7},
	itemid = 1060
}
function onStepIn(cid, item, position, fromPosition)
	local v = getTileItemById(cfg.pos, cfg.itemid).uid
	return
		isPlayer(cid) == TRUE and
		v > 0 and
		doRemoveItem(v) and
		doTransformItem(item.uid, item.itemid + 1)
end
function onStepOut(cid, item, position, fromPosition)
	local v = getTileItemById(cfg.pos, cfg.itemid).uid
	return
		isPlayer(cid) == TRUE and
		v == 0 and
		doCreateItem(cfg.itemid, 1, cfg.pos) and
		doTransformItem(item.uid, item.itemid + 1)
end
bleh, this is too advanced for you

yeh lol but nice setup with local cfg and cfg.pos/cfg.itemid will use this in my next script!!

but does my script work im excited since i'm not home and won't be home in 15~ days and i cant test on this computer
 
Ill try and test it on TFS 3.6+ forgotten when i get done mapping for my server, if i can get this to work i have alot of uses for this. "crosses fingers" i really shouldn't be testing this i dont know allot yet about scripts yet just enough to survive :p learning everyday though
 
Back
Top