EnforcedRPG
Nubwarz.no-ip.org
- Joined
- Nov 29, 2012
- Messages
- 39
- Reaction score
- 2
I need help with this script, I made it myself but it doesn't really work correctly... I tried to make it so if you're a knight and you get below 75 axe/sword/club then you will get it back to 75 (100% till 76) etc..
This is how I tried it:
It doesn't really seem to work though :/ it does but it's really messy when you have 75 and go to 74, it will jump up to 77~ and when you start from skills 10~ you only go to skills 60~~ :/
I don't know what's wrong but if someone could help I would really appreciate it!
- - - Updated - - -
------------------------------------------------------------------------------------------------
Fixed it:
This is how I tried it:
Lua:
function onLogin(cid)
local playerVoc = getPlayerVocation(cid)
local samount = getPlayerRequiredSkillTries(cid, 2, 75)
local aamount = getPlayerRequiredSkillTries(cid, 3, 75)
local camount = getPlayerRequiredSkillTries(cid, 1, 75)
local damount = getPlayerRequiredSkillTries(cid, 4, 80)
local shieldp = getPlayerRequiredSkillTries(cid, 5, 70)
local shieldk = getPlayerRequiredSkillTries(cid, 5, 75)
local shieldm = getPlayerRequiredSkillTries(cid, 5, 20)
local magicm = getPlayerRequiredMana(cid, 60)
local magicp = getPlayerRequiredMana(cid, 15)
local magick = getPlayerRequiredMana(cid, 6)
if playerVoc == 1 then
if getPlayerSkillLevel(cid, 5) < 20 then
doPlayerAddSkillTry(cid, 5, shieldm)
else
if getPlayerMagLevel(cid) < 60 then
doPlayerAddSpentMana(cid, magicm)
end
end
end
if playerVoc == 2 then
if getPlayerSkillLevel(cid, 5) < 20 then
doPlayerAddSkillTry(cid, 5, shieldm)
else
if getPlayerMagLevel(cid) < 60 then
doPlayerAddSpentMana(cid, magicm)
end
end
end
if playerVoc == 3 then
if getPlayerSkillLevel(cid, 4) < 80 then
doPlayerAddSkillTry(cid, 4, damount)
else
if getPlayerSkillLevel(cid, 5) < 70 then
doPlayerAddSkillTry(cid, 5, shieldp)
else
if getPlayerMagLevel(cid) < 15 then
doPlayerAddSpentMana(cid, magicp)
end
end
end
end
if playerVoc == 4 then
if getPlayerSkillLevel(cid, 2) < 75 then
doPlayerAddSkillTry(cid, 2, samount)
else
if getPlayerSkillLevel(cid, 1) < 75 then
doPlayerAddSkillTry(cid, 1, camount)
else
if getPlayerSkillLevel(cid, 3) < 75 then
doPlayerAddSkillTry(cid, 3, aamount)
else
if getPlayerSkillLevel(cid, 5) < 75 then
doPlayerAddSkillTry(cid, 5, shieldk)
else
if getPlayerMagLevel(cid) < 5 then
doPlayerAddSpentMana(cid, magick)
end
end
end
end
end
end
return TRUE
end
It doesn't really seem to work though :/ it does but it's really messy when you have 75 and go to 74, it will jump up to 77~ and when you start from skills 10~ you only go to skills 60~~ :/
I don't know what's wrong but if someone could help I would really appreciate it!
- - - Updated - - -
------------------------------------------------------------------------------------------------
Fixed it:
Lua:
function onLogin(cid)
local playerVoc = getPlayerVocation(cid)
local samount = 75 - (getPlayerSkillLevel(cid, 2))
local aamount = 75 - (getPlayerSkillLevel(cid, 3))
local camount = 75 - (getPlayerSkillLevel(cid, 1))
local damount = 80 - (getPlayerSkillLevel(cid, 4))
local shieldp = 70 - (getPlayerSkillLevel(cid, 5))
local shieldk = 75 - (getPlayerSkillLevel(cid, 5))
local shieldm = 20 - (getPlayerSkillLevel(cid, 5))
local magicm = 60 - (getPlayerMagLevel(cid))
local magicp = 15 - (getPlayerMagLevel(cid))
local magick = 6 - (getPlayerMagLevel(cid))
if playerVoc == 1 then
doPlayerAddSkill(cid, 5, shieldm)
doPlayerAddMagLevel(cid, magicm)
end
if playerVoc == 2 then
doPlayerAddSkill(cid, 5, shieldm)
doPlayerAddMagLevel(cid, magicm)
end
if playerVoc == 3 then
doPlayerAddSkill(cid, 4, damount)
doPlayerAddSkill(cid, 5, shieldp)
doPlayerAddMagLevel(cid, magicp)
end
if playerVoc == 4 then
doPlayerAddSkill(cid, 2, samount)
doPlayerAddSkill(cid, 1, camount)
doPlayerAddSkill(cid, 3, aamount)
doPlayerAddSkill(cid, 5, shieldk)
doPlayerAddMagLevel(cid, magick)
end
return TRUE
end
Last edited by a moderator: