Jump to content

Temp rezz script that allows 1 use every 6 seconds.


Guest
 Share

You are about to reply to a thread that has been inactive for 2378 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Just put an authorization flag in the touch_start event.  Flip it to TRUE when touched, start a 5 second timer, and use the timer to flip it back to FALSE.  So long as it is TRUE, block touches.

Even so, be very careful about the use of temp rezzers.  Many landowners will ban you for using them because of the potential for creating serious lag on the region, and for using up the region's L.I. allowance.

Link to comment
Share on other sites

Another option is to work with two states. After the object has been touched the script switches into a state that has no touch_start event. Then start a timer. After 5 seconds you switch back to the default state.

This method has the adventage that the object is not "touchable" during the 5 second period and people won't think that it's lag or a script with a malfunction.

EDIT:

Remark 1: Never use touch_start. It's kind of broken. I always use touch_end. Especially touch_start in relation with a state change will have side effects (e.g. object needs to be clicked several times before anything happens).

Remark 2: I have rarely seen crashed scripts in-world. However the few crashed scripts that I have seen stopped working due to  simultaneous touches while it was still calculating. The above method to change the state after a touch can help limiting the risk for a crash if there is high traffic.

  • Like 2
Link to comment
Share on other sites

touch_ start triggers when you press the mousbutton down.
touch_end triggers when your finger lifts up from the mouse button.
Unless a player needs 1 second for the click instead of the usual 10 milliseconds, the delay is barely noticeable. (It might make a difference for shooter games, but there I probably won't need a state change.)

If touch_start would work better (it really doesn't work well in my scripts with state change), then I would prefer it to touch_end.

PS: I am now wondering if my problems with touch_start might originate in my lazyness to never check the condition
if (touch_id == 0)
I shall test this one day...

Link to comment
Share on other sites

The problem with touch_start is pretty annoying in conjunction with changing from a state that lacks touch-related events. I first reported it almost nine years ago.

To me, the most annoying part of it is that I use state changes most often for this very purpose, so the mouse-cursor won't make the object look touchable when the script doesn't want touches.

Link to comment
Share on other sites

"touch_ start triggers when you press the mousbutton down.
touch_end triggers when your finger lifts up from the mouse button." Yes i do know that. it was written that way for simplicity rather than just techno babble which the OP most probably could not careless.

As for the  "great work LL" nothing in the world is perfect and never will be and as there is a simple work around it is hardly an issue.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2378 days.

Please take a moment to consider if this thread is worth bumping.

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
 Share

×
×
  • Create New...