|
| 13 Oct 2017 10:14 AM |
| Hello, My name is Melvin and I am working on a game. I wonder if someone know how to make a gui appear when a tool is equiped. It means I want a gui inside a tool if that is possible. If you know how to please leave a comment! |
|
|
| Report Abuse |
|
|
Firehoaxx
|
  |
| Joined: 24 Dec 2015 |
| Total Posts: 950 |
|
|
| 13 Oct 2017 10:18 AM |
LocalScript in tool: script.Parent.Equipped:Connect(function()
gui.Visible = not gui.Visible end)
--Random sequence of numbers |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2017 10:20 AM |
| Okay, Should I add the gui inside the script? |
|
|
| Report Abuse |
|
|
Firehoaxx
|
  |
| Joined: 24 Dec 2015 |
| Total Posts: 950 |
|
|
| 13 Oct 2017 10:24 AM |
No, you put the gui into startergui, above the script type in local gui = game.Players.LocalPlayer.PlayerGui.YOURGUINAME
--Random sequence of numbers |
|
|
| Report Abuse |
|
|
Firehoaxx
|
  |
| Joined: 24 Dec 2015 |
| Total Posts: 950 |
|
|
| 13 Oct 2017 10:28 AM |
**replace Visible with Enabled In the first part
--Random sequence of numbers |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Oct 2017 10:32 AM |
| You have to clarify what gui is so the script can enable it's visibility property... |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Oct 2017 10:37 AM |
at the very top of the script, do
'local gui = game.Players.LocalPlayer:WaitForChild("PlayerGui").ScreenGui -- change "ScreenGui" to whatever you named your Gui' |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2017 10:42 AM |
So its this okay?
local gui = game.Players.LocalPlayer:WaitForChild("PlayerGui").ScreenGui -- change "ScreenGui" to whatever you named your Gui local gui = game.Players.LocalPlayer.PlayerGui.GuiFood
script.Parent.Equipped:Connect(function()
gui.Enabled = not gui.Enabled end)
|
|
|
| Report Abuse |
|
|
|
| 13 Oct 2017 10:43 AM |
nop. I'll just type out the script for you
local gui = game.Players.LocalPlayer:WaitForChild("PlayerGui").GuiFood
script.Parent.Equipped:Connect(function() gui.Enabled = true end)
~ workspace.GeneratedScript.Life:Remove() |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2017 10:44 AM |
| Oh wait I found the problem I think it will works now. |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Oct 2017 10:47 AM |
| Paste the entire script here. I'll repost the fixed version |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2017 10:49 AM |
local gui = game.Players.LocalPlayer:WaitForChild("PlayerGui").GuiFood
local gui = game.Players.LocalPlayer.PlayerGui.GuiFood
script.Parent.Equipped:Connect(function()
gui.Enabled = not gui.Enabled local gui = game.Players.LocalPlayer:WaitForChild("PlayerGui").GuiFood
script.Parent.Equipped:Connect(function() gui.Enabled = true end)
~ workspace.GeneratedScript.Life:Remove()
end) |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2017 10:50 AM |
LOL. THAT'S WHAT I WAS WORRIED ABOUT! REMOVE THE;
~workspace.GeneratedScript.Life:Remove()
THAT'S MY SIGGY LMAOOO
Here's the fixed up;
--Delete your entire script, and paste this into an empty localscript inside the tool
ocal gui = game.Players.LocalPlayer:WaitForChild("PlayerGui").GuiFood
script.Parent.Equipped:Connect(function()
gui.Enabled = not gui.Enabled
local gui = game.Players.LocalPlayer:WaitForChild("PlayerGui").GuiFood
script.Parent.Equipped:Connect(function() gui.Enabled = true end)
end) |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2017 10:52 AM |
Oops. I added an extra end).
--Delete your entire script, and paste this into an empty localscript inside the tool
ocal gui = game.Players.LocalPlayer:WaitForChild("PlayerGui").GuiFood
script.Parent.Equipped:Connect(function()
gui.Enabled = not gui.Enabled
local gui = game.Players.LocalPlayer:WaitForChild("PlayerGui").GuiFood
script.Parent.Equipped:Connect(function() gui.Enabled = true end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Oct 2017 10:53 AM |
I should just go die. I made a misspelling...
--Delete your entire script, and paste this into an empty localscript inside the tool
local gui = game.Players.LocalPlayer:WaitForChild("PlayerGui").GuiFood
script.Parent.Equipped:Connect(function()
gui.Enabled = not gui.Enabled
local gui = game.Players.LocalPlayer:WaitForChild("PlayerGui").GuiFood
script.Parent.Equipped:Connect(function() gui.Enabled = true end) |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2017 10:55 AM |
| gui should be inside of StarterGui. |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2017 11:00 AM |
| Still not working... Should the gui be enabled in studio? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|