Bully-Board

Bully Modding Section => Bully Modding => Topic started by: RBS ID on February 22, 2022, 07:20:48 AM

Title: Global variable
Post by: RBS ID 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
Title: Re: Global variable
Post by: RBS ID 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