| Blockland Forums > General Discussion |
| How would I make a radio with VCE |
| << < (2/2) |
| Johnny Blockhead:
It is like two lines. It was this one output event.. |
| tredden:
Not sure what you are asking... <var:cl:lastteammsg> might be what you are looking for... |
| boodals 2:
--- Code: ---0 [000] OnActivate > Self > VCE_StateFunction > "<var:cl:bl_id>" "" 1 [000] OnActivate > Self > VCE_callFunction > "<var:cl:bl_id>" "" 2 [100] OnVariableFunction > Self > VCE_callFunction > "<var:cl:bl_id>" "" 3 [000] OnVariableFunction > Self > VCE_ModVariable > "Client" "msg" "Set" "<var:cl:lastTeamMsg>" 4 [000] OnVariableFunction > Client > VCE_IfVariable > "msg" "==" "<var:cl:lastTeamMsg>" "" 5 [000] OnVariableFalse > Self > VCE_ModVariable > "Brick" "sendMsg" "Set" "<var:cl:msg>" 6 [000] OnVariableFalse > Client > VCE_ModVariable > "msg" "Set" "<var:cl:lastTeamMsg>" 7 [000] OnVariableFalse > Self > setEventEnabled > "8 9" Checked 8 [000] OnVariableFunction > Client > ChatMessage > "<var:br:sendMsg>" 9 [099] OnVariableFunction > Self > setEventEnabled > "8 9" Unchecked --- End code --- Im pretty sure that would work. Let me break it down: Lines 0-2: VCE Function loop, which is similar to a relay loop, however it allows for targeting the client without wasting lines on if's, and also loops for each client which starts the loop, unlike relays. It will also only loop once per client (im pretty sure), unlike an If loop. Lines 3-4: Checks if you've just sent a new team message. Lines 5-7: If you have, it will set the msg variable to your new last team message, and enables events 8 and 9. Lines 8-9: These send the client the chat message, and after a 99ms delay, it turns itself off (every client's loop will be at different intervals. If the delay was instant, then only one client would see it. I think there is a chance that a client wont see a message (1/100), but i may be wrong) Also, this is untested. I might have forgotten some part of it. |
| RaR:
Oh forget, completely forgot <var:cl:lastteammsg> existed. |
| Navigation |
| Message Index |
| Previous page |