VenomOG Posted September 9, 2018 Share Posted September 9, 2018 Hello so i have an xp system, with levels, and when player reachs a certain leven the dx box comes out of screen, how to fix script : dxDrawLine(790, 73 - 1, 671 - 1, 73 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(671 - 1, 90, 790, 90, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(790, 90, 790, 73 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(671 - 1, 73 - 1, 671 - 1, 90, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(790, 73 - 1, 671 - 1, 73 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(671 - 1, 90, 790, 90, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(790, 90, 790, 73 - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(671, 73, 119, 17, tocolor(123, 112, 120, 160), false) dxDrawRectangle(671, 73,(getElementData(getLocalPlayer(),"kill.level"))*119, 17, tocolor(0, 0, 0, 160), false) dxDrawText("Level : "..(getElementData(getLocalPlayer(),"Level")), 635, 94, 676, 114, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText((getElementData(getLocalPlayer(),"kill.level")).." / 100", 698, 73, 804, 89, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "left", "top", false, false, false, false, false) dxDrawText("XP : ", 635, 74, 676, 94, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "left", "top", false, false, false, false, false) dxDrawRectangle(671, 73,(getElementData(getLocalPlayer(),"kill.level"))*119, 17, tocolor(0, 0, 0, 160), false) is the rectangle that comes out of box Link to comment
#STARK Posted September 9, 2018 Share Posted September 9, 2018 u have to turn the level into percentage then multiply it with the width of the rectangle / 100 Link to comment
VenomOG Posted September 9, 2018 Author Share Posted September 9, 2018 25 minutes ago, #STARK said: u have to turn the level into percentage then multiply it with the width of the rectangle / 100 Example? Link to comment
#STARK Posted September 9, 2018 Share Posted September 9, 2018 (edited) (getElementData(getLocalPlayer(), "kill.level") or 0)*(119/100) -- other example local myExperiance, NeededExperiance = 10, 500 local newWidth = ((myExperiance/NeededExperiance)*100)*(119/100) -- 119 is your rectangle width Edited September 9, 2018 by #STARK Link to comment
VenomOG Posted September 9, 2018 Author Share Posted September 9, 2018 6 minutes ago, #STARK said: (getElementData(getLocalPlayer(), "kill.level") or 0)*(119/100) -- other example local myExperiance, NeededExperiance = 10, 500 local newWidth = ((myExperiance/NeededExperiance)*100)*(119/100) -- 119 is your rectangle width Fixed thanks. 8 minutes ago, #STARK said: (getElementData(getLocalPlayer(), "kill.level") or 0)*(119/100)-- other example local myExperiance, NeededExperiance = 10, 500local newWidth = ((myExperiance/NeededExperiance)*100)*(119/100)-- 119 is your rectangle width If i wanted to make each lvl there will be a diffrent ammount of xp needed to reach how can i do that. 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