• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Error in custom lua,please help

Frillinde

Founder: Another Realm
Joined
Jan 16, 2012
Messages
148
Reaction score
3
Location
his computer
I made or at least attempted to make a talkaction for admin chars (senior tutor and up) to use to goto the admin area.
Using 0.3.6pl1 (8.54) this is my error:

[29/03/2012 15:21:03] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/office.lua:11: '<eof>' expected near 'end'
[29/03/2012 15:21:03] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/office.lua)
[29/03/2012 15:21:03] data/talkactions/scripts/office.lua:11: '<eof>' expected near 'end'

Hopefully I was close but I have no lua skills yet ( but I try)

XML:

<talkaction log="yes" words="/office" access="3" event="script" value="office.lua"/>

LUA:

function onSay(cid, words, param, channel)

local office = {x=1316, y=820, z=7}
if getPlayerAccess(cid) > 2 then
doTeleportThing(cid, office)
doSendMagicEffect(office, CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid,22,"Welcome back to the office.")
else
doPlayerSendCancel(cid, 'Sorry, you are currently not able to access this area.')
end end return true
end

Is there 1 too many ends?I dunno :p but I hope you can help fix it.Thanks in advance. :)
 
PHP:
function onSay(cid, words, param, channel)

local office = {x=1316, y=820, z=7}

if getPlayerAccess(cid) > 2 then
	doTeleportThing(cid, office)
		doSendMagicEffect(office, CONST_ME_TELEPORT)
			doPlayerSendTextMessage(cid,22,"Welcome back to the office.")
else
		doPlayerSendCancel(cid, 'Sorry, you are currently not able to access this area.')
	end	
return true
end

try this
 
Back
Top