Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 11 12 13 14 15 … 18 Next »
Release Shuttle Computer
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linear Mode
Release Shuttle Computer
11-06-2015, 11:44 PM, (This post was last modified: 11-06-2015, 11:50 PM by SuperPlayer.)
#1
SuperPlayer Offline
TSCM Super Member
****
Posts: 234
Threads: 30
Joined: Oct 2014
Wink  Shuttle Computer
This is my Shuttle Computer I am releasing today.

Code:
--@name Shuttle Computer --@author SuperPlayer --@updater STEAM_0:0:74694146 --@shared local Self = ents.self() local Shuttle = ents.self():isWeldedTo() Self:parentTo(Shuttle) local SWire = Shuttle:getWirelink() local Owner = ents.owner() local Target = nil local SDTime = 10 local Loc = { } --[[ You can add coordinates by your own! This is an example: Loc[Name] = Coordinates Under this are just galaxy warp destinations ]]-- Loc["pegasus"] = Vector( 5928.50, -6937.34, 9728.70 ) Loc["universe"] = Vector( -3168.37, -4246.44, -6609.20 ) Loc["milkyway"] = Vector( 11720.89, 4981.85, 6595.30 ) function say(String) printColor( Color(0, 255, 255 ), "[Shuttle] ",Color( 255, 255, 255 ), "" ..String) end function chatClk(Command, Player) LS = Command:lower() LSC = LS:explode( " " ) if Player == Owner then if (LSC[1] == "shuttle") then if (LSC[2] == "target") then if(LSC[3] ~= "" and LSC[4] == nil)then if LSC[3] == "off" then Target = nil say("Targetting off") else TargetFind = find.playerByName(LSC[3]) if IsValid(TargetFind) then Target = TargetFind say("Targetting "..Target:name()) else say("Could not target "..LSC[3]) end end elseif(LSC[3] ~= "" and LSC[4] ~= "")then local Player=find.playerByName(LSC[4]) local Targets = find.byClass( LSC[3], function( Ent ) return Ent:owner() == Player end ) if IsValid(Targets[1]) then Target = Targets[1] say("Targetting "..Target:class().." "..Target:owner():name()) else say("Could not target "..LSC[4].."'s".." "..LSC[3]) end end elseif (LSC[2] == "beam") then if LSC[4] == "up" then SWire["Beam Up"] = 1 say("Beaming up") elseif LSC[4] == "down" then if LSC[5] == "to" and LSC[6] ~= nil then local Ply = find.playerByName(LSC[6]) if IsValid(Ply) then local Pos = Ply:pos() SWire["Destination"] = Pos SWire["Beam Down"] = 1 say("Beaming down to "..Ply:name()) else say("There is no player "..LSC[6].." you could beam to.") end else local Trace = trace.trace( Shuttle:pos(), Shuttle:getUp()*-10^14, function(Ent) return Ent ~= Shuttle end , nil, false ) local BPos = Trace.HitPos SWire["Destination"] = BPos SWire["Beam Down"] = 1 say("Beaming down") end end elseif (LSC[2] == "warp" and LSC[3] == "to" and LSC[4] ~= nil) then if Loc[LSC[4]] then SWire["Transwarp Destination"] = Loc[LSC[4]] SWire["Transwarp"] = 1 say("Warping to "..LSC[4]) else local Player = find.playerByName(LSC[4]) if IsValid(Player) then SWire["Transwarp Destination"] = Player:pos() + Vector(0,0,200) SWire["Transwarp"] = 1 say("Warping to "..Player:name()) else say("Could not warp to "..LSC[4]) end end elseif (LSC[2] == "self" and LSC[3] == "destruct") then say("Self destruct activated! Self destruct in 10 seconds!") timer.create("SD",1,0,SD) elseif (LSC[2] == "abort" and LSC[3] == "self" and LSC[4] == "destruct") then say("Self destruct aborted!") SDTime = 10 timer.remove("SD") end return true end end end function SD() SDTime = SDTime -1 if SDTime == 0 then say("Self destruct complete") SWire["Self Destruct"] = 1 ents.self():remove() else say("Self destruct in "..SDTime.." seconds!") end end function listenToChat() chat.listen(chatClk) end hook.add( "think", "Target", function() if IsValid(Target) then local Pos = Target:pos() if Target:class() == "st_shuttle_type11" then Pos = Pos+Vector(0,0,200) end if SWire then SWire["Target"] = Pos end else local Trace = trace.trace( Shuttle:pos(), Shuttle:getForward()*-10^14, function(Ent) return Ent ~= Shuttle end , nil, false ) local TPos = Trace.HitPos if SWire then SWire["Target"] = TPos end end end) timer.create("chat", 0.5, 0, listenToChat)
The newest version can always be found in my shared folder. If you find bugs report them to me. Or you have suggestion, just tell me.
The chip auto-wires to your shuttle. For chat commands look through the code.

Enjoy it.
Find
Reply
« Next Oldest | Next Newest »


Messages In This Thread
Shuttle Computer - by SuperPlayer - 11-06-2015, 11:44 PM
RE: Shuttle Computer - by SuperPlayer - 29-06-2015, 08:47 PM
RE: Shuttle Computer - by тѕсм.[SG-1] Teal'c - 06-09-2015, 11:44 AM
RE: Shuttle Computer - by SuperPlayer - 06-09-2015, 12:47 PM

  • View a Printable Version
Forum Jump:


Users browsing this thread:
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.