|
| 06 Sep 2012 04:19 PM |
Please help me fix this Code I made that makes it so that when I open a tool a GUI appears and when I close it it disappears.
tool.Equipped:connect(function()
game.StarterGui.Teleports.TTF.Visible = true
end)
tool.Unequipped:connect(function()
game.StarterGui.Teleports.TTF.Visible = false
end) |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2012 04:24 PM |
| Firstly, you should be making changes to "PlayerGui" which is in the 'Player object' in game.Players. Secondly, you've not classified what "tool" is. |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Sep 2012 04:28 PM |
| Could you make the changes? (Not good with playergui things.) |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2012 04:31 PM |
Yes... The tools name may be tool but the script doesn't know that...
LocalScript:
script.Parent.Equipped:connect(function() game.Players.LocalPlayer.PlayerGui.Teleports.TTF.Visible = true end)
script.Parent.Unequipped:connect(function() game.Players.LocalPlayer.PlayerGui.Teleports.TTF.Visible = false end)
Should work. |
|
|
| Report Abuse |
|
|
tahu157
|
  |
| Joined: 16 Nov 2008 |
| Total Posts: 15045 |
|
|
| 06 Sep 2012 05:09 PM |
The script as you have it should work perfectly, except that you have it set to edit a Gui in StarterGui, whereas if you want to make a Gui appear for a certain player (the one who equips the tool) then you need to edit a Gui in that player's PlayerGui.
Gui = script.Parent.Parent.Parent.PlayerGui
adjust the amount of .Parent's to what you need.
-- これは私の署名である、それは日本語である |
|
|
| Report Abuse |
|
|