Am i doing something wrong

hello, im wondering if im doing something wrong?
this is my script btw

while wait() do
	local attacks = {
		npcmodule.kick(),
		npcmodule.brawl()
	}
	local rng = math.random(1,#attacks)
	local attack = attacks[rng]
	
	attack()
end

when i run it, it does fine for the 2 times and then it just dies (it just said “Interval is empty” and then stops working, i assume the funcs just disappear idk im new.) . is there a way to fix / find a better way?

3 Likes
while wait() do
	local attacks = {
		npcmodule.kick,
		npcmodule.brawl
	}
	local rng = math.random(1,#attacks)
	local attack = attacks[rng]
	
	attack()
end

no need to run these functions in attacks table

2 Likes

You’re calling the function instead of referencing them

print(bit32.band) --> function: 0x0000
print(bit32.band()) --> ERR: Expected 2 parameters
3 Likes

remove the () in the npcmodule functions

1 Like

oh yeah, that makes sense i suppose this is the answer im looking for.

thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.