Guest User

Untitled

a guest
Aug 14th, 2025
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. -- the clickEvent() function
  2. function clickEvent()
  3.     -- get the message and save the result to a variable
  4.     local message = getMessage()
  5.  
  6.     -- check if the message is the same as the current message
  7.     if script.Parent.Text == message then
  8.         -- since we don't want this, instead of continuing to update the function
  9.         -- to accomplish this, we can return the function itself
  10.         return clickEvent() -- it will keep returning until we get a different message
  11.     end
  12.  
  13.     -- update the text of the button with the message
  14.     script.Parent.Text = message
  15.     -- print the message as well
  16.     print(message)
  17. end
Advertisement
Add Comment
Please, Sign In to add comment