PDA

View Full Version : Simple HUD knowledge (Lack there of..)



Odemis
04-14-2016, 06:04 PM
Ok this long break in between working with code has my mind shooting in 50 different (wrong) directions, trying to understand refreshing HUD information.Even on an extremely small/ simple HUD
Example:
local HUDText = HUD.CreateTextDisplay(100, 100, "...." .. Round_Number .."...", 255, 120, 120)while (true) do
wait(1000)
HUDText:SetText("Testing + " .. Round_Number .. " seconds")
HUDText:SetTextColor(math.random(0, 255), math.random(0, 255), math.random(0, 255))
end


Loading this into my script starts a HUD, showing the value of 'Round_Number' .
How can I make the HUD update what the value of 'Round_Number', let's say with a 15 sec interval? (Just a simple refresh module?) Thanks for any advise!

eldera
04-17-2016, 01:47 PM
local Round_Number = 1
local HUDText = HUD.CreateTextDisplay(100, 100, "...." .. Round_Number .."...", 255, 120, 120)
HUDText:SetTextColor(math.random(0, 255), math.random(0, 255), math.random(0, 255))

Module.New("modulessadsa", function()
HUDText:SetText("Testing + " .. Round_Number .. " seconds")
Round_Number = Round_Number + 1
end)
You shouldn't really use white true like that.