Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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 ?

0
you are using game.StarterGui, u gotta use the gui's in the player greatneil80 2647 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

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)
0
THANK YOU BRO rupertrosse 39 — 4y
0
If this helped, consider marking this answer as the solution. xAtom_ik 574 — 4y
0
how tho ? rupertrosse 39 — 4y
0
You mean StarterGUI not *Scarborough* JesseSong 3916 — 4y
0
thats why I hate mobile -_- AnasBahauddin1978 715 — 4y
Ad

Answer this question