Author Topic: Need an event  (Read 1104 times)

on vce there was that event where wherever you clicked it shot out projectiles, anyone remember the whole string? i need it for a server, please post it.

if a player is touching a brick:
onplayertouch self vceIfValue [<var:pl:firing>] == [1] [1 2]
onvariabletrue player spawnProjectile [xxxxx]
onvariabletrue self playsound [xxxxx]

constantly working aslong as you clicked a brick once:
onactivate self firerelay
onrelay self firerelay
onrelay self vceIfValue [<var:pl:firing>] == [1] [3 5]
onvariabletrue player spawnProjectile [xxxxx]
onvariabletrue self playsound [xxxxx]
onvariabletrue - other stuff here, make sure you change the event number count marked red

to make it so that multiple people can use the 2nd option, use printcount loops instead of relays
bricks can only handle one relay loop at once, but can handle many printcount loops
onrelay>self>firerelay
becomes
onprintcountunderflow>self>decrementprintcount[9]
onprintcountunderflow>self>decrementprintcount[1]
and so on

to make it so that multiple people can use the 2nd option, use printcount loops instead of relays
bricks can only handle one relay loop at once, but can handle many printcount loops
onrelay>self>firerelay
becomes
onprintcountunderflow>self>decrementprintcount[9]
onprintcountunderflow>self>decrementprintcount[1]
and so on
didnt know that, thanks.

constantly working aslong as you clicked a brick once:
onactivate self firerelay
onrelay self firerelay
onrelay self vceIfValue [<var:pl:firing>] == [1] [3 5]
onvariabletrue player spawnProjectile [xxxxx]
onvariabletrue self playsound [xxxxx]
onvariabletrue - other stuff here, make sure you change the event number count marked red
doesnt work, what do i change red to?

to make it so that multiple people can use the 2nd option, use printcount loops instead of relays
bricks can only handle one relay loop at once, but can handle many printcount loops
onrelay>self>firerelay
becomes
onprintcountunderflow>self>decrementprintcount[9]
onprintcountunderflow>self>decrementprintcount[1]
and so on
That's what VCE Functions are for. It would also be wise to add a last message check, so you could be like "Gun Attack!" in chat, then right click the fire bullets.

This is the easiest way to do it, and multiple clients can use the function from one brick, although it's always best to use separate bricks and fire the functions off those instead



After clicking the brick, right click to fire bullets. They will shoot out every one second. You may increase or decrease this time, but keep in mind the more loops you have with a short time distance, the greater your lag may be if your computer processor cannot handle it.
« Last Edit: January 26, 2015, 07:07:38 AM by Goth77 »


doesnt work, what do i change red to?
you change that to what ever number the last variabletrue/false event is on. if you dont have any other if statements on there then you can just get rid of both of those numbers completely to avoid confusion.