Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function convertBool(...)
- local sConverted = ""
- for i, v in ipairs(arg) do
- if type(v) ~= "boolean" then
- error("convertBool: All arguments must be boolean!")
- end
- sConverted = sConverted .. (v and "1" or "0")
- end
- return sConverted
- end
- local table = {}
- table["1010"] = "Hello, world!"
- local a, b, c, d = true, false, true, false
- local converted = convertBool(a, b, c, d)
- print(converted)
- print(table[converted])
Advertisement
Add Comment
Please, Sign In to add comment