Author Topic: Randomize eventing  (Read 983 times)

i need to know how to make a 25% chance of the activator getting something.

im working on a lottery machine that it costs 5 pts for a chance to get 10 pts.

.... That sounds very cool But i dont think you can do that .but you can do a 50% chance

well how do i do a 50% chance... if your gonna say

0 onactivate > client > incscore > 10

1 onactivate > self > toggleeventenabled > 0
then you can 4get about it.





i dont know how to use vce.

0 onActivate Self VCE_isValue <var:cl:score> >= 5 [1 5]
1 onVariableFalse Client centerPrint [You need more points!]
2 onVariableTrue Client incScore -5
3 onVariableTrue Self VCE_modVariable temp = 0
4 onVariableTrue Self VCE_modVariable temp random 3
5 onVariableTrue Self VCE_ifVariable temp == 0 [6 8]
6 onVariableFalse Client centerPrint [Aww, you lost 5 pts]
7 onVariableTrue Client centerPrint [Woo, you gain 10 pts!]
8 onVariableTrue Client incScore 10


I hope I didn't mess it up somewhere

I hope I didn't mess it up somewhere
...the first event is supposed to be VCE_ifValue, not isValue

Or you can do it old school and fire a projectile down from a 1x4 plate onto 4 1x1 plates.
If it hits 1 of those plates, execute the events. If it hits any of the other 3 then don't.

Or you can do it old school and fire a projectile down from a 1x4 plate onto 4 1x1 plates.
If it hits 1 of those plates, execute the events. If it hits any of the other 3 then don't.
Or you don't do that and do it the way more efficient and simple way using VCE.

Or you can do it old school and fire a projectile down from a 1x4 plate onto 4 1x1 plates.
If it hits 1 of those plates, execute the events. If it hits any of the other 3 then don't.
wait wat.

Or you don't do that and do it the way more efficient and simple way using VCE.

VCE is more efficient but it is not installed on every server since it is not default.
(although it should)

wait wat.

If a projectile is fired from a brick that is bigger than a 1x1 brick, it fires from a random position in that brick.

This is a 4x1 plate brick:
[_|_|_|_]
This is a 1x1 plate brick:
[_]


[_|_|_|_] fires projectile down
     |
     |
     |
    o


[_][_][_][_] catches the projectile

If the projectile lands on the red brick you do:
OnProjectileHit > ... execute code

Since the 4x1 plate brick is 4 times bigger than the 1x1 brick, the chances of it hitting the red brick are 25%

VCE is more efficient but it is not installed on every server since it is not default.
(although it should)

If a projectile is fired from a brick that is bigger than a 1x1 brick, it fires from a random position in that brick.

This is a 4x1 plate brick:
[_|_|_|_]
This is a 1x1 plate brick:
[_]


[_|_|_|_] fires projectile down
     |
     |
     |
    o


[_][_][_][_] catches the projectile

If the projectile lands on the red brick you do:
OnProjectileHit > ... execute code

Since the 4x1 plate brick is 4 times bigger than the 1x1 brick, the chances of it hitting the red brick are 25%

wont the projectile just keep spawning in the middle?

wont the projectile just keep spawning in the middle?
nvm i remembered there is a randomized x y z thing to the projectile eventing.