My text doesn't change when clicked on the part. Help?
Asked by
5 years ago Edited 5 years ago
My text doesn't change, when it's clicked.
I know the code is long, you can point out other errors in here and suggest a solution to these as well.
(the "dziesiecminut" or "piecminut" are the things that its supposed to check value of, to display it.)
And the question marks are polish accenting letters (z with a dot above it and stuff like that), they turned into it for some reason.
My LocalScript inside the part that im clicking:
01 | local Part = script.Parent |
02 | local ClickDetector = Part:WaitForChild( "ClickDetector" ) |
03 | local Backpack = game.Players.LocalPlayer.Backpack |
06 | local tekst = script.Parent.SurfaceGui.TextLabel.Text |
08 | ClickDetector.MouseClick:connect( function () |
09 | if Backpack.dziesiecminut = = true then |
10 | tekst = "Ten bilet jest wa?ny jeszcze przez" .. Backpack.dziesiecminut.Value.Value .. "sekund." |
12 | tekst = "Je?li chcesz sprawdzi? wa?no?? biletu, kliknij ten ekran. (trzeba mie? tylko jeden bilet w ekwipunku, nie mo?e by? on wyci?gni?ty, i wa?no?? podawana w sekundach)" |
13 | elseif Backpack.piecminut = = true then |
14 | tekst = "Ten bilet jest wa?ny jeszcze przez" .. Backpack.piecminut.Value.Value .. "sekund." |
16 | tekst = "Je?li chcesz sprawdzi? wa?no?? biletu, kliknij ten ekran. (trzeba mie? tylko jeden bilet w ekwipunku, nie mo?e by? on wyci?gni?ty, i wa?no?? podawana w sekundach)" |
17 | elseif Backpack.piecminut and Backpack.dziesiecminut = = true then |
18 | tekst = "Masz dwa bilety na raz. Musisz upu?ci? jeden z nich (kliknij Backspace na klawiaturze, z wyci?gni?tym biletem, który chcesz upu?ci?)." |
20 | tekst = "Je?li chcesz sprawdzi? wa?no?? biletu, kliknij ten ekran. (trzeba mie? tylko jeden bilet w ekwipunku, nie mo?e by? on wyci?gni?ty, i wa?no?? podawana w sekundach)" |
21 | elseif Backpack.piecminut and Backpack.dziesiecminut = = nil then |
22 | tekst = "Nie masz biletu w ekwipunku. Upewnij si?, ?e nie masz swojego biletu w r?ce (je?li go masz)." |
24 | tekst = "Je?li chcesz sprawdzi? wa?no?? biletu, kliknij ten ekran. (trzeba mie? tylko jeden bilet w ekwipunku, nie mo?e by? on wyci?gni?ty, i wa?no?? podawana w sekundach)" |