#does anyone know how i could disable the players backpack core gui from clicking a button?

15 messages · Page 1 of 1 (latest)

chrome frigate
#

does anyone know how i could disable the players backpack core gui from clicking a button? I can only find how to do it on player added with game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false). But startergui isnt available once you have loaded in

broken nacelle
#

StarterGui does exist when the player loads in

cursive plume
#

save in local script

#

oh waiy

#

just read it

cursive plume
#

maybe its cuz of a error try pcalling it

#
local StarterGui = game:GetService("StarterGui")
local Sucess, Error
repeat
    Sucess, Error = pcall(function()
        StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
    end)
    
    if not Sucess then
        print(Error)
        task.wait(1)
    end
until Sucess
#

oh wait huh

#

it doesnt work when its done in a button

#

i get what u mean now

#

weird

#

ok so I did this

    local StarterGui = game:GetService("StarterGui")
    local function SetBackpackFlase()
        local Sucess, Error
        repeat
            Sucess, Error = pcall(function()
                StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
            end)

            if not Sucess then
                print(Error)
                task.wait(1)
            end
        until Sucess
    end
    SetBackpackFlase()
``` and put it in a button and it does work