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

Lua Script on switch & wall

WaderoS

New Member
Joined
Nov 22, 2008
Messages
98
Reaction score
1
In my spare time I wrote this script.

Description script:
Use the switch and it push the wall disappears automatically after 2minutes this wall back.

Script [Remaked by Spoking]:
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition) 
	wall_pos = {x=617, y=647, z=12, stackpos=1} 
	wall = getThingfromPos(wall_pos) 
 
		if item.itemid == 1945 then
			doSendMagicEffect(wall_pos, 10) 
				doRemoveItem(wall.uid, 1) 
				doTransformItem(item.uid, 1946) 
			addEvent(createWall, 2 * 60 * 1000) 
		else 
			doTransformItem(item.uid, 1945) 
		end 
	return TRUE
end 
 
function createWall()  
	doCreateItem(1034, wall_pos)
	doSendMagicEffect(wall_pos, 10)
end

Check it please and say if it working at TFS 0.3.6!
If there are errors, please correct!
 
Last edited:
Ok i talk some with good scripter and he said me how i can do shortly script.

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition) 
	local uniqueID = 1234 
	local wall_pos = {x=617, y=647, z=12, stackpos=1} 
	local wall = getThinfromPos(wall_pos) 
		if item.uid == uniqueID and item.itemid == 1945 then
			doSendMagicEffect(wall_pos, 10) 
			doRemoveItem(wall.uid, 1) 
			doTransformItem(item.uid, 1946) 
			addEvent(createWall, 2 * 60 * 1000) 
		elseif item.uid == uniqueID and item.itemid == 1946 then 
			doTransformItem(item.uid, 1945) 
		end 
return TRUE
end 

function createWall()  
	doCreateItem(1034, wall_pos)
	doSendMagicEffect(wall_pos, 10)
end

T&C!!!

Take & Check !!!

haha and say me if i work at tfs 0.3.6!

Delete up post please.
 
Shortened more and removed the locals, since those won't work on the createWall() function.

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition) 
	wall_pos = {x=617, y=647, z=12, stackpos=1} 
	wall = getThinfromPos(wall_pos) 
	
		if item.itemid == 1945 then
			doSendMagicEffect(wall_pos, 10) 
				doRemoveItem(wall.uid, 1) 
				doTransformItem(item.uid, 1946) 
			addEvent(createWall, 2 * 60 * 1000) 
		else 
			doTransformItem(item.uid, 1945) 
		end 
	return TRUE
end 

function createWall()  
	doCreateItem(1034, wall_pos)
	doSendMagicEffect(wall_pos, 10)
end
 
#pieter to acctions
#Damadger, beacause i had a problem with wrote this script. Now script is working 100% and i can put it do Actions ; d
 
Back
Top