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

5 comments

0

Try to put tool equipped in the end of a script

0

Try to put tool equipped in the end of a script

0

i tried and is the same thing

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.

0

i don't know if i'm doing it right, i'm a begginer, so this is the code