Tools destroyed when frame visible

Hello developers!

How would I make if the visible property of the frame is set to visible == true then the tools change their parent or disappear from the player’s backpack, but if the property is set to visible == false then the tools are returning back in the player’s backpack?

You forgot to say:

What’s the issue?

and

What solutions have you tried so far?

I’ve tried to make one few weeks ago and it didn’t work and I lost the source

if game.Starter["Your Screen Gui Name Here"]["Your Frame Name Here"].Visible == true then
 local Clones = game.StarterPack["Your Tool Name"]
 Clones:Clone().Parent = game.ReplicatedStorage
 Clones:Destroy()
end

@EliottENAnnoucement stop trolling.

@netheround

You can use :GetPropertyChangedSignal() to check the visibility of the Frame and :SetCoreGuiEnabled to enable/disable the backpack:

Frame:GetPropertyChangedSignal("Visible"):Connect(function()
 if Frame.Visible == false then
game:GetService("StarterGui"):SetCoreGuiEnabled("Backpack", false)
game.Players.LocalPlayer.Character:WaitForChild("Humanoid"):UnequipTools()
else
game:GetService("StarterGui"):SetCoreGuiEnabled("Backpack", true)
end
end)

On top of that you can add :UnequipTools to the humanoid to make them unequip everything.

1 Like

My tools are in ServerStorage > ToolsFolder > and the tools, plus theres multiple tools

This works thank you so much for the help!

1 Like

How am I trolling?? When you create a topic in Scripting Support, it is write:

You can write your topic however you want, but you need to answer these questions:

And here there are the questions I said previously.

His question was clear enough to be answered and they were already answering most of those recommended questions, just with a different format. You’re focusing on the wrong thing.

Besides, it is evident through a look at your profile that you’re only grinding for a post count while not contributing to anything, essentially trolling:

Well in your screenshot, he ask to know if it is possible, so I say that yes.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.