rebel1324 / NutScript

A free role-play framework for Garry's Mod.
http://nutscript.net
MIT License
65 stars 31 forks source link

Fixed icon markup #366

Closed zoephix closed 3 years ago

Heyter commented 3 years ago

https://wiki.facepunch.com/gmod/table.getn

Heyter commented 3 years ago

table.Count slower than "operator #" "#colour_stack"

TovarischPootis commented 3 years ago

table.Count slower than "operator #" "#colour_stack"

The tables in question are non-sequential ({r = #, g = #, b = #, a = #}). # wouldn’t work, hence table.Count is needed instead

Heyter commented 3 years ago

table.Count slower than "operator #" "#colour_stack"

The tables in question are non-sequential ({r = #, g = #, b = #, a = #}). # wouldn’t work, hence table.Count is needed instead

Is this prank?

local colour_stack = { {r=255,g=255,b=255,a=255} }
table.insert(colour_stack, {r=255,g=255,b=255,a=255})
print(#colour_stack)

Output: 2

TovarischPootis commented 3 years ago

You’re right, I was looking at the wrong thing. # works better here. My bad

TovarischPootis commented 3 years ago

This is fine now, fixes an ancient bug with NS