Displaying Text Only Once

Hello, I’m trying to display text saying “Speed up” lets say when score =50. but I only want it to display once!

this is what I have now:

function speedup() local speedup = display.newText(  "SPEED UP!", centerX, centerY, "Capture\_it", 36 ) speedup.xScale=5 speedup.yScale=5 transition.to ( speedup, {time=200,xScale=1,yScale=1} ) transition.to ( speedup,  {delay=200,time=3000,y=screenTop} ) transition.to ( speedup,  {delay=200,time= 500,alpha=0} ) end if score == 50 then      speedup() end

Whats happening now is the text keeps displaying again and again until the score stays 50 But I only want it to appear once!

I founda fix for it by adding a local variable and setting it to 1 then printing the score and then adding 1 to it so next time the if statement checks it it is not true anymore hence it skips hit…leaving this thread here so it might help someone facing the same problem :slight_smile:

I founda fix for it by adding a local variable and setting it to 1 then printing the score and then adding 1 to it so next time the if statement checks it it is not true anymore hence it skips hit…leaving this thread here so it might help someone facing the same problem :slight_smile: