I am trying to get an npc to say 1 of 4 phrases every 20 seconds. Here is the code I am using, but when I put it into my ArcEmu scripts folder, it comes up with the error
Code:
LuaEngine: Loading scripts...
scripts\Bartender.lua:1: '<' expected near 'Jenkins'
LuaEngine: Loaded 131 Lua Scripts
when I start Arcemu-world.exe
Here is the .lua code that I used. Its vaguely color coded to help
Code:
function Barkeep Jenkins(Unit, Event)
Unit:RegisterEvent("Barkeep Jenkins_say", 20000, 0)
end
function Barkeep Jenkins_say(Unit, Event)
local chance = math.random(1,4)
if(chance == 1) then
Unit:SendChatMessage(412, 0, "Fresh Ale! Made this Morning and Shipped by Portal!")
end
if(chance == 2) then
Unit:SendChatMessage(412, 0, "Hey! Fierydiaria! We have your Favourite Bourbon in Stock!")
end
if(chance == 3) then
Unit:SendChatMessage(412, 0, "Come in for a pint!")
end
if(chance == 4) then
unit:SendChatMessage(412, 0, "Need a refreshment?")
end
end
function Barkeep Jenkins_Died(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(100003, 18, "Barkeep Jenkins"
RegisterUnitEvent(100003, 4, "Barkeep Jenkins_Died")
Is there anyone who can help me fix the LuA? Thanks in advance
EDIT: Incase your wondering, Fierydiaria is one of my GMs