[Script] Tutorial Infección por Comida DayZ

Infección por Comida DayZ

Este script adiciona infección por comer comida cruda, siguiendo las instrucciones es fácil adicionarlo a tu DayZ

latest stress test 41)I noticed the "bacteria" icon going up when ...

Código:

Abrir inventory.lua Buscar: {"Kit Medico",1,"Usar"}, Insertar abajo: {"Antídoto",1,"Usar"}, Buscar: elseif itemName == "Vendaje" then inserte a continuación: elseif itemName == "Antídoto" then changePlayerSickness ( gameplayVariables["antidotsick"] ) setElementData(localPlayer,itemName,getElementData(localPlayer,itemName)-1) triggerServerEvent("onPlayerUseMedicObject",getLocalPlayer(),itemName) playSound("sounds/medic.mp3") Abrir login.lua buscar: {"Kit Medico"}, Insertar Abajo: {"Antídoto"}, buscar: {"pain"}, Insertar Abajo: {"sick"}, Открываем spawn.lua buscar: {"Kit Medico"}, Insertar Abajo: {"Antídoto"}, buscar: {"pain"}, Insertar Abajo: {"sick"}, Abrir survivorSystem_Client.lua Buscar: function math.round(number, decimals, method) Remplazar: setTimer(refreshDebugMonitor,2000,0) Por esto: function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end statsLabel = {} statsWindows = guiCreateStaticImage(0.775,0.2,0.225,0.22,"images/scrollmenu_1.png",true) guiSetAlpha(statsWindows,0.8) --Zombies Asesinados statsLabel["zombieskilled"] = guiCreateLabel(0,0.05,1,0.15,"Zombies Asesinados: 0",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["zombieskilled"],"center") guiSetFont (statsLabel["zombieskilled"], "default-bold-small" ) setElementData(statsLabel["zombieskilled"],"identifikation","zombieskilled") --Tiros a la cabeza statsLabel["headshots"] = guiCreateLabel(0,0.15,1,0.15,"Headshots: 0",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["headshots"],"center") guiSetFont (statsLabel["headshots"], "default-bold-small" ) setElementData(statsLabel["headshots"],"identifikation","headshots") --Asesinatos statsLabel["murders"] = guiCreateLabel(0,0.25,1,0.15,"Asesinatos: 0",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["murders"],"center") guiSetFont (statsLabel["murders"], "default-bold-small" ) setElementData(statsLabel["murders"],"identifikation","murders") --Bandits Killed statsLabel["banditskilled"] = guiCreateLabel(0,0.35,1,0.15,"Bandidos Asesinados: 0",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["banditskilled"],"center") guiSetFont (statsLabel["banditskilled"], "default-bold-small" ) setElementData(statsLabel["banditskilled"],"identifikation","banditskilled") --Sangre statsLabel["blood"] = guiCreateLabel(0,0.45,1,0.15,"Sangre: 12000",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["blood"],"center") guiSetFont (statsLabel["blood"], "default-bold-small" ) setElementData(statsLabel["blood"],"identifikation","blood") --Zombies statsLabel["zombies"] = guiCreateLabel(0,0.55,1,0.15,"Zombies (Activo / Total): 0/0",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["zombies"],"center") guiSetFont (statsLabel["zombies"], "default-bold-small" ) setElementData(statsLabel["zombies"],"identifikation","zombies") --Temperatura statsLabel["temperature"] = guiCreateLabel(0,0.65,1,0.15,"Temperatura: 37°C",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["temperature"],"center") guiSetFont (statsLabel["temperature"], "default-bold-small" ) setElementData(statsLabel["temperature"],"identifikation","temperature") --Humanidad statsLabel["humanity"] = guiCreateLabel(0,0.74,1,0.15,"Humanidad: 2500",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["humanity"],"center") guiSetFont (statsLabel["humanity"], "default-bold-small" ) setElementData(statsLabel["humanity"],"identifikation","humanity") --Infección statsLabel["sickness"] = guiCreateLabel(0,0.82,1,0.15,"Infección: 0",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["sickness"],"center") guiSetFont (statsLabel["sickness"], "default-bold-small" ) setElementData(statsLabel["sickness"],"identifikation","sick") --Nickname statsLabel["name"] = guiCreateLabel(0,0.90,1,0.15,"Nickname: "..getPlayerName(getLocalPlayer()),true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["name"],"center") guiSetFont (statsLabel["name"], "default-bold-small" ) setElementData(statsLabel["name"],"identifikation","name") if getElementData(localPlayer,"logedin") then guiSetVisible(statsWindows,true) else guiSetVisible(statsWindows,false) end function showDebugMonitor () local visible = guiGetVisible(statsWindows) guiSetVisible(statsWindows,not visible) end bindKey("F5","down",showDebugMonitor) function showDebugMintorOnLogin () guiSetVisible(statsWindows,true) end addEvent("onClientPlayerDayZLogin", true) addEventHandler("onClientPlayerDayZLogin", root, showDebugMintorOnLogin) function refreshDebugMonitor() if getElementData(getLocalPlayer(),"logedin") then local value = getElementData(getLocalPlayer(),getElementData(statsLabel["zombieskilled"],"identifikation")) guiSetText(statsLabel["zombieskilled"],"Zombies Asesinados: "..value) local value = getElementData(getLocalPlayer(),getElementData(statsLabel["headshots"],"identifikation")) guiSetText(statsLabel["headshots"],"Headshots: "..value) local value = getElementData(getLocalPlayer(),getElementData(statsLabel["banditskilled"],"identifikation")) guiSetText(statsLabel["banditskilled"],"Bandidos Asesinados: "..value) local value = getElementData(getLocalPlayer(),getElementData(statsLabel["murders"],"identifikation")) guiSetText(statsLabel["murders"],"Asesinatos: "..value) local value = getElementData(getLocalPlayer(),getElementData(statsLabel["blood"],"identifikation")) guiSetText(statsLabel["blood"],"Sangre: "..value) local value = getElementData(getRootElement(),"zombiesalive") or 0 local value2 = getElementData(getRootElement(),"zombiestotal") or 0 guiSetText(statsLabel["zombies"],"Zombies (Activo / Total): "..value.."/"..value2) local value = getElementData(getLocalPlayer(),getElementData(statsLabel["temperature"],"identifikation")) guiSetText(statsLabel["temperature"],"Temperatura: "..math.round(value,2).."°C") local value = getElementData(getLocalPlayer(),getElementData(statsLabel["humanity"],"identifikation")) guiSetText(statsLabel["humanity"],"Humanidad: "..math.round(value,2)) local value = getElementData(getLocalPlayer(),"sick") guiSetText(statsLabel["sickness"],"Infección: "..math.round(value,2)) guiSetText(statsLabel["name"],"Nickname: "..getPlayerName(getLocalPlayer())) end end Buscar: bindKey("z", "down", "chatbox", "radiochat" ) Insertar Abajo: function checkPlayerSickness () local playersick = getElementData ( localPlayer, "sick" ) or 0 if playersick > 0 then setElementData ( localPlayer, "blood", getElementData ( localPlayer, "blood") - math.floor(playersick/10)) changePlayerSickness ( gameplayVariables["sickperminute"] ) end times = times+1 if times > gameplayVariables["addsicktime"] and playersick > 0 then changePlayerSickness ( gameplayVariables["sickperminute"] ) times = 0 end end setTimer ( checkPlayerSickness, 3600000000, 0 ) function changePlayerSickness ( value ) setElementData ( localPlayer, "sick", ( getElementData ( localPlayer, "sick") or 0 ) + value ) if getElementData ( localPlayer, "sick" ) < 0 then setElementData ( localPlayer, "sick", 0 ) end end Abrir: survivorSystem.lua Buscar: elseif itemName == "Kit Medico" then addPlayerStats (playersource,"blood",7000) setElementData(playersource,"bleeding",0) setElementData(playersource,itemName,getElementData(playersource,itemName)-1) Insertar Abajo: elseif itemName == "Antídoto" then addPlayerStats (playersource,"blood",100) setElementData(playersource,"sick",0) setElementData(playersource,itemName,getElementData(playersource,itemName)-1) Buscar: if data == "food" then Insertar Abajo: if sickFood [itemName] then setElementData ( source, "sick", (getElementData ( source, "sick") or 0 ) + sickFood [itemName]) if getElementData ( source, "sick") < 0 then setElementData ( source, "sick", 0 ) end end Abrir editor_server.lua buscar: gameplayVariables["itemrespawntimer"] Insertar Abajo: sickFood = { -- una lista de alimentos que agrega infección; ["nombre"] = número de infecciones, ["Carne Cruda"] = 40, ["Pizza"] = 15, }

0 Comentarios