How would I make it if I have a tool selected, that the screen gui would pop up? But then once you close that tool, the gui goes away.
Would be very helpful if someone can leave a script, thanks!
How would I make it if I have a tool selected, that the screen gui would pop up? But then once you close that tool, the gui goes away.
Would be very helpful if someone can leave a script, thanks!
I wasn’t going to answer this; but I will help you for the sake of my reputation. You seem to know how to detect when a player equips a tool. After that, just add a line that sets the visibility of the first frame in the GUI to true or false depending on the function.
Remember, since GUIs are local, you can only access them from the client. Using a ServerScript would return nil for PlayerGui. I will put an example below, but please do not just copy and paste it. The point of this website is to learn, and I will not encourage cheating.
Local script (inside your tool)
local Tool = script.Parent
local Player = game.Players.LocalPlayer
local GUI = Player.PlayerGui:WaitForChild(“ScreenGui”)
GUI.Frame.Visible = false
Tool.Equipped:Connect(function()
GUI.Frame.Visible = true
end)
Tool.Unequipped:Connect(function()
GUI.Frame.Visible = false
end)
The child “Frame” of ScreenGui referenced on lines 4, 6, and 9 must be manually created and can be named anything you want. I would always recommend putting GUI contents in a single frame for easy manipulation of its visibility. Good luck.
Since I'm so nice I'll set it up for you.
Tool.Equipped:Connect(function(mouse)
-- Do code
end)
I already know how to do that part of the code...I need help where you wrote DO CODE. Like I've seen this reply on many other pages and it does not help when you do not even explain ;-; thanks for your time but you did not answer my question what so ever.
Nice try. you're asking for the code to be written for you.
I mean somewhat I was trying to ask for the code to be written for me so then I could learn how to script and then help other people as well.
Uh, copying a code isnt gonna help you learn. Go and read in wiki or something. Dont ask for codes then say "I want to learn from that". No you wont learn like that.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
This is a help site, not a request site.