• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Teleport

Status
Not open for further replies.

GarQet

Own3d!
Joined
Feb 10, 2009
Messages
1,381
Solutions
14
Reaction score
81
Witam, mam pytanie, czy jest możliwość stworzenia takiego teleporta, że raz teleportuje na jedną pozycję a drugi raz na inną?
Da się coś takiego zrobić?
Jakich funkcji trzeba użyć?
Proszę o pomoc. Bo potrzebuję takiego tp :D.
Dam repka ^_^
 
Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	local positions = {{ x = , y = , z = }, { x = , y = , z = }, { x = , y = , z = }, { x = , y = , z = }, { x = , y = , z = }}
	doTeleportThing(cid, positions[math.random(1, #positions)])
	return true
end
 
No tak, ale z tego co widzę to ono wybierze random, czyli sobie wybierze albo tą albo tą. A ja potrzebuję takiego że raz tu i raz tu. Żeby nigdy się nie pomylił skrypt.
 
Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	local pos = (getGlobalStorageValue(5555) <= 0 or getGlobalStorageValue(5555) == 1) and 1 or getGlobalStorageValue(5555)
	local positions = {{ x = , y = , z = }, { x = , y = , z = }, { x = , y = , z = }, { x = , y = , z = }, { x = , y = , z = }}
	doTeleportThing(cid, positions[math.random(1, #positions)])
	if (pos == #positions) then
		setGlobalStorageValue(5555, 1)
	else
		setGlobalStorageValue(5555, pos + 1)
	end
	return true
end
 
Już myślałem że działa, ale dwa razy pod rząd tepneło na tą samą pozycję. Potrzebne mi to do questa, dlatego jest tak ważne żeby raz na jedną pozycję raz na drugą. Proszę o pomoc :)
 
Zapomnialem o przepisaniu doTeleportThing xd.

Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	local pos = (getGlobalStorageValue(5555) <= 0 or getGlobalStorageValue(5555) == 1) and 1 or getGlobalStorageValue(5555)
	local positions = {{ x = , y = , z = }, { x = , y = , z = }, { x = , y = , z = }, { x = , y = , z = }, { x = , y = , z = }}
	doTeleportThing(cid, positions[pos])
	if (pos == #positions) then
		setGlobalStorageValue(5555, 1)
	else
		setGlobalStorageValue(5555, pos + 1)
	end
	return true
end
 
Rep ;)

You must spread some Reputation around before giving it to Chojrak again.
:/

Wbije komuś repki i na pewno dam tobie :p
 
Status
Not open for further replies.
Back
Top