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?
script.Parent.Equipped:Connect(function() if game.StarterGui.PartUI.Enabled == false then game.StarterGui.PartUI.Enabled = true end end) script.Parent.Unequipped:Connect(function() if game.StarterGui.PartUI.Enabled == true then game.StarterGui.PartUI.Enabled = false end 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.