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

Why can't i change the transparency of my textboxes?

Ok so basically i made a post on this before but i didn't explain enough for the question to get answered. Im trying to make a gui appear on screen and then Disappear i have a local script a screengui and 2 text boxes

https://gyazo.com/0bc75ba06a54d8de27127fa63ed02463

and i made a script where when the floormaterial is sand it makes the text transparency of the text boxes change then wait 5 seconds and change back but when i tested the game i didn't get an error but nothing changed here is the script

https://pastebin.com/7XRkxRjM

Here is a clip of it not really working

https://gyazo.com/fd5b1ca5064132327b070299ed4ea10d

1 answer

dont put in pastebin unless its a gigantic script

local player = game:GetService("Players").LocalPlayer--use get service instead in case you decide to switch the name of players
player.CharacterAdded:Connect(function(char)--your character don't exist all the time so you need an event that listen after when it gets created
	local hum = char:WaitForChild("Humanoid")--we need to let the humanoid load in and we do that by using :WaitForChild
	local gui = player:WaitForChild("PlayerGui")--we dont look in startergui, the startergui is what gives the gui to everyone in the game, instead we look for the playergui which is what the client can see
	hum:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
		if hum.FloorMaterial == Enum.Material.Sand then
			gui.DesertScreenGui.DesertTextBox.TextTransparency = 0--we go from the gui variable thats inside the plauer on these
			gui.DesertScreenGui.DesertTextBox2.TextTransparency = 0
			wait(5)
			gui.DesertScreenGui.DesertTextBox.TextTransparency = 1
			gui.DesertScreenGui.DesertTextBox2.TextTransparency = 1
		end
	end)
end)

2 comments

0

Thanks alot you explained everything well

0

so then you can put my answer as the correct answer so i get credit

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