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

Ground teleport

menio53

New Member
Joined
Mar 6, 2009
Messages
96
Reaction score
0
mój skrypt wygląda tak
function onStepIn(cid, item, pos)
if item.actionid == 1111 then
local pos = getPlayerPosition(cid)
local tppos = {x=1167, y=965, z=9}
doTeleportThing(cid,tppos)
doPlayerSendTextMessage(cid, 19, "zostales teleporniety")
end
return 1
end
a chciałbym żeby było na np mógł w tym skrypcie mieć ustawione na np 40 różnych kratek tp i każde tp będzie miało różny actionid czy wiecie jak przerobić tego skrypt ?
 
Ja oczywiscie, sprobuje, ale nie wiem czy dam rade"
Code:
local config = {
	[actionid] = { x = 1, y = 1, z = 7 },
	[actionid] = { x = 2, y = 2, z = 7 },
	[actionid] = { x = 3, y = 3, z = 7 }
}

function onStepIn(cid, item, pos)
	doTeleportThing(cid, config[item.actionid])
	doPlayerSendTextMessage(cid, 19, "zostales teleporniety kuwa ma")
end
 
LUA:
local teleports =
{
	[1111] = {{ x=100, y=100, z=7}, "Swiatynia"},
	[1112] = {{ x=300, y=300, z=7}, "Zamek"}
}
function onStepIn(cid, item, pos)

	if (teleports[item.actionid] == false) then
		return false
	end
	
	doTeleportThing(cid,teleports[item.actionid][1])
	doPlayerSendTextMessage(cid, 19, "Twoja nowa pozycja: " .. teleports[item.actionid][2])
	return true
end

#edit
Nemaneth, dzięki za uwagę :)
 
Last edited:
LUA:
local teleports =
{
	[1111] = {{ x=100, y=100, z=7}, "Swiatynia"},
	[1112] = {{ x=300, y=300, z=7}, "Zamek"}
}
function onStepIn(cid, item, pos)

	if (teleports[item.actionid] == false) then
		return false
	end
	
	doTeleportThing(cid,teleports[item.uid][1])
	doPlayerSendTextMessage(cid, 19, "Twoja nowa pozycja: " .. teleports[item.actionid][2])
	return true
end

Code:
doTeleportThing(cid,teleports[item.uid][1])

mialo byc action ;/
 
Back
Top