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

Talkaction Script

Bill3000

New Member
Joined
Jul 26, 2010
Messages
106
Reaction score
1
Hello OTLand

I need a script then when a gamemaster say something like /sendtemple PLAYERNAME and the player goes to his temple.

It's faster then the Gamemaster goes to temple then bring the player.

Thanks!
 
Bill3000 use /commands next time :) if you dont have it there you go

<talkaction words="/commands" event="script" value="commands.lua"/>

make file called commands.lua

local config = {
guildTalksEnabled = getBooleanFromString(getConfigValue('ingameGuildManagement'))
}

function onSay(cid, words, param, channel)
local playerAccess, t = getPlayerAccess(cid), {}
for i, talk in ipairs(getTalkActionList()) do
if(not talk.hide and playerAccess >= talk.access) then
local tmp = talk.words:sub(1, 1):trim()
if((guildTalksEnabled or (talk.words ~= "!joinguild" and talk.words ~= "!createguild")) and (tmp == "!" or tmp == "/")) then
table.insert(t, talk)
end
end
end

table.sort(t, function(a, b) return a.access > b.access end)
local lastAccess, str = -1, ""
for i, talk in ipairs(t) do
local line = ""
if(lastAccess ~= talk.access) then
if(i ~= 1) then
line = "\n"
end
lastAccess = talk.access
end
str = str .. line .. talk.words .. "\n"
end

doShowTextDialog(cid, 2160, str)
return true
end
 
Doesn't work properly.

When the gamemaster say /t playername

The player goes to isle of solitude, home of the gamemaster.

I need the script to teleport THE PLAYER to HIS temple, not the gamemaster temple.
 
<talkaction log="yes" words="/tp" access="2" event="script" value="teleportmaster.lua"/>


function onSay(cid, words, param, channel)
local tid = cid
if(param ~= '') then
tid = getPlayerByNameWildcard(param)
if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
return true
end
end

local pos = getPlayerTown(tid)
local tmp = getTownName(pos)
if(not tmp) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Home town does not exists.")
return true
end

pos = getTownTemplePosition(pos)
if(not pos or isInArray({pos.x, pos.y}, 0)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong temple position for town " .. tmp .. ".")
return true
end

pos = getClosestFreeTile(tid, pos)
if(not pos or isInArray({pos.x, pos.y}, 0)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Destination not reachable.")
return true
end

tmp = getCreaturePosition(tid)
if(doTeleportThing(tid, pos, true) and not isPlayerGhost(tid)) then
doSendMagicEffect(tmp, CONST_ME_POFF)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
end

return true
end

/tp playername
 
Back
Top