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

How to fix output isn't printing anything even though the script constantly checks?

Asked by
R0jym 47
2 years ago

Hello there, I have a LocalScript here which is a child of a TextBox (Not a TextLabel), it's supposed to constantly check if the Textbox has the text "Aesthetical" of which will print "Aesthetical is correct!" whereas if it's the opposite it just prints "What bro" in an indefinite amount of times, because it is obviously a function

However it does not seem to work, how do I approach and fix this?

local text = script.Parent

local function trigger()
if text.Text == "Aesthetical" then
        print("Aesthetical is correct!")
    else
        print("What bro")
    end
end

3 answers

Log in to vote
0
Answered by 2 years ago

Try checking the properties of the TextBox

0
What I'm trying to do is it constantly checks if the player types Aesthetical, if the player typed Aesthetical in the TextBox it prints that Aesthetical is correct, whereas if the player does not type Aesthetical it just keeps printing What Bro R0jym 47 — 2y
Ad
Log in to vote
0
Answered by
Puppynniko 1059 Moderation Voter
2 years ago
Edited 2 years ago

Constantly Run the trigger function in a loop also i tested this in a local script and it worked and didn't break

Log in to vote
0
Answered by
Antelear 185
2 years ago
Edited 2 years ago

Did you try actually CALLING the function?

local function MyFunction(Num)
    print(Num^Num) -- Num to the power of Num
end

MyFunction(5) -- will print 5*5*5*5*5

Just keep in mind you need to CALL YOUR FUNCTIONS by re-typing the name and ending it with your parenthesis and with your added parameters (if any)!

0
Note; if you named your textbox "Text", it might not like it when you do `[variable_name_leading_to_"Text"].Text` Antelear 185 — 2y

Answer this question