Author Topic: Click The Brick!(Bug Fix) [EventScript]  (Read 1033 times)

Hello! This is an example project that I've made to help showcase the amazing shareability that events can have with EventScript! (https://forum.blockland.us/index.php?topic=314714.0)

This game is free to use by anyone without credit and requires VCE to function.
 
The Game:
Click The Brick is a spam click a brick game where it tests how many times you can click a brick in 10 seconds. The game includes 1 highscore slot with name and score and security to ensure that no one else can interfere with your clicking!

Code: [Select]
[x][0] onActivate -> Self -> VCE_stateFunction("flashRed/Green", "1 4")
[x][0] onVariableFunction -> Self -> setColor("0.976471 0.976471 0.976471 1.000000")
[x][200] onVariableFunction -> Self -> VCE_ifVariable("arg0", "==", 0, "3 4")
[x][0] onVariableTrue -> Self -> setColor("1.000000 0.000000 0.000000 1.000000")
[x][0] onVariableFalse -> Self -> setColor("0.000000 0.784314 0.000000 1.000000")
[x][0] onActivate -> Self -> VCE_ifValue("Monoblaster4", "!=", "BLID:46426", "6 6")
[x][0] onVariableTrue -> Self -> VCE_ifValue("<var:pl:Ready?>", "!=", 1, "7 18")
onVariableTrue7: [x][0] onVariableTrue -> Self -> VCE_modVariable("Player", "Ready?", "Set", 1)
[x][5000] onVariableTrue -> Self -> VCE_modVariable("Player", "Ready?", "Set", 0)
onVariableTrue9: [x][5000] onVariableTrue -> Self -> setEventEnabled([onVariableTrue7:onVariableTrue9], 1)
[x][0] onVariableTrue -> Self -> setEventEnabled([onVariableTrue7:onVariableTrue9], 0)
[x][0] onVariableTrue -> Client -> ChatMessage("                                    <color:FFFFFF>Welcome to<color:0000FF> Click<color:FFFFFF> The<color:FF0000> Brick<color:FFFFFF>!")
[x][0] onVariableTrue -> Client -> ChatMessage("The game where you click this brick as many times as you can in 10 seconds!")
[x][0] onVariableTrue -> Client -> ChatMessage("<color:FFD700>The current highscore is held by <var:br:hsh> with <var:br:hs> clicks!")
[x][0] onVariableTrue -> Client -> ChatMessage("                                 <color:FFFF00>Click the brick again to continue.")
[x][0] onVariableTrue -> Self -> playSound("ClickPlant.wav")
[x][0] onVariableFalse -> Self -> setEventEnabled(5, 0)
[x][0] onVariableFalse -> Self -> VCE_modVariable("Player", "Playing?", "Set", 1)
[x][0] onVariableFalse -> Self -> VCE_ifValue("The", "!=", "Game", "19 32")
[x][0] onVariableTrue -> Client -> ChatMessage(" ")
[x][0] onVariableTrue -> Client -> ChatMessage("<color:FF0000>!!!<color:FFFF00> Now that you are ready, start clicking as soon as the brick turns green <color:FF0000>!!!")
[x][0] onVariableTrue -> Self -> VCE_callFunction("flashRed/Green", 0)
[x][0] onVariableTrue -> Self -> playSound("Beep_Checkout.wav")
[x][2000] onVariableTrue -> Self -> VCE_callFunction("flashRed/Green", 0)
[x][2000] onVariableTrue -> Self -> playSound("Beep_Checkout.wav")
[x][3000] onVariableTrue -> Self -> VCE_callFunction("flashRed/Green", 0)
[x][3000] onVariableTrue -> Self -> playSound("Beep_Checkout.wav")
[x][3800] onVariableTrue -> Self -> VCE_callFunction("flashRed/Green", 1)
[x][4000] onVariableTrue -> Self -> playSound("Beep_Popup.wav")
[x][4000] onVariableTrue -> Self -> setEventEnabled(33, 1)
[x][14000] onVariableTrue -> Self -> setEventEnabled(33, 0)
[x][14000] onVariableTrue -> Self -> setColor("1.000000 0.000000 0.000000 1.000000")
[x][14000] onVariableTrue -> Self -> VCE_ifValue("Scoring/Reset", "!=", "", "42 43")
[ ][0] onActivate -> Self -> VCE_ifValue("<var:pl:Playing?>", "==", 1, "34 35")
[x][0] onVariableTrue -> Self -> VCE_modVariable("Brick", "clicks", "Add", 1)
[x][0] onVariableTrue -> Self -> VCE_ifVariable("clicks", ">", "<var:br:hs>", "36 41")
[x][0] onVariableFalse -> Client -> CenterPrint("<color:FFFFFF><var:br:clicks>", 1)
[x][0] onVariableFalse -> Self -> playSound("clickChange.wav")
[x][0] onVariableTrue -> Client -> CenterPrint("<color:FFD700><var:br:clicks>", 1)
[x][0] onVariableTrue -> Self -> playSound("breakBrick.wav")
[x][0] onVariableTrue -> Self -> setEmitter("Hammer Spark")
[x][100] onVariableTrue -> Self -> setEmitter("NONE")
[x][0] onVariableTrue -> Self -> VCE_ifVariable("clicks", ">", "<var:br:hs>", "44 49")
[x][4000] onVariableTrue -> Self -> VCE_ifValue("Reset", "!=", "at line 55", "57 59")
[x][0] onVariableTrue -> Self -> VCE_modVariable("Brick", "hs", "Set", "<var:br:clicks>")
[x][0] onVariableTrue -> Client -> CenterPrint("<color:FFD700>You beat <var:br:hsh> and with a highscore of <var:br:clicks> clicks!", 6)
[x][0] onVariableTrue -> Self -> VCE_modVariable("Brick", "hsh", "Set", "<var:cl:name>")
[x][0] onVariableTrue -> Self -> playSound("orchHitH.WAV")
[x][0] onVariableFalse -> Self -> VCE_modVariable("Brick", "clicks", "Add", 20)
[x][0] onVariableFalse -> Self -> VCE_ifVariable("clicks", ">", "<var:br:hs>", "50 56")
[x][0] onVariableTrue -> Self -> VCE_modVariable("Brick", "clicks", "Subtract", 20)
[x][0] onVariableTrue -> Self -> VCE_modVariable("Brick", "clicks", "Subtract", "<var:br:hs>")
[x][0] onVariableTrue -> Self -> VCE_modVariable("Brick", "clicks", "Multiply", -1)
[x][0] onVariableTrue -> Self -> playSound("Beep_Siren.wav")
[x][0] onVariableTrue -> Client -> CenterPrint("<color:cd7f32>You almost beat <var:br:hsh> but missed by <var:br:clicks> clicks!", 6)
[x][0] onVariableFalse -> Self -> playSound("Beep_TryAgain.wav")
[x][0] onVariableFalse -> Client -> CenterPrint("<color:FFFFFF>You could be the new champion of this brick if you work at it!", 6)
[x][0] onVariableTrue -> Self -> VCE_modVariable("Player", "Playing?", "Set", 0)
[x][0] onVariableTrue -> Self -> VCE_modVariable("Brick", "clicks", "Set", 0)
[x][0] onVariableTrue -> Self -> setEventEnabled(5, 1)
It would be appreciated if you say something below if you use the events for anything.
« Last Edit: November 29, 2018, 10:33:22 PM by Monoblaster4 »