• 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] Help with tp creature to new pos

Dridia

New Member
Joined
Jan 17, 2012
Messages
49
Reaction score
1
Location
Sweden
I have a serious problem that i can't figure out.


there are 3 monsters from "tpmobfrom.from" to "tpmobfrom.to" and i want them to teleport to "tpmobto".
I don't want to create one variable for each monster, then the script would become enormous!
I don't get any errors, it's just that they don't get teleported.
LUA:
local tpmobfrom = {
			from = {x =1179, y =1019, z =7, stackpos =255},
			to = {x =1181, y =1019, z =7, stackpos =255}
			      }
local tpmobto = {
			from = {x =1179, y =1021, z = 7},
			to = {x =1181, y =1021, z = 7}
				}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 and item.uid == 1554 then
		if isInArea(getCreaturePosition(cid), tpmobfrom.from, tpmobfrom.to) then
			doTeleportThing(tpmobto.from, tpmobto.to)
		else
			doPlayerSendTextMessage(cid,21,'Something went wrong...')
		end
	end
end

I'm thankful for help! :)
 
Back
Top