tokenzz
:thinking:
- Joined
- Feb 2, 2013
- Messages
- 779
- Solutions
- 2
- Reaction score
- 346
Hiho,
I've recently just put together some of my knowledge into what I'd think is a pretty cool add-on to tibia that allows staff members to manage & handle events with ease.
My issue is that it doesn't seem to work. "
data/talkactions/scripts/events.lua:58: 'end' expected (to close 'function' at line 22) near '<eof>'
"
Kind regards
I've recently just put together some of my knowledge into what I'd think is a pretty cool add-on to tibia that allows staff members to manage & handle events with ease.
Code:
-- Made by Linus (t0kenz), Otland name: tokenzz
local requiredGroup = 3
local MSG = ".:: Events Options ::.\nPossible Events:\n*Football\nExample of how you use it: /event football\nIf you wish to end a current event, type for an example: /event footballstop"
local item = 1810
local EventMsg = "Walk through this teleport to get back to thais temple!"
local EventMsg1 = "Walk through this teleport to get to the current Event!"
local eventfootball = "The football event has started! \n Go to Thais, Carlin or Venore and step into the teleport to join!"
local teleportfootball = {x = 32791, y = 31167, z = 8}
local teleportfootballback = {x = 32791, y = 31167, z = 8}
local thaisdp = {x = 32342, y = 32220, z = 7}
local carlindp = {x = 32329, y =31779, z = 7}
local venoredp = {x = 32915, y = 32072, z = 7}
local Temple = {x = 32369, y= 32241, z= 7}
local footballplayers_pos = { -- tiles in the football arena, if players stand on these if /event footballstop is executed, then they will get teleported to thais temple.
{x = 32343, y = 32218, z = 7},
{x = 32345, y = 32218, z = 7}
}
function onSay(cid, words, param)
local param = param.explode(param, ',')
doShowTextDialog(cid, item, MSG)
if param == "football" then
broadcastMessage(eventfootball, MESSAGE_EVENT_ADVANCE)
doCreateTeleport(1387, teleportfootball, thaisdp)
doCreateTeleport(1387, teleportfootball, carlindp)
doCreateTeleport(1387, teleportfootball, venoredp)
doCreateTeleport(1387, Temple, teleportfootballback) -- Teleport going back from Football event
doCreateItem(1304, 1, {x = 32790, y = 31168, z = 8}) -- Stone blocking regular teleport to the football arena
local blackboard = doCreateItem(1818, 1, {x = 32790, y = 31167, z = 8}) -- Thais blackboard information
doSetItemText(blackboard, EventMsg)
local blackboard1 = doCreateItem(1811, 1, {x = 32342, y = 32219, z = 7}) -- Football event blackboard information
doSetItemText(blackboard1, EventMsg1)
local blackboard2 = doCreateItem(1815, 1, {x = 32914, y = 32072, z = 7})
doSetItemText(blackboard2, EventMsg1)
local blackboard3 = doCreateItem(1810, 1, {x = 32329, y = 31778, z = 7})
doSetItemText(blackboard3, EventMsg1)
elseif param == "footballstop" then
doRemoveItem(getTileItemById(thaisdp, 1387).uid, 1)
doRemoveItem(getTileItemById(carlindp, 1387).uid, 1)
doRemoveItem(getTileItemById(venoredp, 1387).uid, 1)
doRemoveItem(getTileItemById(teleportfootballback, 1387).uid, 1)
doRemoveItem(getTileItemById({x = 32790, y = 31168, z = 8}, 1304).uid, 1)
doRemoveItem(getTileItemById({x = 32790, y = 31167, z = 8}, 1818).uid, 1)
doRemoveItem(getTileItemById({x = 32342, y = 32219, z = 7}, 1811).uid, 1)
doRemoveItem(getTileItemById({x = 32914, y = 32072, z = 7}, 1815).uid, 1)
doRemoveItem(getTileItemById({x = 32329, y = 31778, z = 7}, 1810).uid, 1)
for i = 1, #footballplayers_pos do
local player = getThingfromPos(pos)
if player.itemid > 0 then
if isPlayer(player.uid) then
doTeleportThing(player, Temple)
end
end
My issue is that it doesn't seem to work. "
data/talkactions/scripts/events.lua:58: 'end' expected (to close 'function' at line 22) near '<eof>'
"
Kind regards