this shouldnt be that big

i just use lots of unnecessary code
for example this is all you need for that to work:
------
count = 0 // set the count of teleports used to 0
tcount = 0 // set the of teledests used to 0
timesdone = 0 // set the number of times this has been done to 0
portalon = 0 // turn off the portal gun
portalcolour = 0x5F90 // set the default portal colour to this
destcolour = 0xC0FF // set the default destination colour to this
mt = [ // teleport script
gridpower 0 // set to smallest gridsize for greatest accuracy
if (= $count 0) [] [ // if this is your first time, dont do anything for now, otherwise, delete the previous particles and portals (teleport + teledest)
delent // delete an ent: bug, not deleting anything

entfind particles 4 309 10 * // select these particles
delent // delete thim
entfind teleport (- $count 1) -1 // select these teleports
delent // delete
entfind teledest * (- $tcount 1) 1 // select these teledests
delent // bye bye!

]
newent teleport $count -1 // now make a new teleport
newent particles 4 309 10 $portalcolour // and a partticles
count = (+ $count 1) // and set the number of times the teleport has been used, to 1 more than before.
]
md = [ // teledest script
gridpower 0 // accuracy
newent teledest $tcount 1 // new teledest
newent particles 4 309 10 $destcolour // new particle
tcount = (+ $tcount 1) // set number of times used to 1 more than before
]
// event coding
onclientshoot = [ // the event for when someone shoots
_cl_sht = $arg1 // the 1st argument
if (!=s $_cl_sht "") [ // if its not blank
oldfrag = (gettotalshots) // get the amount of possible damage done before
sleep 5 [ // wait a little (5 ms)
if (> (gettotalshots) $oldfrag) [ // if the new amount of totalshots is greater than the old one
// you have shot

_cl_sht // do the first argument
]
onclientshoot $_cl_sht // repeat
]
]
] // end
onclientshoot [ // when someone shoots
if (= $portalon 1) [ // if the portal is on
if (mode 1) [ // if in coop
edittoggle // toggle edit
sleep 5 [ // sleep a little
if (mod $timesdone 2) [ // if it is the 2nd, 4th, etc time (teledest)
// second, 4th, etc...
md // do the teledest
timesdone = (+ $timesdone 1) // set the timesdone to 1 more
sleep 5 [ edittoggle ] // wait a little, exit edit
] [ // otherwise, its the 1st, 3rd, etc time (teleport)
// first, 3rd, etc...
mt // do the teleport
timesdone = (+ $timesdone 1) // set the timesdone to 1 more
sleep 5 [ edittoggle ] // wait a little, exit edit
]
]
]
]
] // end
clearportals = [
if (= $editing 1) [ // if editing
entfind particles 4 309 10 * * // same thing, clear them
delent
entfind teleport (- $count 1) -1
delent
entfind teledest * (- $tcount 1) 1
delent
] [ // otherwise, your not in editmode
edittoggle //enter editmode
entfind particles 4 309 10 * * //clear them
delent
entfind particles 4 309 10 * *
delent
entfind teleport (- $count 1) -1
delent
entfind teledest * (- $tcount 1) 1
delent
edittoggle // exit editmode
]
echo "All portals have been cleared." // tell the client that the portals have been cleared
]
---
now just remove those comments, my unnecessary code and you get like 3 functions that are 10 lines long
