Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why when i equip the tool the gui is not visible?

Asked by
MpAlex 16
4 years ago
Edited 4 years ago

when i equip the tool, the gui is not opening

local tool = script.Parent
function echipat()
    local menu = tool.Menu
    local setaribg = menu.SetariBackground
    local csetaribg = setaribg:Clone()
    csetaribg.Parent = game.Players.LocalPlayer.PlayerGui
    if csetaribg.Visible == false then
        csetaribg.Visible = true
        print("open")
    end
end

function dezechipat()
    local csetaribg = game.Player.LocalPlayer:WaitForChild("Menu")
    if csetaribg.Visible == true then
        csetaribg.Visible = false
    end
    print("close")
end

tool.Equipped:Connect(echipat)
tool.Unequipped:Connect(dezechipat)

also, the print is not showing in the console. i'm missing something?

i want the gui to open when i equip the tool and close when i unequip the tool edit: changed the code, same problem

0
Try to put tool equipped in the end of a script GravityGouse99938 75 — 4y
0
Try to put tool equipped in the end of a script GravityGouse99938 75 — 4y
0
i tried and is the same thing MpAlex 16 — 4y
0
Make sure your script is a Local Script. Secondly make sure you manipulate the Player's PlayerGui, not the StarterGui. The problem is that StarterGui replicates EVERYTHING inside to the PlayerGui. So that is where you'll find your Gui. Dovydas1118 1495 — 4y
0
i don't know if i'm doing it right, i'm a begginer, so this is the code MpAlex 16 — 4y

Answer this question