News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: Global variable  (Read 942 times)

0 Members and 1 Guest are viewing this topic.

Offline RBS ID

  • Jr. Member
  • **
  • Posts: 67
  • Gender: Male
  • I don't know.
    • View Profile
    • This is website title.
Global variable
« on: February 22, 2022, 07:20:48 AM »
This code is to show all global variables that existed.

Code: [Select]
function main()
    while not SystemIsReady() do
        Wait(0)
    end
    local function FasterScroll(b)
        if IsButtonPressed(7, 0) and IsButtonPressed(b, 0) then
            return true
        end
        return false
    end
    local st = false
    local gv, s = {}, 1
    for k, v in pairs(_G) do
        table.insert(gv, {tostring(k), tostring(v)})
    end
    while true do
        Wait(0)
        if IsButtonBeingPressed(14, 0) then
            st = not st
        end
        if st then
            if IsButtonBeingPressed(0, 0) or FasterScroll(0) then
                s = s - 1
                if s < 1 then
                    s = table.getn(gv)
                end
            elseif IsButtonBeingPressed(1, 0) or FasterScroll(1) then
                s = s + 1
                if s > table.getn(gv) then
                    s = 1
                end
            end
            TextPrintString("Key: " .. gv[s][1] .. "\n\nValue: " .. gv[s][2] .. "\n\n(" .. s .. ")", 1, 1)
        end
    end
end

Offline RBS ID

  • Jr. Member
  • **
  • Posts: 67
  • Gender: Male
  • I don't know.
    • View Profile
    • This is website title.
Re: Global variable
« Reply #1 on: February 22, 2022, 07:47:04 AM »
PlayerGetUsingTouchScreen()

Checks if player playing the game with touchscreen or with gamepad/joystick.

Function: PlayerGetUsingTouchScreen()
Arguments: none
Returns: boolean
« Last Edit: February 24, 2022, 12:09:40 AM by RanggaBS »