HelpHelp a scrub like me with simple lua?

Posts 1–5 of 5 · Page 1 of 1
Help a scrub like me with simple lua?
I need to be able to take a value and constantly add to it. What I'm trying to make is a cinema auto downvoter for all videos up but when another video is posted, it's id goes up by one and I can't skip it if I can't have my script adjust to it. Example;

RunConsoleCommand("cinema_votedown", "1")
RunConsoleCommand("cinema_votedown", "2")
RunConsoleCommand("cinema_votedown", "3")
RunConsoleCommand("cinema_votedown", "4")
RunConsoleCommand("cinema_votedown", "5")

That would downvote the first 5 videos since the client connects to the server but it breaks after 5 and I'm too lazy to add hundreds of RCCs...
Use a loop, lmao.
for i = 1,putmaxcinemaqueueshere do
RunConsoleCommand("cinema_votedown",tostring(i))
end
Code:
local _amt = 20
local amt = #_amt

local orcc = RunConsoleCommand

local tab = { [1] = "cinema_votedown" }

for i = 1, amt do
    orcc( tab[1], i )
end
or do it like a normal human being

Code:
for i = 1, 20 do
    RunConsoleCommand( "cinema_votedown", i )
end
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us