im trying to change a text label on a screen gui in starter gui when you click a part
here is the code
local Textlabelforthingy = game.StarterGui.ScreenGui.TextLabel
script.Parent.ClickDetector.MouseClick:Connect(function()
Textlabelforthingy.Text = "the part has been clicked"
end
Ok, so you don't use StarterGui
, you use PlayerGui
Here is the fix:
--Local Script. local plr = game.Players.LocalPlayer local Textlabelforthingy = plr.PlayerGui.ScreenGui.TextLabel script.Parent.ClickDetector.MouseClick:Connect(function() Textlabelforthingy.Text = "the part has been clicked" end
It is because you are changing it in StarterGui you need to change it in the Player Gui
script.Parent.ClickDetector.MouseClick:Connect(function(player) local Textlabelforthingy = player.PlayerGui.ScreenGui.TextLabel Textlabelforthingy.Text = "the part has been clicked" end)