The script change the text but Its not visible for me

Hello everyone, so i made this script about if you touch a part, the text will be changed, but for some reason the new text that the script changes doesn’t show up?
Code:
local Part = script.Parent
local NoSeeGUI = game.StarterGui.ScreenGui.TextLabel
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
Part.Touched:Connect(function(hit)
if hit.Parent == character then
NoSeeGUI.Text = “Low Brightness”
NoSeeGUI.TextColor3 = Color3.new(1, 1, 1)
print(“Text now no Bright”)
task.wait(1)
end
end)
end)
end)

Because you’re changing the text from a GUI that is placed in StarterGui, you need to directly change it from the player’s PlayerGui.

1 Like

Try this

local Part = script.Parent
local NoSeeGUI = game.StarterGui.ScreenGui.TextLabel
game.Players.PlayerAdded:Connect(function(player)
		Part.Touched:Connect(function(hit)
			if hit.Parent:FindFirstChild("Humanoid") then
				NoSeeGUI.Parent = player.PlayerGui
				NoSeeGUI.Text = "Low Brightness"
				NoSeeGUI.TextColor3 = Color3.new(1, 1, 1)
				print("Text now no bright")
				task.wait(1)
			end
		end)
	end)
end)

To be able to display changes to guis, you need to parent it to the PlayerGui so players can see it

3 Likes

thats happening because your changing the text thats in the startergui instead you need to change the text thats in the playergui

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.