Jump to content

[Help] Functions


Recommended Posts

Hello :)

I was wondering if I can refresh a IF statement in a function that is triggered ONE TIME.

For example a GUI. I draw the first tab, but the second requires a getElementData == true, and I can change that from the first tab. How can I make it recheck the elementData without re-triggering the function ?


function example() 
    outputChatBox("This is triggered without any conditions") 
    --more code that can change the element data 
    if getElementData(localPlayer, "canITriggerIt") == true then 
        outputChatBox("Horay, i was triggered") 

It's a GUI with 2 tabs, I don't want to re-trigger the function to recheck the getElementData

Thank you :D

Link to comment

That is exactly what you need. You can't "refresh" a statement.

onClientElementDataChange will be triggered whenever an element's data change. You can detect when canITriggerIt gets changed and recheck the value.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...