probably a really dumb problem that can be solved by changing 1 value
7 replies, posted
Basically I'm trying to make a HUD that turns the health bar into an FFT visualizer when I press a button, getting the error "expected = near 'then'" on the first line of code for drawing the health bar. This is probably an ez fix but I don't have much free time on my hands right now so I can't be bothered atm. Any help appreciated
(I know this visualizer is shitty and doesn't work properly, but I'd rather it work and fix it later than not work at all)
(ps. new PTDNTOT megathread?)
if AudioSource = nil then -- [ERROR] lua/test.lua:49: 'then' expected near '='
surface.SetDrawColor(255, 255, 255, 255)
surface.DrawRect(posx + 4, posy, smoothHealth * 2.5, 20)
elseif AudioSource != nil then
for i = 1 , 256 do
surface.SetDrawColor(255,255,255,255)
surface.DrawRect((i * .5) + 4, posy, smoothHealth *2.5, data[i] * amp)
end
end
if AudioSource == nil then
?
Today I learned: don't code on 17 hours of no sleep
also I already designated AudioSource, thank you lol.
Welcome to the club. Been on the same code for 3 days straight. Got onto the homestretch and now I can't even figure out how to get player Frags for a scoreboard lmao
is this a joke
Player/Frags
Ay no shit? Go look at the post before you sarcastically throw your advice in. Lmao theres a reason I've been stuck on it.
Sorry, I thought it was an actual joke. I didn't see your other thread, just that bit. The regular scoreboard uses Player:Frags so i thought it might help
Don't take what I said personally I've just been stuck on it for a while, have had to throw out my own code 3 different times and now that everything is done aside from getting frags... I'm stuck again. But the tutorial showed how to fix it. But it didn't fix it.
Sorry, you need to Log In to post a reply to this thread.