1
2
3
4
5
6
2
3
4
5
6
function binary_operation(operation_func, operand1, operand2) return operation_func(operand1, operand2) end function add(o1,o2) return o1+o2 end print(binary_operation(add,3,4))
All of them | 29.23% (19) | |
None of them | 40.00% (26) | |
A few of them | 30.77% (20) |
function binary_operation(operation_func, operand1, operand2) return operation_func(operand1, operand2) end function add(o1,o2) return o1+o2 end print(binary_operation(add,3,4))
condition=true addhook("die","Miku_Hatsune") function Miku_Hatsune(id) 	if conditional then 		local x,y=randomentity(player(id,"team")-1) 		parse("spawnplayer "..id.." "..(x*32+16).." "..(y*32+16)) 	end end
function GetCurrentLUAFilename() 	local traceback_string=debug.traceback():gsub("\t",""):sub(18) 	local index=0 	for line in traceback_string:gmatch("[^\n]+") do 		index=index+1 		if index==2 then 			local t=line:find(":") 			return line:sub(1,t-1) 		end 	end end print(GetCurrentLUAFilename()) -- Output "stdin" when you use it at interpreter. If it used on another file, then it output the LUA filename
error("Your string here") -- LUA ERROR: filename.lua:1: Your string here
package.cpath = package.cpath.."./lib/?.dll;../lib/?.dll;../../lib/?.dll;../../../lib/?.dll"
package.cpath = package.cpath.."./lib/?.dll;../lib/?.dll;../../lib/?.dll;../../../lib/?.dll"
package.cpath = package.cpath.."./lib/?.dll;../lib/?.dll;../../lib/?.dll;../../../lib/?.dll"
menu(id,"Test,123,456") -- Later. Delay about 5 seconds menu(id,"")
print(player(id,"weapon")==player(id,"weapontype") and "Same" or "Not Same") -- Same
prepare() do for k,v in pairs(var1) do for k2,v2 in pairs(var2) do if v == v2 then match() return end end no_match() end continue()
local BinaryFormat = package.cpath:match("%p[\\|/]?%p(%a+)") if BinaryFormat == "dll" then 	function os.name() 		return "Windows" 	end elseif BinaryFormat == "so" then 	function os.name() 		return "Linux" 	end elseif BinaryFormat == "dylib" then 	function os.name() 		return "MacOS" 	end end BinaryFormat = nil
nils everywhere? Are you suffering from spats of unfotunate speeling mistekes? Then you'll understand how annoying it is to track down one small typo within your goliath of a codebase. Seriously, that's probably the solution to about 30% of all of the questions that are asked in this forum.
setmetatable( _G, {__index = function (_, key) error("Undefined variable " .. key) end })
function spawnobject(type, x, y, rot, mode, team, player) 	if type and x and y then 		rot, mode, team, player = rot or 0, mode or 0, team or 0, player or 0 		parse("spawnobject "..type.." "..x.." "..y.." "..rot.." "..mode.." "..team.." "..player) 		return objectat(x, y, type) 	end end