Jump to content

Dx Box Problem.


VenomOG

Recommended Posts

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
(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 by #STARK
Link to comment
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...