Now this is with comments (but only for the normal cubescript, if you have questions about the gui side then ask me!

)
------
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 the user interface scripting to make life a hell of a lot easier
portal_r = 15
portal_g = 0
portal_b = 15
alias text_1 "^f3Portal Gun Currently Disabled"
alias text_2 text_3
echo "Portal gun loaded. Press ^f3'P' ^f1to show the menu."
bind P [showgui "^f1Portal Gun"]
editbind P [showgui "^f1Portal Gun"]
specbind P [showgui "^f1Portal Gun"]
newgui "^f1Portal Gun" [
guititle "^f0Basic Portal Gun Controls"
guibar
guistayopen [
guibutton "^f2Clear all portals" clearportals
guibar
guibutton $text_1 $text_2
]
guitab "^f2Portal Editor"
guititle "^f0Color Editor"
guibar
guitext "Colors:"
guilist [
guiradio "^f3Red " $portalcolour 0xF00 [echo "Set to Red"; portalcolour = 0xF00]
guiradio "^f6Orange " $portalcolour 0xF60 [echo "Set to Orange"; portalcolour = 0xF60]
guiradio "^f2Yellow " $portalcolour 0xFFFFC0 [echo "Set to Yellow"; portalcolour = 0xFFFFC0]
guiradio "^f0Green " $portalcolour 0X0D0 [echo "Set to Green"; portalcolour = 0X0D0]
guiradio "^f1Blue " $portalcolour 0x00F [echo "Set to Blue"; portalcolour = 0x00F]
guiradio "^f1Turqouise " $portalcolour 0xC0FF [echo "Set to Turqouise"; portalcolour = 0xC0FF]
guiradio "^f5Purple " $portalcolour 0xB0F [echo "Set to Purple"; portalcolour = 0xB0F]
guiradio "^f7White " $portalcolour 0xFFFFFF [echo "Set to White"; portalcolour = 0xFFFFFF]
]
guibar
guistayopen [
guibutton "Make Your Own" [portalcolour = (+ (* (+ (* $portal_r 16) $portal_g) 16) $portal_b); echo Portal Colour Changed]
guislider portal_r 0 15;
guislider portal_g 0 15;
guislider portal_b 0 15;
]
guitab "^f3Destination Editor"
guititle "^f0Color Editor"
guibar
guitext "Colors:"
guilist [
guiradio "^f3Red " $destcolour 0xF00 [echo "Set to Red"; destcolour = 0xF00]
guiradio "^f6Orange " $destcolour 0xF60 [echo "Set to Orange"; destcolour = 0xF60]
guiradio "^f2Yellow " $destcolour 0xFFFFC0 [echo "Set to Yellow"; destcolour = 0xFFFFC0]
guiradio "^f0Green " $destcolour 0X0D0 [echo "Set to Green"; destcolour = 0X0D0]
guiradio "^f1Blue " $destcolour 0x00F [echo "Set to Blue"; destcolour = 0x00F]
guiradio "^f1Turqouise " $destcolour 0xC0FF [echo "Set to Turqouise"; destcolour = 0xC0FF]
guiradio "^f5Purple " $destcolour 0xB0F [echo "Set to Purple"; destcolour = 0xB0F]
guiradio "^f7White " $destcolour 0xFFFFFF [echo "Set to White"; destcolour = 0xFFFFFF]
]
guibar
guistayopen [
guibutton "Make Your Own" [destcolour = (+ (* (+ (* $portals_r 16) $portals_g) 16) $portals_b); echo Destination Colour Changed]
guislider portals_r 0 15;
guislider portals_g 0 15;
guislider portals_b 0 15;
]
guitab "^f5Info"
guitext "^f1This script was made by ^f6Bucco."
guitext "^f3Questions or comments? Reply to the forum post you found this on."
guitext "^f1Check out other scripts such as:"
guitext "^t^f2-Hiding"
guitext "^t^f2-Auto Sorry"
guitext "^t^f2-Quick Connect"
guitext "^t^f2-Auto Master"
guitext "^f5Coming Soon: Color Mixer"
guitext "^f4Known Bugs: Fly with Chainsaw"
guitext "^f1I hoped you liked this script!"
]
text_3 = [alias text_1 "^f1Portal Gun Currently Enabled"; alias text_2 text_4; echo "Portal Gun ^f3On"; portalon = 1]
text_4 = [alias text_1 "^f3Portal Gun Currently Disabled"; alias text_2 text_3; echo "Portal Gun ^f3Off"; portalon = 0]
// Particle choices (all others suck!

):
// 3 = Explosion, Fire ball, Flare
// 4 = Star Thing
// Choose for both portal and destination
// This means 4 choices + color
// newent particles 4 309 10 $po_color
// newent particles 4 227 10 s $po_color