For some reason, whenever I try and equip the tool it just wont do it. I tried a couple of different things and both did not work. I'm using a local script so only the person with the tool equipped can see it instead of the entire server. Any reason as to why this code below wont work?
01 | script.Parent.Equipped:Connect( function () |
02 | if game.StarterGui.PartUI.Enabled = = false then |
03 | game.StarterGui.PartUI.Enabled = true |
04 | end |
05 | end ) |
06 |
07 | script.Parent.Unequipped:Connect( function () |
08 | if game.StarterGui.PartUI.Enabled = = true then |
09 | game.StarterGui.PartUI.Enabled = false |
10 | end |
11 | end ) |
The problem you have here is that you are referencing the StarterGui
, which clones into each player when they spawn. If this gets edited, though, the player won't see it until they respawn, but in most cases, it resets on death. What you want to edit here is the PlayerGui
. You can easily access it with game.Players.LocalPlayer.PlayerGui.PartUI
as you are using a localscript.