1
Mod Releases / Re: Selector Mod
« on: July 22, 2023, 12:54:02 PM »
If you have DSL installed, change the allow system access value to "true" (without the double quotes) in the DSL configuration file. Also change the value below it.
News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..
Messages | Topics | Attachments
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
T_BUTTON = function()
repeat
Wait(0)
until SystemIsReady()
_G.gButton = {}
for i = 0, 15 do
gButton[i] = {beingPressed = false, pressed = false, beingReleased = false}
end
while true do
Wait(0)
for i = 0, 15 do
if GetStickValue(i, 0) == 1 then
gButton[i].beingPressed = true
Wait(1)
gButton[i].beingPressed = false
while GetStickValue(i, 0) == 1 do
Wait(0)
gButton[i].pressed = true
end
gButton[i].beingReleased, gButton[i].pressed = true, false
Wait(1)
gButton[i].beingReleased = false
end
end
end
gButton_Thread = CreateThread("T_BUTTON")
-- Usage & example:
if gButton[6].pressed then
MinigameSetAnnouncement(tostring(GetTimer()) .. "\n", true)
end
a={'i', 'o', 'a', 'e', 'u'}
table.sort(a)
for _, v in ipairs(a) do
print(v)
end
G = {}
for k, v in pairs(_G) do
G[#G+1] = {tostring(k), tostring(v)} -- #G is basically just a new syntax of table.getn(G), this # operator doesn't available in Bully's Lua v5.0.2
end
table.sort(G, function(a, b)
return a[1] < b[1]
end)
for _, v in ipairs(G) do
print("Key: " .. v[1] .. "\nValue: " .. v[2] .. "\n")
end