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

NPC create teleport

Dankoo

Active Member
Joined
Sep 4, 2010
Messages
1,007
Reaction score
27
Hello

I've managed to an NPC create an teleport, by adding this code:

Lua:
	elseif msgcontains(msg, 'task') then
		if getStorage == tasks[i].finish_storage_value then
			if tasks[i].boss == "yes" then
				selfSay("Good job, go kill boss.", cid)
				setPlayerStorageValue(cid, main_storage, tasks[i].before_kill_boss)
			local teleportId = 1387
			local portal_in_pos = {x = 32345, y = 31799, z = 7}
			local position = portal_in_pos	
			local teleport = doCreateItem(teleportId,255,position)
			doSetItemUniqueId(teleport, 5301)

The teleport is created normally, but it's UniqueID isn't set

What should I change so UniqueID 5301 is set on it?

thanks a lot ;] :thumbup:
 
If your using 0.4 try this, if your using 0.3.5 I don't think it has that function...

Lua:
 elseif msgcontains(msg, 'task') then
		if getStorage == tasks[i].finish_storage_value then
			if tasks[i].boss == "yes" then
				selfSay("Good job, go kill boss.", cid)
				setPlayerStorageValue(cid, main_storage, tasks[i].before_kill_boss)
			local teleportId = 1387
			local portal_in_pos = {x = 32345, y = 31799, z = 7}
			local position = portal_in_pos	
			local teleport = doCreateItem(teleportId,255,position)
			      doItemSetAttribute(teleport, "uid", 5301)
 
didn't work

nevermind, I'll do an uglier but working thing

local portal_in_pos = {x = 32347, y = 31801, z = 7}
local position = portal_in_pos
doTeleportThing(cid, position)

it will be a teleport room, with tps do quest boss, lol

the player will only be able to enter the room that he should kill the boss, the other tps he can't step in... it's from killing in the name of bosses

thanks for your help :]

rep+
 
Back
Top