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

TalkAction [7.92]Custom teleporting

Delirium

OTLand veteran
Staff member
Global Moderator
Joined
May 28, 2007
Messages
3,365
Solutions
1
Reaction score
289
Location
Athens, Greece
Hello.This is a talkaction script that makes a player when saying !teleport "areahere he gets teleported there by paying 1k

For example !teleport "depot


Here is the script:

in data/talkactions/scripts

save this as customteleport.lua

Code:
----Custom Teleport made by Nikolas1994 and Edited by Wynden--
----Do not delete the line before this one----
----To add another waypoint just add another elseif string.lower(''..param..'')  == 'name of the place' then pos = {x=0,y=0,z=0} ----
function onSay(cid, words, param)
cash = 1000 -- Price to teleport
if string.lower(''..param..'') == 'depot' then pos = {x=30,y=30,z=7}
elseif string.lower(''..param..'') == 'temple' then pos = {x=40,y=40,z=7}
elseif string.lower(''..param..'') == 'trainers' then pos = {x=20,y=20,z=7}
else return 0
end
	if getPlayerConditionTicks(cid,1024) == 0 then
		if doPlayerRemoveMoney(cid,cash) == 1 then
			if param ~= "" then
				if doTeleportThing(cid,pos) then
					doPlayerSendTextMessage(cid,18,'You have been teleported to '..string.lower(param)..'.')
				end
			else
				doPlayerSendCancel(cid,'Sorry, not possible.')
			end
		else
			doPlayerSendCancel(cid,'You do not have enough money')
		end
	else
		doPlayerSendCancel(cid,'You cannot teleport while on fight.')
	end
end

then in talkactions.xml add this

Code:
<talkactionwords="!teleport script="customteleport.lua"/>

Wynden the Second(making the code smaller)

Comments Please :D
 
RE: [7.92 Talkaction] Custom teleporting command

Thnx but 1 thing as I posted on that other forum, I dont know if you made it by urself because it looks fimilar with that other script what somebody else made..
If you made it forget what I posted above and then you did a good job!;)
Else if you didnt made it by your own and just edited some I think you should give that guy some credit.
 
RE: [7.92 Talkaction] Custom teleporting command

No it was made by me,just because it was too big Wynden made it smaller
 
RE: [7.92 Talkaction] Custom teleporting command

Aah ok then forget what I said and continue with creating such codes!
 
RE: [Talkaction][7.92]Custom teleporting command

how much posts i need for being a member with 2 stars?
 
RE: [Talkaction][7.92]Custom teleporting command

nice work man works fine here
 
RE: [Talkaction][7.92]Custom teleporting command

@TOPIC

if getPlayerConditionTicks(cid,1024) == 0 then

This function work in forgottenserver??? or in what server this function work??

Also can someone sayme how work this function? i need players with batle dont enable to talk with some npcs and to did some actions.

Help me plz
 
RE: [Talkaction][7.92]Custom teleporting command

very nice script.. Thx
 
RE: [Talkaction][7.92]Custom teleporting command

A real nice script, usefull for some servers... Is it possable so it only works when you don't have an attack symbal? xD. Otherwise when your neally about to die you teleport haha.

Great code anyways.

~Kiwi Dan~
 
No it was made by me,just because it was too big Wynden made it smaller
 
Great Job,
Is it usable for 8.0 also??
If it is, can you help me to put it so that if they have the global storage value in 1338 they cant teleport?
 
Great Job,
Is it usable for 8.0 also??
If it is, can you help me to put it so that if they have the global storage value in 1338 they cant teleport?

If getPlayerStorageValue(cid, 1338) == 1 then
doPlayerSendTextMessage(cid,21,"You can not teleport at this moment.")
 
@TOPIC

if getPlayerConditionTicks(cid,1024) == 0 then

This function work in forgottenserver??? or in what server this function work??

Also can someone sayme how work this function? i need players with batle dont enable to talk with some npcs and to did some actions.

Help me plz

That function checks that he isn't in a fight.
 
does not work for TFS 0.2.6 :(
Code:
Lua Script Error: [TalkAction Interface] 
data/talkactions/scripts/teleport.lua:onSay

data/talkactions/scripts/teleport.lua:11: attempt to call global 'getPlayerConditionTicks' (a nil value)

i've removed this condition getPlayerConditionTicks, but still not work:
Code:
Lua Script Error: [TalkAction Interface] 
data/talkactions/scripts/teleport2.lua:onSay

attempt to index a number value
 
Last edited:
The Forgotten Server.

To make it work with TFS switch getPlayerCondition(cid, 1024) to getCreatureCondition(cid, 1024).

and this if doTeleportThing(cid,pos) to this: if doTeleportThing(cid, pos, 0)

yw

Note:
If it is still not working with tfs, I'll might screw with it later.
 
Back
Top