I have written you an example, however there is a few elements I want you to understand, see how the message starts at empty and the object is visible.?
How could you change the code so that it starts in either shown or hidden state?
Using your big juicy brain, im sure you can work it out.
REM ----------------------------------------------
REM TEMP SETUP ENVIRONMENT
REM ----------------------------------------------
sync on : sync rate 60
REM ----------------------------------------------
REM VARIABLES FOR THE SWITCH SET TO ZERO
REM YOU CAN HAVE LOTS MORE PROVIDED THEY HAVE UNIQUE NAMES
REM ----------------------------------------------
MY_Unique_Toggle=0
MY_Unique_Switch=0
MY_Message$="Empty"
REM ----------------------------------------------
REM MAKE A TEMP OBJECT TO PLAY WITH
REM ----------------------------------------------
make object cube 1,10 : position object 1,0,0,0 : ghost object on 1
make object cube 2,5 : position object 2,0,5,0 : scale object 2,100,100,200
make object cube 3,5 : position object 3,0,5,0 : scale object 3,200,100,100
perform csg difference 1,2 : perform csg difference 1,3
delete object 2 : delete object 3
REM ----------------------------------------------
REM POSITION TEMP CAMERA
REM ----------------------------------------------
position camera 15,5,-35 : point camera 0,0,0
REM ----------------------------------------------
REM TEMP MAIN
REM ----------------------------------------------
disable escapekey : while escapekey()=0
REM ----------------------------------------------
REM HIDE SWITCH
REM ----------------------------------------------
If keystate(15)=1 and MY_Unique_Switch=0
MY_Unique_Toggle=1-MY_Unique_Toggle
MY_Unique_Switch=1
hide object 1
MY_Message$="Where did he go?"
Endif
REM ----------------------------------------------
REM SHOW SWITCH
REM ----------------------------------------------
If keystate(15)=0 then MY_Unique_Switch=0
if MY_Unique_Toggle=1
show object 1
r = wrapvalue(r+1) : rotate object 1,r,r,r
MY_Message$="Peekaboo! oh hehe"
endif
REM ----------------------------------------------
REM QUICK DIRTY MOVE CAMERA KEYS
REM ----------------------------------------------
control camera using arrowkeys 0,1,2
REM ----------------------------------------------
REM OUTPUT THE MESSAGE AND FPS
REM ----------------------------------------------
text 1,1,MY_Message$
text 1,16,STR$(screen fps())
REM ----------------------------------------------
REM END TEMP MAIN
REM ----------------------------------------------
fastsync : endwhile
REM ----------------------------------------------
REM CLEAN UP AND END
REM ----------------------------------------------
delete object 1
end