#does anyone know how i could disable the players backpack core gui from clicking a button?
15 messages · Page 1 of 1 (latest)
:SetCoreGuiEnabled() should do the job
StarterGui does exist when the player loads in
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
save in local script
oh waiy
just read it
it does exist when you load in
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