GHOSTKILLER1546 Posted February 29, 2016 Share Posted February 29, 2016 He estado modificando este script pero no funciona, asi que necesito que me digan porque razon no funciona y que necesito hacer, y tambien si necesito otro script. espero que me ayuden, se los agradeceria demasiado. ------------------ TABLES STUFF stat = { 1, 100, 150, 200, 220, 250, 270, 300, 400, 500, 600, 700, 800, 900, 1100, 1300, 1500, 1800, 2000, 2500, 3000, 3500, 4000, 4500, 6000 } -------------------------------------------------------- setElementData(root, "Experiencia", 0) setElementData(root, "Nivel", 0) -------------------------------------------------------- -------------------------------------------------------- -------------------------------------------------------- ----------------TEXT/GUI STUFF-------------------------- local screenSizex, screenSizey = guiGetScreenSize()font2 = guiCreateFont("font.otf",17)font = guiCreateFont("font.otf", 7)ups = guiCreateLabel(0.4*screenSizex-110,0.5*screenSizey-81.9,500,500, "", false) lab = guiCreateLabel(0.9*screenSizex-110,0.9*screenSizey-81.5,300,200, "Experiencia: "..getElementData(localPlayer, "Experiencia").."\n\nNivel: "..getElementData(localPlayer, "Nivel"), false) guiSetFont(lab, font)guiLabelSetColor(lab, 255,0,0)guiSetFont(ups, font2)guiSetVisible(ups, false) -------------------------------------------------------- -------------------------------------------------------- -------------------------------------------------------- function pedStat(attacker) local dat = getElementData(localPlayer, "Experiencia") if getElementData (source, "zombie") == true and attacker == localPlayer then setElementData(localPlayer, "Experiencia", dat+1) guiSetText(lab, "Experiencia: "..getElementData(localPlayer, "Experiencia").."\n\nNivel: "..getElementData(localPlayer, "Nivel")) end if dat == stat[1] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 1) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[2] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 2) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[3] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 3) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[4] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 4) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[5] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 5) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[6] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 6) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[7] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 7) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[8] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", -- s8) --> guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[9] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 9) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[10] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 10) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[11] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 11) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[12] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 12) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[13] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 13) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[14] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 14) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat ==stat[15] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 15) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[16] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 16) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[17] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 17) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[18] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 18) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[19] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 19) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[20] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 20) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[21] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 21) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[22] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 22) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[23] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 23) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[24] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 24) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[25] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 25) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) end end addEventHandler("onClientPedWasted", root, pedStat) -------------------------------------------- ---- For server side stats update ---------- -------------------------------------------- function serverData() guiSetText(lab, "Experiencia: "..getElementData(localPlayer, "Experiencia").."\n\nNivel: "..getElementData(localPlayer, "Nivel")) end addEvent("ZombieServer", true) addEventHandler("ZombieServer", root, serverData) Link to comment
Narutimmy Posted March 3, 2016 Share Posted March 3, 2016 He estado modificando este script pero no funciona, asi que necesito que me digan porque razon no funciona y que necesito hacer, y tambien si necesito otro script. espero que me ayuden, se los agradeceria demasiado. ------------------ TABLES STUFF stat = { 1, 100, 150, 200, 220, 250, 270, 300, 400, 500, 600, 700, 800, 900, 1100, 1300, 1500, 1800, 2000, 2500, 3000, 3500, 4000, 4500, 6000 } -------------------------------------------------------- setElementData(root, "Experiencia", 0) setElementData(root, "Nivel", 0) -------------------------------------------------------- -------------------------------------------------------- -------------------------------------------------------- ----------------TEXT/GUI STUFF-------------------------- local screenSizex, screenSizey = guiGetScreenSize()font2 = guiCreateFont("font.otf",17)font = guiCreateFont("font.otf", 7)ups = guiCreateLabel(0.4*screenSizex-110,0.5*screenSizey-81.9,500,500, "", false) lab = guiCreateLabel(0.9*screenSizex-110,0.9*screenSizey-81.5,300,200, "Experiencia: "..getElementData(localPlayer, "Experiencia").."\n\nNivel: "..getElementData(localPlayer, "Nivel"), false) guiSetFont(lab, font)guiLabelSetColor(lab, 255,0,0)guiSetFont(ups, font2)guiSetVisible(ups, false) -------------------------------------------------------- -------------------------------------------------------- -------------------------------------------------------- function pedStat(attacker) local dat = getElementData(localPlayer, "Experiencia") if getElementData (source, "zombie") == true and attacker == localPlayer then setElementData(localPlayer, "Experiencia", dat+1) guiSetText(lab, "Experiencia: "..getElementData(localPlayer, "Experiencia").."\n\nNivel: "..getElementData(localPlayer, "Nivel")) end if dat == stat[1] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 1) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[2] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 2) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[3] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 3) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[4] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 4) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[5] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 5) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[6] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 6) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[7] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 7) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[8] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", -- s8) --> guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[9] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 9) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[10] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 10) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[11] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 11) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[12] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 12) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[13] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 13) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[14] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 14) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat ==stat[15] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 15) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[16] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 16) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[17] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 17) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[18] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 18) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[19] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 19) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[20] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 20) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[21] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 21) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[22] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 22) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[23] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 23) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[24] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 24) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) elseif dat == stat[25] then local sound = playSound3D("level_up.mp3", x,y,z) guiSetVisible(ups, true) setTimer(guiSetVisible, 5000, 1, ups, false) setElementData(localPlayer, "Nivel", 25) guiSetText(ups, "TU AVANZASTE A NIVEL "..getElementData(localPlayer, "Nivel")) end end addEventHandler("onClientPedWasted", root, pedStat) -------------------------------------------- ---- For server side stats update ---------- -------------------------------------------- function serverData() guiSetText(lab, "Experiencia: "..getElementData(localPlayer, "Experiencia").."\n\nNivel: "..getElementData(localPlayer, "Nivel")) end addEvent("ZombieServer", true) addEventHandler("ZombieServer", root, serverData) Estas usando un evento incorrecto, MTA DayZ usa otro Evento. Link to comment
GHOSTKILLER1546 Posted March 3, 2016 Author Share Posted March 3, 2016 Y cual seria el evento, que no se scriptear mucho Link to comment
Recommended Posts