Need help with simple script

pawlacz741

Excellent OT User
Joined
Jan 23, 2009
Messages
83
Best answers
0
Reaction score
1
Hi
I need help with my script, it works on 8.6 but on 10.99 isn't
No errors in console

Code:
function onLogin(cid)
if getPlayerLevel(cid) < 6 then
doPlayerAddExperience(cid, (getExperienceForLevel(6) - getPlayerExperience(cid)))
end
return TRUE
end
 

Ramirow

Excellent OT User
Joined
Aug 22, 2009
Messages
496
Best answers
13
Reaction score
203
Location
Argentina
First and foremost, I'm guessing you're using 2 different servers, please state which version is the 8.6 one, and which version is the 10.99 one
 
OP
P

pawlacz741

Excellent OT User
Joined
Jan 23, 2009
Messages
83
Best answers
0
Reaction score
1
First and foremost, I'm guessing you're using 2 different servers, please state which version is the 8.6 one, and which version is the 10.99 one
I need this script on 10.99 version. I found it in my old OTS 8.54 and want use on 10.99. Im low in scripting and I dont know what is wrong.
 

Dangnoob

Excellent OT User
Joined
Jun 8, 2008
Messages
103
Best answers
2
Reaction score
9
I need this script on 10.99 version. I found it in my old OTS 8.54 and want use on 10.99. Im low in scripting and I dont know what is wrong.
What he was saying is you must have grabbed, for example, a forgotten server distro, and then grabbed from another distro (idk the different distros i dont use newer servers)
 

Ramirow

Excellent OT User
Joined
Aug 22, 2009
Messages
496
Best answers
13
Reaction score
203
Location
Argentina
I need this script on 10.99 version. I found it in my old OTS 8.54 and want use on 10.99. Im low in scripting and I dont know what is wrong.
I mean the server version, not the client. There are 8.6 servers that use TFS 1.2, TFS 0.4, etc. I need to know which SERVER version you're using.
 

AnarchyGame

Banned User
Joined
Mar 21, 2019
Messages
25
Best answers
0
Reaction score
2
I need this script on 10.99 version. I found it in my old OTS 8.54 and want use on 10.99. Im low in scripting and I dont know what is wrong.
Othire
Otx
tfs 1.3
tfs 1.2
tfs 1.1
also from what it seems you just want script that gets you to level 6? so like skip half rook? or does it add just upto 6 levels?
 
OP
P

pawlacz741

Excellent OT User
Joined
Jan 23, 2009
Messages
83
Best answers
0
Reaction score
1
I mean the server version, not the client. There are 8.6 servers that use TFS 1.2, TFS 0.4, etc. I need to know which SERVER version you're using.
Im use tfs 1.2



Othire
Otx
tfs 1.3
tfs 1.2
tfs 1.1
also from what it seems you just want script that gets you to level 6? so like skip half rook? or does it add just upto 6 levels?
I want this: when player get lvl < 8 then set player lvl 8.
 

Apollos

Dude who does stuff
Joined
Apr 22, 2009
Messages
746
Best answers
110
Reaction score
489
Location
United States
Im use tfs 1.2




I want this: when player get lvl < 8 then set player lvl 8.
This tutorial section is not for questions. In the future use support, preferably request thread, for questions like these.

Lua:
function onLogin(player)
    if player:getLevel() < 8 then
        player:addExperience(getExpForLevel(8) - player:getExperience(), false)
    end
    return true
end
 
OP
P

pawlacz741

Excellent OT User
Joined
Jan 23, 2009
Messages
83
Best answers
0
Reaction score
1
This tutorial section is not for questions. In the future use support, preferably request thread, for questions like these.

Lua:
function onLogin(player)
    if player:getLevel() < 8 then
        player:addExperience(getExpForLevel(8) - player:getExperience(), false)
    end
    return true
end
attempt to call global 'getExpForLevel' (a nil value)
 
OP
P

pawlacz741

Excellent OT User
Joined
Jan 23, 2009
Messages
83
Best answers
0
Reaction score
1
Add this above it:
Lua:
local function getExpForLevel(level)
    level = level - 1
    return ((50 * level * level * level) - (150 * level * level) + (400 * level)) / 3
end
working fine thanks ;)
 
Top