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
then in talkactions.xml add this
Wynden the Second(making the code smaller)
Comments Please
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