Categories > Coding > Lua >
[RELEASE] Lua Switch Case
Posted
I was testing some stuff on Lua, It's not fun but it's kind of entertaining lmao. Don't ask me why I'm still alive. I'm just sharing what I learned from Lua.
-- # Begin Switch Case # --
function switch(E)
return function (L)
for _, V in pairs(L) do
if V[1] == E then
V[2]()
elseif V[1] == "default" then
V[2]()
end
end
end
end
function case(E)
return function(V)
return { E, V[1] }
end
end
function default(V)
return { "default", V[1] }
end
-- # End Switch Case # --
script.Parent.MouseButton1Click:Connect(function()
switch(3) {
case(1) {
function() print(1) end
},
case(2) {
function() print(2) end
},
default {
function() print(3) end
}
}
end)
Replied
https://cdn.discordapp.com/attachments/835886949683298317/857149648677240872/SwitchCases.jpg
switch cases poooooooooooo but ok
Cancel
Post
https://media.discordapp.net/attachments/1010636204225601659/1012865624797610044/sKQybOLT.gif
Replied
Wait I thought u wrote ur last thread :Thinks:
Cancel
Post
im bipolar btw
Replied
You said farewell and now your posting threads again :think:
Cancel
Post
Know c# and trying to expand my knowledge in it.
Rep Goal [1,2,3,4,5,6,7,8,9,10]
Rickrolled Talan2016 : https://cdn.discordapp.com/attachments/852018376368979974/852033650593497128/unknown.png
Replied
please don't
Cancel
Post
Replied
oh my god yes this is EPIC.
Cancel
Post
Just your casual femboy, I know a bit of C++ and Lua.
Thank you ImmuneLion318, Peyton_ and Helios for the rep! <3
"clearly you don't like being raped cause you always consent" - DeepPain
Replied
is it faster then an if statement or is just for concept
Cancel
Post
Don't buy exploits its not worth it your gonna quit anyway
Taking accountability will help you excel in life
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post