Piorun Posted February 5, 2012 Share Posted February 5, 2012 I have new problem now. I want to move all of my static img which are in table and i want to do it softly, so im using onClientRender. Code: function moveRight() for k,v in ipairs(charImage) do local move = 0 local guiX, guiY = guiGetPosition(charImage[k],false) function moveGUI() move = move + 40 guiSetPosition(charImage[k],guiX + move, screenHeight - 120,false) if move == 160 then guiSetAlpha(charImage[k],0.5) removeEventHandler("onClientRender", getRootElement(), moveGUI) end end addEventHandler("onClientRender", getRootElement(), moveGUI) end end I fact only one img is moving correctly, but other are going far, far away ... How to fix that? Link to comment
Castillo Posted February 5, 2012 Share Posted February 5, 2012 function moveGUI() for k,v in ipairs(charImage) do local move = 0 local guiX, guiY = guiGetPosition(charImage[k],false) move = move + 40 guiSetPosition(charImage[k],guiX + move, screenHeight - 120,false) if move == 160 then guiSetAlpha(charImage[k],0.5) charImage[k] = nil end end end addEventHandler("onClientRender", getRootElement(), moveGUI) I don't know if that's what you wanted, neither if it's going to work correctly. 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