I can't seem to figure out how to make a proper if statement on the client
2 replies, posted
I've made a simple points counter (you get points for every kill) and I can't seem to figure out how to make an if statement clientside. could you help me figure this out?
[lua]function pointscounter()
if Player:Team() == 2 then
draw.WordBox( 8, ScrW() - 920, ScrH() - 98, "Points: "..LocalPlayer():GetNWInt("pointscounter"),"ScoreboardText",Color(200,0,0,0),Color(255,255,255,255))
end
end
hook.Add("HUDPaint","PointsCounter",pointscounter)[/lua]
I'm just gonna take a gander and say that on line 2, there is no "Player" object. You probably want to use LocalPlayer() instead.
thanks, it worked.
Sorry, you need to Log In to post a reply to this thread.