Shady1 Posted June 7, 2021 Share Posted June 7, 2021 (edited) hello friends. can anyone give me a level system for my mta dayz server.level up when you kill zombies and humans and will give an item every 5 levels. for example : Player 5Level : Gives 1 M4 weapon and M4 Mag when spawn for example : Player 10Level : Gives 1 Lee Enfield weapon and Lee Enfield Mag when spawn. for example : Player 15Level : Gives 1 etc. weapon and etc. when spawn. for example : Player 20Level : Gives 1 etc. weapon and etc. when spawn. I would be very happy if you can help. #Edit: and : exprequired.xml : <exprequired> <level Level="1" EXPRequired="25"></level> <level Level="2" EXPRequired="50"></level> <level Level="3" EXPRequired="100"></level> <level Level="4" EXPRequired="250"></level> <level Level="5" EXPRequired="500"></level> <level Level="6" EXPRequired="750"></level> <level Level="7" EXPRequired="1000"></level> <level Level="8" EXPRequired="1250"></level> <level Level="9" EXPRequired="1500"></level> <level Level="10" EXPRequired="1750"></level> <level Level="11" EXPRequired="2000"></level> <level Level="12" EXPRequired="3000"></level> <level Level="13" EXPRequired="4000"></level> <level Level="14" EXPRequired="5000"></level> <level Level="15" EXPRequired="6000"></level> <level Level="16" EXPRequired="7000"></level> <level Level="17" EXPRequired="8000"></level> <level Level="18" EXPRequired="9000"></level> <level Level="19" EXPRequired="10000"></level> <level Level="20" EXPRequired="12500"></level> <level Level="21" EXPRequired="15000"></level> <level Level="22" EXPRequired="17500"></level> <level Level="23" EXPRequired="20000"></level> <level Level="24" EXPRequired="30000"></level> <level Level="25" EXPRequired="40000"></level> <level Level="26" EXPRequired="50000"></level> <level Level="27" EXPRequired="60000"></level> <level Level="28" EXPRequired="70000"></level> <level Level="29" EXPRequired="80000"></level> <level Level="30" EXPRequired="90000"></level> <level Level="31" EXPRequired="100000"></level> <level Level="32" EXPRequired="200000"></level> <level Level="33" EXPRequired="300000"></level> <level Level="34" EXPRequired="400000"></level> <level Level="35" EXPRequired="500000"></level> <level Level="36" EXPRequired="600000"></level> <level Level="37" EXPRequired="700000"></level> <level Level="38" EXPRequired="800000"></level> <level Level="39" EXPRequired="900000"></level> <level Level="40" EXPRequired="1000000"></level> </exprequired> Edited June 7, 2021 by !#NssoR_) Merged to the original post. Link to comment
Tekken Posted June 8, 2021 Share Posted June 8, 2021 (edited) Hi, you have my simple level system in my signature, however you need to setup the rewards by yourself, is not that complicated. Also moved your topic to resources section as this is more a request than a scripting question. Edited June 8, 2021 by Tekken Link to comment
Shady1 Posted June 8, 2021 Author Share Posted June 8, 2021 I saw it and I liked it, can you help me with this award? I'm new to lua script and I don't have much knowledge if you can help me I would be very happy Link to comment
Tekken Posted June 8, 2021 Share Posted June 8, 2021 Ok, what exactly do you need help with? Link to comment
Shady1 Posted June 8, 2021 Author Share Posted June 8, 2021 (edited) will give an item every 5 levels. for example : Player 20Level : Gives 1 M4 weapon and M4 Mag when spawn for example : Player 25evel : Gives 1 Lee Enfield weapon and Lee Enfield Mag when spawn. for example : Player 30Level : Gives 1 etc. weapon and etc. when spawn. for example : Player 35Level : Gives 1 etc. weapon and etc. when spawn A gift item will be given when the dayz items are automatically respawned after level 20. Finally, the level should appear on the scoreboard. Thanks bro Can you send a private link when you do it? Edited June 8, 2021 by eoL|Shady Link to comment
Tekken Posted June 8, 2021 Share Posted June 8, 2021 local rewardTable = { [5] = {"M4", "M4 Mag", 90}; -- add ammo and ammount of ammo to give! [10] = {"Coyote Backpack"}; -- for items that don't have ammo no need to add anything after! -- you will have to add the rest! }; -- add this to spawn function! local pLvl = getElementData(player, "lvl") or 0; if pLvl >= 5 then --check if valid reward possible! for i = 5, pLvl, 5 do --start from 5 and jump from 5 to 5! as there are no other rewards in between! local data = rewardTable[i] or false; if data then setElementData(player, data[1], (getElementData(player, data[1]) or 0) + 1); -- Give M4; if data[2] then -- check if must give ammo? setElementData(player, data[2], (getElementData(player, data[2]) or 0) + data[3]); -- Give ammo; end end end end -- Add this just after items refresh! for _,player in ipairs(getElementsByType("player")) do local pLvl = getElementData(player, "lvl") or 0; if pLvl >= 20 then setElementData(player, "CZ 550", (getElementData(player, "CZ 550") or 0) + 1); -- Give CZ 550; end end --For the scoreboard you just have to add it by yourself you will just have to add another line with getElementData(player, "lvl") 1 Link to comment
Shady1 Posted June 8, 2021 Author Share Posted June 8, 2021 Is it server.lua or client.lua? can you post it fully. can you integrate it into the level system and give it Link to comment
Tekken Posted June 8, 2021 Share Posted June 8, 2021 I can’t, you will have to integrate it yourself in your DayZ gamemode Link to comment
Shady1 Posted June 9, 2021 Author Share Posted June 9, 2021 Can you help me if I give the Level System I made in the private messages section? because I've been trying since yesterday I can't. Link to comment
onfloow21 Posted June 10, 2021 Share Posted June 10, 2021 12 hours ago, eoL|Shady said: Can you help me if I give the Level System I made in the private messages section? because I've been trying since yesterday I can't. Dude! You have soo many tutorials about lua scripts on the internet. Just say it out loud you need a dev to work for you... On 08/06/2021 at 19:22, Tekken said: local rewardTable = { [5] = {"M4", "M4 Mag", 90}; -- add ammo and ammount of ammo to give! [10] = {"Coyote Backpack"}; -- for items that don't have ammo no need to add anything after! -- you will have to add the rest! }; -- add this to spawn function! local pLvl = getElementData(player, "lvl") or 0; if pLvl >= 5 then --check if valid reward possible! for i = 5, pLvl, 5 do --start from 5 and jump from 5 to 5! as there are no other rewards in between! local data = rewardTable[i] or false; if data then setElementData(player, data[1], (getElementData(player, data[1]) or 0) + 1); -- Give M4; if data[2] then -- check if must give ammo? setElementData(player, data[2], (getElementData(player, data[2]) or 0) + data[3]); -- Give ammo; end end end end -- Add this just after items refresh! for _,player in ipairs(getElementsByType("player")) do local pLvl = getElementData(player, "lvl") or 0; if pLvl >= 20 then setElementData(player, "CZ 550", (getElementData(player, "CZ 550") or 0) + 1); -- Give CZ 550; end end --For the scoreboard you just have to add it by yourself you will just have to add another line with getElementData(player, "lvl") Tysm! Link to comment
Recommended Posts