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

Lua Talkaction Problem! REP++

Joined
Dec 22, 2007
Messages
1,984
Reaction score
2
I am using The Forgotten Server
Version: 0.3.2 (Crying Damson)and i have problem with talkactions.. when i write something for example /a 5 every1 can see it at default.. wtf?

Rep for person who help :p
 
It depends if your saying it with a normal character, it will send in default.. but if your using a GM char, it wont send in default..

Well try this..

Goto Data/Talkactions/Scripts make a file called teleporttiles.lua

Open it, and put that in :-

Code:
function onSay(cid, words, param)
	local n = 1
	if(param ~= "" and tonumber(param)) then
		n = tonumber(param)
	end

	local pos = getPosByDir(getCreaturePosition(cid), getPlayerLookDir(cid), n)
	pos.stackpos = STACKPOS_GROUND
	if(getTileThingByPos(pos).uid == 0) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot teleport there.")
		return TRUE
	end

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

	local tmp = getCreaturePosition(cid)
	if(doTeleportThing(cid, pos, TRUE) ~= LUA_ERROR and isPlayerGhost(cid) ~= TRUE) then
		doSendMagicEffect(tmp, CONST_ME_POFF)
		doSendMagicEffect(pos, CONST_ME_TELEPORT)
	end

	return TRUE
end
After that :-

Goto Data/Talkactions.xml


And add this line :-

Code:
	<talkaction log="yes" words="/a" access="6" event="script" value="teleporttiles.lua"/>

Just doing my best to help you, dont forget to rep++ me!
 
Back
Top