Touch part doesn't make a TextLabel visible

StarterGui just replicates the UI to the player, you have to get the player and do ".PlayerGUI


Everyone, you can use normal scripts to change the players UI.

already made a script for him like you mentioned, but he said he already tried that and its not working.

I tried it out, but it still didn’t work…

If someone would like to take a look (I would greatly appreciated it) here’s what I made.

Workspace:
Part
Insert script into Part.
image
(This is the script I have been editing.)

StarterGui:
ScreenGui titled: Boosters
inside ScreenGui, Frame.
Inside Frame, TextLabel titled: SpeedBoost
image

This is what was in the script:

script.Parent.Touched:Connect(function(hit)
	local humanoid = hit.Parent:FindFirstChild("Humanoid")
	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
	if humanoid and plr then
		humanoid.WalkSpeed = 32
		plr.PlayerGui.Frame.Boosters.SpeedBoost.Visible = true
		print("Speed Boost Active")
		wait(math.random(7, 15))
		humanoid.WalkSpeed = 16
		plr.PlayerGui.Frame.Boosters.SpeedBoost.Visible = false
		print("Speed Boost Unactive")

	end
end)

That is fine, this should work 100%

Why you reference Frame before Boosters ? In:
plr.PlayerGui.Frame.Boosters.SpeedBoost.Visible = true

1 Like

So I deleted the frame entirely, and just put the TextLabel into the “Boosters” ScreenGui, and I edited the script and now it works.
image
image

image
Thank you everyone!

1 Like

I deleted the frame and now it works. Thanks!

1 Like

Nice. You could also leave like it was but doing like this:

plr.PlayerGui.Boosters.Frame.SpeedBoost.Visible = true

1 Like

OMG YOUR RIGHT DUDE :man_facepalming: I had the frame before :man_facepalming: This was the issue all along :laughing:

1 Like

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