Hey guys, I made an Money System with lua, because i’m planning to make my own, basic gamemode.
But, I got some problems with the HUD, I’ve been puzzling around, but I cant seem to fix the error.
ERROR: GAMEMODE:‘HUDPaint’ Failed: GmodHotel/gamemode/cl_init.lua:55: bad argument #1 to ‘DrawText’ (string expected, got nil)
Here is my HUD script:
function GM:HUDPaint()
self.BaseClass:HUDPaint()
local person = LocalPlayer()
surface.CreateFont("coolvetica",16,400,false,false,"moneh")
surface.SetTextColor( 255, 255, 255, 255 )
surface.SetTextPos( 34, (ScrH()/2)+(ScrH()/4) )
surface.SetFont("moneh")
surface.DrawText( Money )
end
After this I was puzzled… I had to add “tostring(LocalPlayer():GetMoney())”
Can I please, get any help? I appreciate it if you help.
-Staneh
I don’t need to see that file to be able to say that you are using the variable Money when it hasn’t been defined anywhere. So when you pass it to surface.DrawText, it is a nil value. surface.DrawText expects a string to be passed.
Thanks. xD I already thought someone would ninja it, but its no problem, since its just from the first page u get from google when u type in ‘‘Money System Lua’’ xD lol