Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why wont the Screen GUI show when the tool is equipped?

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)

1 answer

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.

4 comments

0

Tried, but it didn't work.

0

Show me the script.

0

How?

0

Post a new question or make a pastebin.

This discussion is preserved as it was. New answers, comments, and votes are closed.