• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Learn Spell On Levelup

Foereaper

Founder
Line 110:

[64] = {31801},

You're missing a comma. So obviously you did something wrong :p The error log is always fairly self explanatory, it tells you what line the error is on and what is wrong, so check that if you have more issues
 

Hyldran0

Enthusiast
Line 110:

[64] = {31801},

You're missing a comma. So obviously you did something wrong :p The error log is always fairly self explanatory, it tells you what line the error is on and what is wrong, so check that if you have more issues

Oh.. Sorry.. Been trying to fix this all night. Pretty tired..

But DK spells dont work :p
Every other class works. But not DeathKnight.
 

Jafferwaffer

Exalted Member
Its Death Knight, not DeathKnight.
Puladin wouldnt work for Paladin either.

Thanks for this Rochet, been wondering this myself.

Will be updating this script soon hopefully. Been pretty short of time as of late, but I'll see what I can do.

Cheers guys, stay posted

Edit: Updated pastebin so that Death Knight should work.
 
Last edited:

Foereaper

Founder
For future reference, if something doesn't work, do print checks :) print your variables to see what they return, in this case, GetClassAsString would have been printed as "Death Knight"
 

susumakusu

Enthusiast
Hello I used the script on my server and i get this error.

lua_scripts/learnspellonlevelup.lua:519: attempt to index field '?' (a nil value)

I checked the code and see

local classString = self:GetClassAsString();

If someone use other dbcs language it will work?

So i changed to

local classString = self:GetClassAsString(0);

local spells = Classes[classString][oldlevel] or {};

That's the line where the problem exists

Because I am using a french dbc, but the problem still exists, any help?
 
Last edited:

Rochet2

Moderator / Eluna Dev
Hello I used the script on my server and i get this error.
I checked the code and see
If someone use other dbcs language it will work?
So i changed to
That's the line where the problem exists
Because I am using a french dbc, but the problem still exists, any help?


Tell us and show us the line that the error happens on.
Do you have english DBC at all? If you do not have english and only have french DBC, then there is no way the function can return english class names.
The code would need to be converted to use class IDs or french names or you would need to get english and french DBC co-exist somehow.

Try printing what classString is by adding this to the code print(classString) and see what it says in the console after you use the code.
 

Rochet2

Moderator / Eluna Dev
Yeah I ve checked, only
give me the name of the class in french, so if i want to use this script i have to change the english name in table or use instead?

The script has the names in english.
Does self:GetClassAsString(0); give you english or not?

The client locale should not matter - the function only uses server default locale or the locale you give to it and the data returned is from DBC.

If you use the self:GetClassAsString(2); which returns french, then you need to change the class names into french yes.
 

susumakusu

Enthusiast
The script has the names in english.
Does self:GetClassAsString(0); give you english or not?

No It doesn't, so I think a good change for the script would be to change name in english in table to ClassID numbers. It will make the script "unirversal"


local Classes = {
["Warrior"] = {

to This

local Classes = {
[1] = { -- WARRIOR

and use

local classString = self:GetClass();

sorry my bad english
 
Last edited:

Jafferwaffer

Exalted Member
While I can see that using class IDs makes it universal and could possibly be slightly more efficient (use of ints over strings) I prefer the class names as it is easier to update the script if spells are missing + to make it server specific (only allowing certain spells for example).
You are more than welcome to convert it to IDs and its easy to do.
 
Top