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

Switch to spot error

slayzer

Klaffen
Joined
Dec 28, 2008
Messages
301
Solutions
3
Reaction score
51
Location
Norway
OK i tryed, and failed to make it possible for a player to stand in 1 certain square and pull a switch to enter a quest. can someone please fix this script:
Code:
		{x = 236, y = 572, z = 9}
	},
	destination =

		{x = 236, y = 572, z = 10}
	}
end

config.daily = getBooleanFromString(config.daily)
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(item.itemid == 9825) then
		if(config.daily) then
			doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		else
			doTransformItem(item.uid, item.itemid - 1)
		end

		return true
	end

	if(item.itemid ~= 9826) then
		return true

	end
Thanks.
 
since im so freakin bad at scripting i was trying to use some of the annihilator script xd can you give me a script for making a switch work like i want it to?
Thanks in advance
 
Code:
function onUse(cid, item, frompos, item2, topos)
local pos = { x = 100, y = 100, z = 7 }  
	if isPlayer(cid) then
		doTeleportThing(cid, pos)
                doSendMagicEffect(pos, CONST_ME_TELEPORT)
	end
end
 
Code:
local config = {
	position = {x = 100, y = 100, z = 7},
	destination = {x = 100, y = 100, z = 7}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 9825 then
		local creature = getTopCreature(config.position).uid
		if creature > 0 then
			doSendMagicEffect(config.position, CONST_ME_TELEPORT)
			doTeleportThing(creature, config.destination)
			doSendMagicEffect(config.destination, CONST_ME_TELEPORT)
		else
			return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
		end
	end
	return doTransformItem(item.uid, item.itemid == 9825 and 9826 or 9825)
end
 

Similar threads

Back
Top