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

How do I make a tool activate a frame?

Asked by 4 years ago

My attempt with no errors:

local Tool = script.Parent -- Get tool

Tool.Equipped:Connect(function(Mouse) -- When tool equipped
    Mouse.Button1Down:Connect(function() -- When tool is used
        script.Parent.Parent.PlayerGui.MainScreenGui.Information.Visible = true
    end)
end)

However, it does not do what it's supposed to do.

2 answers

Log in to vote
0
Answered by 4 years ago

You could use the Activated event of a Tool to run your code, which fires when the tool is equipped and clicked.

https://developer.roblox.com/en-us/api-reference/event/Tool/Activated

Ad
Log in to vote
0
Answered by 4 years ago

Since a frame is part of a gui which is a client thing, you could try to use a remote event that, when the tool is activated, is fired and then shows the gui?

Answer this question