Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name Event Helper
- @inputs Egp:wirelink
- @persist [BluePoints Blue Red RedPoints]:table R B [Redspawn Bluespawn]:entity Totalpoints
- runOnTick(1)
- runOnChat(1)
- runOnDeath(1)
- runOnSpawn(1)
- R=RedPoints:count()
- B=BluePoints:count()
- if(~Egp & ->Egp){
- reset()
- }
- if(first()){
- #chatPrint(vec(0,255,0),"[",vec(255,100,0),"EventHelper",vec(0,255,0),"]: "+owner():name()+" Has Spawned EventHelper, Created By Redware & coolxpress")
- Egp:egpClear()
- Egp:egpDrawTopLeft(1)
- Egp:egpBox(1,vec2(0),vec2(512))
- Egp:egpColor(1,vec(30))
- Egp:egpBox(2,vec2(30),vec2(450,70))
- Egp:egpColor(2,vec(40))
- Egp:egpBox(3,vec2(30,130),vec2(210,340))
- Egp:egpColor(3,vec(40))
- Egp:egpBox(4,vec2(270,130),vec2(210,340))
- Egp:egpColor(4,vec(40))
- Egp:egpBox(5,vec2(30,130),vec2(210,60))
- Egp:egpColor(5,vec(150,0,0))
- Egp:egpBox(6,vec2(270,130),vec2(210,60))
- Egp:egpColor(6,vec(0,0,150))
- Egp:egpText(7,"Event ScoreBoard",vec2(70,40))
- Egp:egpSize(7,50)
- Egp:egpText(8,"Team Red",vec2(50,140))
- Egp:egpSize(8,40)
- Egp:egpText(9,"Team Blue",vec2(285,140))
- Egp:egpSize(9,40)
- Egp:egpText(10,"0",vec2(100,256))
- Egp:egpSize(10,150)
- Egp:egpText(11,"0",vec2(340,256))
- Egp:egpSize(11,150)
- Totalpoints=3
- }
- Egp:egpSetText(10,RedPoints[R,normal]+"")
- Egp:egpSetText(11,BluePoints[B,normal]+"")
- if(chatClk()){
- P=lastSpoke()
- C1=teamColor(lastSpoke():team())
- Message = P:lastSaid():explode(" ")
- W1 = Message:shiftString()
- W2 = Message:shiftString()
- Q=toChar(34)
- if(W1=="!blue"){
- if(Bluespawn:isValid()){
- # P:teleport(Bluespawn:pos())
- }
- #chatPrint(vec(0,255,0),"[",vec(255,100,0),"EventHelper",vec(0,255,0),"]:",C1,P:name(),vec(0,255,0)," has joined the",vec(0,0,255)," Blue",vec(0,255,0)," team")
- Blue[P:name(),entity]=P
- Red[P:name(),entity]=noentity()
- }
- if(W1=="!red"){
- if(Redspawn:isValid()){
- # P:teleport(Redspawn:pos())
- }
- #chatPrint(vec(0,255,0),"[",vec(255,100,0),"EventHelper",vec(0,255,0),"]: ",C1,P:name(),vec(0,255,0)," has joined the",vec(255,0,0)," Red",vec(0,255,0)," team")
- Red[P:name(),entity]=P
- Blue[P:name(),entity]=noentity()
- }
- if(W1=="!quit"){
- # chatPrint(vec(0,255,0),"[",vec(255,100,0),"EventHelper",vec(0,255,0),"]: ",C1,P:name(),vec(0,255,0)," has quit the game")
- Red[P:name(),entity]=noentity()
- Blue[P:name(),entity]=noentity()
- }
- }
- foreach(I,L:entity=Blue){
- if(lastDeathAttacker()==L&deathClk()){
- BluePoints[B+1,normal]=BluePoints[B,normal]+1
- Egp:egpSetText(11,B:toString()+"")
- }
- foreach(O,D:entity=Red){
- if(lastDeathAttacker()==D&deathClk()){
- RedPoints[R+1,normal]=RedPoints[R,normal]+1
- Egp:egpSetText(10,R:toString()+"")
- }
- if(D==lastSpawnedPlayer()&spawnClk()){
- # D:teleport(Redspawn:pos())
- }
- if(L==lastSpawnedPlayer()&spawnClk()){
- #L:teleport(Bluespawn:pos())
- }
- }
- }
- if(chatClk(owner())){
- Message = P:lastSaid():explode(" ")
- W1 = Message:shiftString()
- W2 = Message:shiftString()
- Q=toChar(34)
- if(W1=="!spawn"){
- if(W2=="blue"){
- if(!Bluespawn:isValid()){
- Bluespawn=holoCreate(1)
- holoPos(1,owner():aimPos())
- holoColor(1,vec(0,0,255))
- }
- }
- if(W2=="red"){
- if(!Redspawn:isValid()){
- Redspawn=holoCreate(2)
- holoPos(2,owner():aimPos())
- holoColor(2,vec(255,0,0))}
- }
- }
- }
- if(BluePoints[B,normal]==Totalpoints){
- #chatPrint(vec(0,255,0),"[",vec(255,100,0),"EventHelper",vec(0,255,0),"]: Game Over!",vec(255,0,0)," Red",vec(0,255,0),"Wins!")
- BluePoints:clear()
- Blue:clear()
- }
- if(RedPoints[R,normal]==Totalpoints){
- #chatPrint(vec(0,255,0),"[",vec(255,100,0),"EventHelper",vec(0,255,0),"]: Game Over!",vec(0,0,255)," Blue",vec(0,255,0),"Wins!")
- RedPoints:clear()
- Red:clear()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement