Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- the clickEvent() function
- function clickEvent()
- -- get the message and save the result to a variable
- local message = getMessage()
- -- check if the message is the same as the current message
- if script.Parent.Text == message then
- -- since we don't want this, instead of continuing to update the function
- -- to accomplish this, we can return the function itself
- return clickEvent() -- it will keep returning until we get a different message
- end
- -- update the text of the button with the message
- script.Parent.Text = message
- -- print the message as well
- print(message)
- end
Advertisement
Add Comment
Please, Sign In to add comment