Text dont apper after touching part

So I wanted to make a part show a textlabel on the screen, when you toutch the part.
I have tried everything for an hour but nothing happened.
But the TextLabel didnt apper…

here is a video :

Uploading: Screen Recording (12-24-2020 7-06-03 PM).wmv…

here is the code

script.Parent.Touched:Connect(function()
	game.StarterGui.ScreenGui.Strength.TextTransparency = 0
	script.Parent.TouchEnded:Connect(function()
		wait()
		game.StarterGui.ScreenGui.Strength.TextTransparency = 1
	end)
end)

You are accessing something from StarterGui, which is just a container for GUI objects. All GUI’s/scripts/anything from StarterGui is replicated into the Player’s PlayerGui. What you want to do is find the player, and then access the PlayerGui.

EDIT: If this is on a ServerScript, then you want to consider using a RemoteEvent to contact the client. The server has no visibility of individual player’s PlayerGuis.

2 Likes

I just discovered how to
so I created a new script in the textlabel and wrote this

game.Workspace.Part.Touched:Connect(function()
	script.Parent.TextTransparency = 0
	wait(1)
	script.Parent.TextTransparency = 1
end)

so yeah thanks for the help btw!