0 Üye ve 1 Ziyaretçi konuyu incelemekte.
setElementData(localPlayer,"givePlayerExp",getElementData(localPlayer,"exprequired")+10)
Level sisteminin kodlarını atsan , yardımcı olıcaklardır.
<meta> <info author="WASSIm." name="Level System" version="2.2.0" type="script" /> <script src="server.luac" type="server" /> <export function="givePlayerExp" type="server" /> <export function="takePlayerExp" type="server" />
<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>
luac uzantı dosyalar açılamaz ve düzenlenemez.
local xpNeed = 100; -- E.g. 100 * lvl = XP you need to rank up!addEvent("onPlayerLevelUp", true);function addPlayerXp(player, xp) local acc = getPlayerAccount(player); local oldexp = getAccountData(acc, "exp") or 0; local oldlvl = getAccountData(acc, "lvl") or 1; local newlevel = oldlvl + 1; local newexp = oldexp + xp; setAccountData(acc, "exp", newexp); setElementData(player, "exp", newexp); if (newexp >= (oldlvl * xpNeed)) then outputChatBox("[Level-Up] Congratulations! New level "..newlevel.."!", player, 66, 134, 244); setAccountData(acc, "lvl", newlevel); setAccountData(acc, "exp", 0); setElementData(player, "exp", 0); setElementData(player, "lvl", newlevel); triggerEvent("onPlayerLevelUp", player, newlevel); endendaddEventHandler("onPlayerLogin", root, function() local acc = getPlayerAccount(source); setElementData(source, "lvl", getAccountData(acc, "lvl") or 0); setElementData(source, "exp", getAccountData(acc, "exp") or 0);end);
local sX, sY = guiGetScreenSize();local lvl = guiCreateLabel(0.5, 0.05, 0.5, 0.5, "LVL: 0 | EXP: 0", true);guiSetFont(lvl, "default-bold-small");local xpNeed = 100; -- E.g. 100 * lvl = XP you need to rank up!addEventHandler("onClientRender", root, function() local thelvl = getElementData(localPlayer, "lvl") or 0; local theexp = getElementData(localPlayer, "exp") or 0; guiSetText(lvl, "LVL: "..tostring(thelvl).." | EXP: "..tostring(((thelvl + 1) * xpNeed) - theexp));end);
Bu konuda mevcut.Linki görebilmek için Kayıt olun yada Giriş yapın.
exports["LevelScriptininAdı"]:addPlayerXp(oyuncudeğişkeni, xp miktarı)
Kod: luaexports["LevelScriptininAdı"]:addPlayerXp(oyuncudeğişkeni, xp miktarı)böyle.