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

doTeleportThing :/

SasirO

Banned User
Joined
Apr 30, 2009
Messages
559
Reaction score
0
heres my script:
Code:
local tile1pos = {x=32911, y=32209, z=15, stackpos=0}
local tile2pos = {x=32912, y=32209, z=15, stackpos=0}
local tile3pos = {x=32911, y=32210, z=15, stackpos=0}
local tile4pos = {x=32912, y=32210, z=15, stackpos=0}
local lever1pos = {x=32915, y=32215, z=15, stackpos=1}
local lever2pos = {x=32908, y=32207, z=15, stackpos=1}
local jedynka = {x=32911, y=32209, z=15, stackpos=0}
local dwojka = {x=32912, y=32209, z=15, stackpos=0}
local trojka = {x=32911, y=32210, z=15, stackpos=0}
local czworka = {x=32912, y=32210, z=15, stackpos=0}
local newpos = {x=32911, y=32211, z=15}

function onUse(cid, item, frompos, item2, topos)

local tile1 = getThingfromPos(tile1pos)
local tile2 = getThingfromPos(tile2pos)
local tile3 = getThingfromPos(tile3pos)
local tile4 = getThingfromPos(tile4pos)
local lever1 = getThingfromPos(lever1pos)
local lever2 = getThingfromPos(lever2pos)
if (item.itemid == 1945 and tile1.itemid == 598 and tile2.itemid == 598 and tile3.itemid == 598 and tile4.itemid == 598) then

doTransformItem(tile1.uid,407)
doTransformItem(tile2.uid,407)
doTransformItem(tile3.uid,407)
doTransformItem(tile4.uid,407)

doTransformItem(lever1.uid,1946)
doTransformItem(lever2.uid,1946)

elseif (item.itemid == 1946 and tile1.itemid == 407 and tile2.itemid == 407 and tile3.itemid == 407 and tile4.itemid == 407) then

doTransformItem(tile1.uid,598)
doTransformItem(tile2.uid,598)
doTransformItem(tile3.uid,598)
doTransformItem(tile4.uid,598)
doTransformItem(lever1.uid,1945)
doTransformItem(lever2.uid,1945)
jedynka.stackpos = 253
dwojka.stackpos = 253
trojka.stackpos = 253
czworka.stackpos = 253
if getThingFromPos(jedynka).itemid > 0 or getThingFromPos(dwojka).itemid > 0  or getThingFromPos(trojka).itemid > 0  or getThingFromPos(czworka).itemid > 0 then
		doTeleportThing(cid, newpos)
		end
end 
return 1
end



The problem is, if theres a creature or a player on one of those 4 sqms( jedynka, dwojka, trojka, czworka) then the player that switched the levers gets teleported to NEWPOS, i want only the creature or a player gets teleported thats standing on one of those 4 sqms.
 
This script is very badly done, i don't really understand what it does. And the polish variable names doesn't make it easier. You should wipe this script and request what you want instead.
 
tilepos 1-4 are the tiles that're beeing transformed everytime someone pull the lever,
leverPos 1-2 , its the position of both levers
jedynka, dwojka .... , its a position of 4 sqms, its checking if theres a creature/player, is thres a creature or a player on one of them then the creature/player gets teleported to NEWPOS position, but right now its not working correctly, the one whos pulling the lever gets teleported...:(/
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

	--by Maxi (Shawak) 

	local players_pos = {
	{x = 1101,y = 1195,z = 7,stackpos = 253},
	{x = 1101,y = 1194,z = 7,stackpos = 253},
	{x = 1101,y = 1193,z = 7,stackpos = 253},
	{x = 1101,y = 1192,z = 7,stackpos = 253}
	}

	local new_player_pos = {
		x = 1100, 
		y = 1194, 
		z = 10
	}


	local player1 = getThingfromPos(players_pos[1])
	local player2 = getThingfromPos(players_pos[2])
	local player3 = getThingfromPos(players_pos[3])
	local player4 = getThingfromPos(players_pos[4])

	if item.itemid == 1945 then
		for i = 1, 4 do
			player[i] = getThingfromPos(players_pos[i])
			if player[i].itemid > 0 then
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
				doTeleportThing(cid, new_player_pos)
				doSendMagicEffect(new_player_pos, CONST_ME_ENERGYAREA)
				doTransformItem(item.uid,1946)
			end
		end
	elseif item.itemid == 1946 then
		doTransformItem(item.uid,1945)
	end
	return TRUE
end

Regards,
Shawak
 
ye but ur script is just transforming one lever instead of 2 and moving the players to new position, look at my script, there if a player pull the lever then 4 tiles ( lava ) are transforming to ground tiles, 2 levers are getting transformed
 
Back
Top