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

Skrypt Teleportujacy need help

arekziomal

New Member
Joined
Feb 26, 2009
Messages
102
Reaction score
0
Location
U.K
Cześc mam skrypt który teleportuje jak się stanie na tą kratkę z tym UniqueID

o to skrypt
local newpos = {x=32970, y=32226, z=7}
function onStepIn(cid, item, position, fromPosition)
doSendMagicEffect(getPlayerPosition(cid), 2)
doTeleportThing(cid,newpos)
doSendMagicEffect(newpos,10)
end

Ale chciałbym żeby nie teleportowało do wybranej pozycji tylko do światyni gracza żeby pobierało jego TownID w jakim jest zapisany i żeby jak stanie na tą kratę to żeby do jego światyni go teleportowalo ;d
 
Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if(not isPlayer(cid)) then
		return true
	end

	local newPos = getTownTemplePosition(getPlayerTown(cid))
	doSendMagicEffect(position, CONST_ME_POFF)
	doSendMagicEffect(newPos, CONST_ME_TELEPORT)
	doTeleportThing(cid, newPos)
	return true
end
 
@Donaj
Wyskakuje biały dymek jak wejde na kratkę :d

@Chojrak
Twój działa prawidłowo :)!


Dziękuje Rep leci dla was obu :d

@edit tobie chojrak cos nie moge dac.. :/
 
Elo.

Chojrak przerobiłem twój skrypt troszkę i mam pytanie czy poprawnie, skrypt działa ale czy dobrze zrobiłem ?;d

local config = {
vocation = 2, --Id of the vocation to teleport
level = 30
}
local newpos = {x=33091, y=32333, z=7}
function onStepIn(cid, item, position, fromPosition)
if (getPlayerVocation(cid) == config.vocation) then
if (getPlayerLevel(cid) == config.level) then
doSendMagicEffect(getPlayerPosition(cid), 2)
doTeleportThing(cid,newpos)
doSendMagicEffect(newpos,10)
else
doPlayerSendTextMessage(cid, 25, 'You need 30 level to step on this tile!')
end
else
doPlayerSendTextMessage(cid, 25, 'You have to be a Druid to step on this tile!.')
end
end

dodałem parę rzeczy takich jak
local config = {
vocation = 2, --Id of the vocation to teleport
level = 30
}

oraz

else
doPlayerSendTextMessage(cid, 25, 'You need 30 level to step on this tile!')
end
else
doPlayerSendTextMessage(cid, 25, 'You have to be a Druid to step on this tile!.')

if (getPlayerVocation(cid) == config.vocation) then
if (getPlayerLevel(cid) == config.level) then
 
@up :/
Mam z tym skryptem problem xD ponieważ da się tylko wejśc w teleport do enchant na 30 Levelu jeżeli się ma większy niż 30 to już nie wejdziesz xd

Jak to naprawic?XD

@ Edit

jestem mistrzem xd
udało mi się naprawic

Zmieniłem linijke
if (getPlayerLevel(cid) == config.level) then
na
if getPlayerLevel(cid) >= (config.level) then

:))
 
Last edited:
Back
Top