Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Creating habits v3, Lua
--[[ Creating habits v3 Lua ]]-- local array1 = {"tset1", "26", "jsdfl"} -- Creates an array of strings -- local function test(x) if x ~= nil then -- Checks if x isn't nil -- table.insert(array1, tostring(x)) -- If x isn't nil, insert a string -- end local str = ""; -- Creates an empty string -- for _,v in pairs (array1) do -- Goes thorugh array1 and inserts them into "str" -- str = str.. " "..tostring(v) -- Inserts "v" (What's in the array) into "str" -- end if x ~= nil then table.remove(array1, #array1) -- Removes the inserted string (if there was one) -- end return str -- Returns the completed "str" -- end print(test(56)) -- Runs and prints the function -- 56 gets inserted into the array, then gets removed -- print("\n".. test()) -- Creates a new line and runs the function again w/o inserting something into the table --
run
|
edit
|
history
|
help
0
855
Reverse strings function - Lua
l
PAID HACK PuBG
Kegs Scores ... FOOOOOOTBALLLLLL
Goalless DRAWS
Percentage Calculator (Subscribe to Madflag19)
Security keygen
Root
PAID HACK PuBG