Scripting Posted April 17, 2012 Share Posted April 17, 2012 Hi all, I have a bug if i do this: client-side: name1 = guiCreateLabel(50,10,410,20,"test1",true) name2 = guiCreateLabel(50,25,410,20,"test2",true) money1 = guiCreateLabel(300,10,410,20,"20000",true) money2 = guiCreateLabel(300,25,410,20,"17000",true) function show () local playerMoney = getPlayerMoney(getLocalPlayer()) local name = getPlayerName(getLocalPlayer()) if ( playerMoney >= tonumber (guiGetText(money1)) ) then guiSetText(name2,guiGetText(name1)) guiSetText(name1,"The Name: ".. name) guiSetText(money2,guiGetText(money1)) guiSetText(money1,"The Money: ".. PlayerMoney) [This Change] end end addEventHandler("onClientRender", getRootElement(), show) The Code work Correctly 100%; and if I change this Code Argument : guiSetText(money1,"The Money: ".. PlayerMoney) The Code work a bug: The Label(money1,mney2) change text to (playerMoney) and the Label(name1,name2) change text to (name). Pls fix this bug set The Code work Correctly: client-side: name1 = guiCreateLabel(50,10,410,20,"test1",true) name2 = guiCreateLabel(50,25,410,20,"test2",true) money1 = guiCreateLabel(300,10,410,20,"20000",true) money2 = guiCreateLabel(300,25,410,20,"17000",true) function show () local playerMoney = getPlayerMoney(getLocalPlayer()) local name = getPlayerName(getLocalPlayer()) if ( playerMoney >= tonumber (guiGetText(money1)) ) then guiSetText(name2,guiGetText(name1)) guiSetText(name1,"The Name: ".. name) guiSetText(money2,guiGetText(money1)) guiSetText(money1,playerMoney) [This The Change Arguments ] end end addEventHandler("onClientRender", getRootElement(), show) Link to comment
Guest Guest4401 Posted April 17, 2012 Share Posted April 17, 2012 guiSetText(money1, tostring(playerMoney)) Link to comment
Scripting Posted April 17, 2012 Author Share Posted April 17, 2012 Ok 1min i do that! Link to comment
iChang Posted April 17, 2012 Share Posted April 17, 2012 /debugscript 3 Since your labels are all relative, all x,y,width,height floats must be between 0 and 1, representing sizes relative to the parent. 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