Hi! I was just wondering how you would make a GUI open from equipping a tool. I’m assuming you would use the equipped event to change the transparency of the GUI, but I’m not really sure how to script it since I am a beginner scripter. Thank you!
What do you mean by “Open gui”?
Sorry I should have explained it clearer . I mean kinda like a GUI appears.
So, inside the tool insert a local script.
local player = game.Players.LocalPlayer
local GUI = player.PlayerGui
script.Parent.Equipped:Connect(function() --[[you can add a
variable for the tool for more easy reference]]
GUI.ScreenGui.Enabled = true --[[ replace screenGui with the name of the screenGui,
and always make sure the ScreenGui is not enabled in the first place.]]
end)
script.Parent.Unequipped:Connect(function()
GUI.ScreenGui.Enabled = false
end)
Thank you! I’ll try that and let you know how it goes
did it work?
just wondering
(post marked for deletion for privacy reasons)
It should work in a localscript
. This topic has aged so we probably won’t expect a reply by the poster.
It didn’t work for me… are you sure its possible to reference PlayerGui
from a localscript?
Hello, ive done this previously with Books. I understand what you mean.
You can accomplish this by simply creating a script and the first thing you wanna do is check if the player has equipped the tool, if it hasnt equipped the tool then do nothing… BUT if the tool HAS been equipped by the player then you do the action, which in this case is opening the gui. Hope this helps!