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

How do I Change the label text using a button (part) ?

i tried using this code , im kind of new to scripting and i am studying .

local fl = game.Workplace.FARMLAND

fl.FARM1.ClickDetector.MouseClick:Connect(function()

if crop.a1.Transparency == 1 then
	
crop.a1.Transparency=0
wait(5)
crop2.b1.Transparency=0


else

game.StarterGui.ScreenGui.TextLabel.Text = 'hello'

end

Can you tell me what am I doing wrong ?

1 comment

0

you are using game.StarterGui, u gotta use the gui's in the player

1 answer

✓ Accepted answer

It is because u are changing it in StarterGui which means it won't change until player resets, use this


fl.FARM1.ClickDetector.MouseClick:Connect(function(player)
if crop.a1.Transparency == 1 then
crop.a1.Transparency = 0
wait(5)
crop.b1.Transparency = 0


else
player.PlayerGui.ScreenGui.TextLabel.Text = "hello"
end
end) 

5 comments

0

THANK YOU BRO

0

If this helped, consider marking this answer as the solution.

0

how tho ?

0

You mean StarterGUI not Scarborough

0

thats why I hate mobile -_-

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