1LoL1 Posted July 12, 2015 Share Posted July 12, 2015 Hello, how i can delete color hex? please anyone help me. statsLabel["name"] = guiCreateLabel(0,0.85,1,0.15,"Name: "..getPlayerName(getLocalPlayer()), true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["name"],"center") guiSetFont (statsLabel["name"], "default-bold-small" ) setElementData(statsLabel["name"],"identifikation","name") and guiSetText(statsLabel["name"],"Name: "..getPlayerName(getLocalPlayer())) i used this: :gsub("#%x%x%x%x%x%x","") and sting.gsub but i dont know how to use. Link to comment
GTX Posted July 12, 2015 Share Posted July 12, 2015 getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x", "") Link to comment
1LoL1 Posted July 12, 2015 Author Share Posted July 12, 2015 getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x", "") Not work ERROR: DayZ\survivorSystem-client.lua:520: attempt to index a boolean value Link to comment
GTX Posted July 12, 2015 Share Posted July 12, 2015 What's at that line? Show full code. Link to comment
1LoL1 Posted July 12, 2015 Author Share Posted July 12, 2015 What's at that line? Show full code. statsLabel = {} statsWindows = guiCreateStaticImage(0.775,0.2,0.225,0.22,"images/scrollmenu_1.png",true) --statsWindows = guiCreateWindow(0.775,0.2,0.225,0.22,"DEBUG MONITOR",true) guiSetAlpha(statsWindows,0.-- s8) --> --Zombies Killed statsLabel["zombieskilled"] = guiCreateLabel(0,0.05,1,0.15,"Zombies killed: 0",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["zombieskilled"],"center") guiSetFont (statsLabel["zombieskilled"], "default-bold-small" ) setElementData(statsLabel["zombieskilled"],"identifikation","zombieskilled") --Headshots 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") --Murders statsLabel["murders"] = guiCreateLabel(0,0.25,1,0.15,"Murders: 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,"Bandits killed: 0",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["banditskilled"],"center") guiSetFont (statsLabel["banditskilled"], "default-bold-small" ) setElementData(statsLabel["banditskilled"],"identifikation","banditskilled") --Blood statsLabel["blood"] = guiCreateLabel(0,0.45,1,0.15,"Blood: 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 (Alive/Total): 0/0",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["zombies"],"center") guiSetFont (statsLabel["zombies"], "default-bold-small" ) setElementData(statsLabel["zombies"],"identifikation","zombies") --Temperature statsLabel["temperature"] = guiCreateLabel(0,0.65,1,0.15,"Temperature: 37°C",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["temperature"],"center") guiSetFont (statsLabel["temperature"], "default-bold-small" ) setElementData(statsLabel["temperature"],"identifikation","temperature") --Humanity statsLabel["humanity"] = guiCreateLabel(0,0.75,1,0.15,"Humanity: 2500",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["humanity"],"center") guiSetFont (statsLabel["humanity"], "default-bold-small" ) setElementData(statsLabel["humanity"],"identifikation","humanity") --Name statsLabel["name"] = guiCreateLabel(0,0.85,1,0.15,"Name: "..getPlayerName(getLocalPlayer())), true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["name"],"center") guiSetFont (statsLabel["name"], "default-bold-small" ) setElementData(statsLabel["name"],"identifikation","name") function showDebugMonitor () local visible = guiGetVisible(statsWindows) guiSetVisible(statsWindows,not visible) end bindKey("F5","down",showDebugMonitor) function refreshDebugMonitor() if getElementData(getLocalPlayer(),"logedin") then local value = getElementData(getLocalPlayer(),getElementData(statsLabel["zombieskilled"],"identifikation")) guiSetText(statsLabel["zombieskilled"],"Zombies killed: "..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"],"Bandits killed: "..value) local value = getElementData(getLocalPlayer(),getElementData(statsLabel["murders"],"identifikation")) guiSetText(statsLabel["murders"],"Murders: "..value) local value = getElementData(getLocalPlayer(),getElementData(statsLabel["blood"],"identifikation")) guiSetText(statsLabel["blood"],"Blood: "..value) local value = getElementData(getRootElement(),"zombiesalive") or 0 local value2 = getElementData(getRootElement(),"zombiestotal") or 0 guiSetText(statsLabel["zombies"],"Zombies (Alive/Total): "..value.."/"..value2) local value = getElementData(getLocalPlayer(),getElementData(statsLabel["temperature"],"identifikation")) guiSetText(statsLabel["temperature"],"Temperature: "..math.round(value,2).."°C") local value = getElementData(getLocalPlayer(),getElementData(statsLabel["humanity"],"identifikation")) guiSetText(statsLabel["humanity"],"Humanity: "..math.round(value,2)) guiSetText(statsLabel["name"],"Name: "..getPlayerName(getLocalPlayer())):gsub("#%x%x%x%x%x%x", "") end end Link to comment
GTX Posted July 12, 2015 Share Posted July 12, 2015 guiSetText(statsLabel["name"],"Name: "..getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x", "")) statsLabel["name"] = guiCreateLabel(0,0.85,1,0.15,"Name: "..getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x", ""), true,statsWindows) Link to comment
1LoL1 Posted July 12, 2015 Author Share Posted July 12, 2015 guiSetText(statsLabel["name"],"Name: "..getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x", "")) statsLabel["name"] = guiCreateLabel(0,0.85,1,0.15,"Name: "..getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x", ""), true,statsWindows) Not work i see hex Link to comment
GTX Posted July 12, 2015 Share Posted July 12, 2015 It must work. You didn't restart resource. Link to comment
1LoL1 Posted July 12, 2015 Author Share Posted July 12, 2015 It must work. You didn't restart resource. i restarted resource.. Link to comment
GTX Posted July 12, 2015 Share Posted July 12, 2015 Then your hex is wrong. What's your hex? Link to comment
1LoL1 Posted July 12, 2015 Author Share Posted July 12, 2015 Then your hex is wrong. What's your hex? My hex: FFFF00 And i see Name: #FFFF00test And i want: test Link to comment
GTX Posted July 12, 2015 Share Posted July 12, 2015 http://prntscr.com/7rvu86 It does work. You must have done something wrong. Link to comment
1LoL1 Posted July 12, 2015 Author Share Posted July 12, 2015 http://prntscr.com/7rvu86It does work. You must have done something wrong. What? where i this must use? Link to comment
GTX Posted July 12, 2015 Share Posted July 12, 2015 statsLabel = {} statsWindows = guiCreateStaticImage(0.775,0.2,0.225,0.22,"images/scrollmenu_1.png",true) --statsWindows = guiCreateWindow(0.775,0.2,0.225,0.22,"DEBUG MONITOR",true) guiSetAlpha( statsWindows,0.8 ) --Zombies Killed statsLabel["zombieskilled"] = guiCreateLabel(0,0.05,1,0.15,"Zombies killed: 0",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["zombieskilled"],"center") guiSetFont (statsLabel["zombieskilled"], "default-bold-small" ) setElementData(statsLabel["zombieskilled"],"identifikation","zombieskilled") --Headshots 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") --Murders statsLabel["murders"] = guiCreateLabel(0,0.25,1,0.15,"Murders: 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,"Bandits killed: 0",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["banditskilled"],"center") guiSetFont (statsLabel["banditskilled"], "default-bold-small" ) setElementData(statsLabel["banditskilled"],"identifikation","banditskilled") --Blood statsLabel["blood"] = guiCreateLabel(0,0.45,1,0.15,"Blood: 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 (Alive/Total): 0/0",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["zombies"],"center") guiSetFont (statsLabel["zombies"], "default-bold-small" ) setElementData(statsLabel["zombies"],"identifikation","zombies") --Temperature statsLabel["temperature"] = guiCreateLabel(0,0.65,1,0.15,"Temperature: 37°C",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["temperature"],"center") guiSetFont (statsLabel["temperature"], "default-bold-small" ) setElementData(statsLabel["temperature"],"identifikation","temperature") --Humanity statsLabel["humanity"] = guiCreateLabel(0,0.75,1,0.15,"Humanity: 2500",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["humanity"],"center") guiSetFont (statsLabel["humanity"], "default-bold-small" ) setElementData(statsLabel["humanity"],"identifikation","humanity") --Name statsLabel["name"] = guiCreateLabel(0,0.85,1,0.15,"Name: "..getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x", ""), true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["name"],"center") guiSetFont (statsLabel["name"], "default-bold-small" ) setElementData(statsLabel["name"],"identifikation","name") function showDebugMonitor () local visible = guiGetVisible(statsWindows) guiSetVisible(statsWindows,not visible) end bindKey("F5","down",showDebugMonitor) function refreshDebugMonitor() if getElementData(getLocalPlayer(),"logedin") then local value = getElementData(getLocalPlayer(),getElementData(statsLabel["zombieskilled"],"identifikation")) guiSetText(statsLabel["zombieskilled"],"Zombies killed: "..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"],"Bandits killed: "..value) local value = getElementData(getLocalPlayer(),getElementData(statsLabel["murders"],"identifikation")) guiSetText(statsLabel["murders"],"Murders: "..value) local value = getElementData(getLocalPlayer(),getElementData(statsLabel["blood"],"identifikation")) guiSetText(statsLabel["blood"],"Blood: "..value) local value = getElementData(getRootElement(),"zombiesalive") or 0 local value2 = getElementData(getRootElement(),"zombiestotal") or 0 guiSetText(statsLabel["zombies"],"Zombies (Alive/Total): "..value.."/"..value2) local value = getElementData(getLocalPlayer(),getElementData(statsLabel["temperature"],"identifikation")) guiSetText(statsLabel["temperature"],"Temperature: "..math.round(value,2).."°C") local value = getElementData(getLocalPlayer(),getElementData(statsLabel["humanity"],"identifikation")) guiSetText(statsLabel["humanity"],"Humanity: "..math.round(value,2)) guiSetText(statsLabel["name"],"Name: "..getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x", "")) end end Link to comment
1LoL1 Posted July 12, 2015 Author Share Posted July 12, 2015 statsLabel = {} statsWindows = guiCreateStaticImage(0.775,0.2,0.225,0.22,"images/scrollmenu_1.png",true) --statsWindows = guiCreateWindow(0.775,0.2,0.225,0.22,"DEBUG MONITOR",true) guiSetAlpha( statsWindows,0.8 ) --Zombies Killed statsLabel["zombieskilled"] = guiCreateLabel(0,0.05,1,0.15,"Zombies killed: 0",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["zombieskilled"],"center") guiSetFont (statsLabel["zombieskilled"], "default-bold-small" ) setElementData(statsLabel["zombieskilled"],"identifikation","zombieskilled") --Headshots 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") --Murders statsLabel["murders"] = guiCreateLabel(0,0.25,1,0.15,"Murders: 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,"Bandits killed: 0",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["banditskilled"],"center") guiSetFont (statsLabel["banditskilled"], "default-bold-small" ) setElementData(statsLabel["banditskilled"],"identifikation","banditskilled") --Blood statsLabel["blood"] = guiCreateLabel(0,0.45,1,0.15,"Blood: 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 (Alive/Total): 0/0",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["zombies"],"center") guiSetFont (statsLabel["zombies"], "default-bold-small" ) setElementData(statsLabel["zombies"],"identifikation","zombies") --Temperature statsLabel["temperature"] = guiCreateLabel(0,0.65,1,0.15,"Temperature: 37°C",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["temperature"],"center") guiSetFont (statsLabel["temperature"], "default-bold-small" ) setElementData(statsLabel["temperature"],"identifikation","temperature") --Humanity statsLabel["humanity"] = guiCreateLabel(0,0.75,1,0.15,"Humanity: 2500",true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["humanity"],"center") guiSetFont (statsLabel["humanity"], "default-bold-small" ) setElementData(statsLabel["humanity"],"identifikation","humanity") --Name statsLabel["name"] = guiCreateLabel(0,0.85,1,0.15,"Name: "..getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x", ""), true,statsWindows) guiLabelSetHorizontalAlign (statsLabel["name"],"center") guiSetFont (statsLabel["name"], "default-bold-small" ) setElementData(statsLabel["name"],"identifikation","name") function showDebugMonitor () local visible = guiGetVisible(statsWindows) guiSetVisible(statsWindows,not visible) end bindKey("F5","down",showDebugMonitor) function refreshDebugMonitor() if getElementData(getLocalPlayer(),"logedin") then local value = getElementData(getLocalPlayer(),getElementData(statsLabel["zombieskilled"],"identifikation")) guiSetText(statsLabel["zombieskilled"],"Zombies killed: "..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"],"Bandits killed: "..value) local value = getElementData(getLocalPlayer(),getElementData(statsLabel["murders"],"identifikation")) guiSetText(statsLabel["murders"],"Murders: "..value) local value = getElementData(getLocalPlayer(),getElementData(statsLabel["blood"],"identifikation")) guiSetText(statsLabel["blood"],"Blood: "..value) local value = getElementData(getRootElement(),"zombiesalive") or 0 local value2 = getElementData(getRootElement(),"zombiestotal") or 0 guiSetText(statsLabel["zombies"],"Zombies (Alive/Total): "..value.."/"..value2) local value = getElementData(getLocalPlayer(),getElementData(statsLabel["temperature"],"identifikation")) guiSetText(statsLabel["temperature"],"Temperature: "..math.round(value,2).."°C") local value = getElementData(getLocalPlayer(),getElementData(statsLabel["humanity"],"identifikation")) guiSetText(statsLabel["humanity"],"Humanity: "..math.round(value,2)) guiSetText(statsLabel["name"],"Name: "..getPlayerName(getLocalPlayer()):gsub("#%x%x%x%x%x%x", "")) end end Not Work Link to comment
GTX Posted July 12, 2015 Share Posted July 12, 2015 Then you didn't give me full script. It should work. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now