2x Events on OnPlayerTouch

Author Topic: 2x Events on OnPlayerTouch  (Read 635 times)

I have many builds that require onplayertouch. OnActivate isn't the proper event. The problem is, I noticed with V19, events under OnPlayerTouch doubles. For example, OnPlayerTouch Player AddVelocity 10 x x. Instead of doing 10, it would do 20. Yes, an easy fix would to cut everything in half, but that wouldn't work for everything. So, is there a fix to this? Is there some bad addon that I have? It even does this with the default addons enabled.

I've explained once before what onPlayerTouch does.
a player standing on a brick just keeps sending the input.
For example, having a brick that makes the player shoot a rocket when he stands on it will cause him to continuously fire rockets, because it's multiple inputs, not one continuous one.
It's not that it's doubling the input, it's that it's sending it again before the output actually occurs. Try using toggleEventEnabled events to turn the event off on the initial input.
If that doesn't work, I'll try to come up with something else.

It doesn't double. As you stand on the brick with the OnPlayertouch event, there's a slight delay on the relayed events letting them fire twice as you continue to stand there firing them.

If you don't want this to happen, set collision to none > OnPlayertouch on the brick with the eventing so people cant fire the relay more than once.

Like what they say, its not doubling, the events just occur twice. What I would recommend is having a hidden JVS button somewhere. Name that button whatever like "Velocity_JVS."

Now, for the brick with the onPlayertouch events, do the events " onPlayertouch < NAMED BRICK | Velocity JVS < content start.

Ok, go to the brick "Velocity JVS," clear all events, and put in these events.

1. onContentstart < player < AddVelocity  < 10 x x
2. onContentstarted < self < contentstop

This will do the action needed without making events occurring twice. Since the JVS button cannot be activated until the content has stopped, it just wont work until it has stopped. This is also good if you want buttons to only be accessed by you.

Yes, this is alot of events and there will be way to many JVS Buttons all around. Just try to stack them in some spot of nowhere and make them different colors so you know which one to event if it needs editing.

This is because of Amade's Bot Events.
There's a glitch that causes the onPlayerTouch to send twice... for now you'll have to disable the Bot Events or use zone bricks instead.

This is because of Amade's Bot Events.
There's a glitch that causes the onPlayerTouch to send twice... for now you'll have to disable the Bot Events or use zone bricks instead.
...Did you just ignore everything said above?

But yeah, I'd recommend zone events for something like that. Make a small upwards zone so it's only detected if the player walks onto it.

I just wish Zone Events could be triggered through a relay. Then they would truly be useful.

I found if you add
OnPlayerTouch>Self>CancelEvents
At the beginning and add a delay of 33 to all other events, it works.