• help with hud
    6 replies, posted
not sure im i am saying it right i am trying to get the variable from the player this is how i have it [lua] function hud() local flashlight= LocalPlayer().power draw.SimpleText("flashlight", "TextBar", 20, ScrH() -55, Color(255,255,255,255)) draw.SimpleText("%"..flashlight, "Text", 25, ScrH() -35, Color(255,255,255,255)) end hook.Add("HUDPaint", "hudhud", hud) [/lua] but I keep getting an error when it loads [ERROR] RunString:8: attempt to concatenate local 'flashlight' (a nil value) 1. v - RunString:8 2. unknown - lua/includes/modules/hook.lua:82 any help please
LocalPlayer().power is a nil value... Also, make your function local.
[QUOTE=ms333;39166113]LocalPlayer().power is a nil value... Also, make your function local.[/QUOTE] then how do i find the players .power variable . i was able to print it in my console with an entity using [lua] function ENT:Touch( hitEnt ) if Player then print(hitEnt.power) end end [/lua]
[QUOTE=gravelhunter;39166130]then how do i find the players .power variable . i was able to print it in my console with an entity using [lua] function ENT:Touch( hitEnt ) if Player then print(hitEnt.power) end end [/lua][/QUOTE] How did you define the power variable? (Code)
[QUOTE=ms333;39166205]How did you define the power variable? (Code)[/QUOTE] with a flashlight script a friend made for me [editline]10th January 2013[/editline] see it spams the value i want to use on the hud [URL=http://minus.com/lkJByawpsHNsz][IMG]http://i.minus.com/jkJByawpsHNsz.png[/IMG][/URL]
Post your code...
i got it working now thanks helping
Sorry, you need to Log In to post a reply to this thread.