View Full Version : On first login

03-21-2014, 05:32 AM
AAH , i'm stupid ... found the error !! Is because i used character "Ç" . Thanks.

Hello , i'm tring create script first login but RegisterServerEvent(75,xxx) no working .... i tried this :

local Team = {
[0] = "[|TInterface\\icons\\Inv_Misc_Tournaments_banner_Hu man.png:13|t|cff0000ffAliança",
[1] = "[|TInterface\\icons\\Inv_Misc_Tournaments_banner_Or c.png:13|t|cffff0000Horda"
function primeiro(event,player)
SendWorldMessage("["..player:GetName().."] |cff99ccffAcabou de entrar no servidor "..Team[player:GetTeam()].."]");


But, when i create Aliance character no send worldmessage

03-21-2014, 05:39 AM

There's no such server event '75' .. It stops at 29 https://github.com/ElunaLuaEngine/Eluna-TC-Wotlk/blob/master/src/LuaEngine/HookMgr.h#L132

It won't announce when you create a character, but when your newly created character logs in for the first time.

Not entirely sure about if it supports the characters (letters) you're using.

Lua always starts counting at 1, not 0.

local Team = {
[1] = "[|TInterface\\icons\\Inv_Misc_Tournaments_banner_Hu man.png:13|t|cff0000ffAliança",
[2] = "[|TInterface\\icons\\Inv_Misc_Tournaments_banner_Or c.png:13|t|cffff0000Horda"

It most likely errored when it tried to load because you started the count at 0 instead of 1. It's probably better off to use a string rather than a numerical value.

03-21-2014, 10:52 AM
Lua automatically indexes at 1 and not 0, however you can manually set a key to 0 just like the OP did. The issue was the special characters like he edited in the post, so marking as solved :)