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 … 13 14 15 16 17 18 Next »
LocInt's SF Help & Request Thread
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linear Mode
LocInt's SF Help & Request Thread
11-12-2014, 06:41 PM,
#3
LocInt Offline
Long gone
****
Posts: 489
Threads: 91
Joined: Aug 2014
RE: LocInt's SF Help & Request Thread
(11-12-2014, 06:13 PM)Wirebuilder28 Wrote: hi loc,you asked me to post that (need help), THX! Big Grin
--@name Shuttle AI
--@author wirebuilder28
--@sharedscreen
--@model models/madman07/supergate_dhd/supergate_dhd.mdl

local Owner = ents.owner()
wire = loadLibrary("wire")
ents = loadLibrary("ents")
find = loadLibrary("find")
Red=Color(200, 57, 43, 255)
Green=Color(46, 204, 113, 255)
Blue=Color(41, 128, 185, 255)
White=Color(236, 240, 241, 255)
wire.createInputs( { "Shuttle" } , { "wirelink" } )

function transwarpdestination(target,pos)
if target and pos != Vector( 0,0,0 ) then
wire.ports.Shuttle["Transwarp Destination"] = pos+Vector( 0,0,500 )
wire.ports.Shuttle["Transwarp"]=1
printColor(Blue,"[TransWarp] ",White,"to",Red," "..target:name())
end
--if target:isPlayer() then
-- printColor(Green,"[Shuttle]",Blue," Transwarping to "..target:name())
-- end
end
function runCommand( t )
if t[1] =="/taxi" then
if find.playerByName( t[2] ) then
local target = find.playerByName( t[2] )
transwarpdestination(target:pos())
end
end
end


function Chat( msg, ply )
local t = {}
for i in string.gmatch(msg, "%S+") do --converting the message string into a table.
table.insert(t,i)
end
runCommand( t ) --send the command to do stuff.
end
chat.listen( Chat, ents.owner() )
--time.timer("chat",0.5,0,parseChat)
Code:
--@name Shuttle AI --@author wirebuilder28 --@sharedscreen --@model models/madman07/supergate_dhd/supergate_dhd.mdl local Owner = ents.owner() wire = loadLibrary("wire") ents = loadLibrary("ents") find = loadLibrary("find") Red=Color(200, 57, 43, 255) Green=Color(46, 204, 113, 255) Blue=Color(41, 128, 185, 255) White=Color(236, 240, 241, 255) Shuttles = find.byClass( "st_shuttle_type11", function( Ent ) return Ent:owner() == ents.owner() end ) Shuttle = Shuttles[1]:getWirelink() function IsValid( Ent ) return Ent and Ent.isValid and Ent:isValid() end function transwarpdestination(Target,Pos) if (IsValid(Target) and IsValid(Shuttle) and Pos!= Vector( 0,0,0 )) then Shuttle["Transwarp Destination"] = Pos+Vector( 0,0,500 ) Shuttle["Transwarp"]=1 printColor(Blue,"[TransWarp] ",White,"to",Red," "..Target:name()) time.timer( "transWarp", 10, 1, function() Shuttle["Transwarp"]=0 end ) end --if target:isPlayer() then -- printColor(Green,"[Shuttle]",Blue," Transwarping to "..target:name()) -- end end function runCommand( t ) if (t[1] =="/taxi") then if(t[2] != nil) then local Target = find.playerByName( t[2] ) if(IsValid(Target)) then local TPos=Target:pos() time.timer( "transWarp", 1, 1, function() transwarpdestination(Target,TPos) end ) end end end end function Chat( msg, ply ) local t = {} for i in string.gmatch(msg, "%S+") do --converting the message string into a table. table.insert(t,i) end runCommand( t ) --send the command to do stuff. end chat.listen( Chat, ents.owner() ) --time.timer("chat",0.5,0,parseChat)

Here you go.

тѕсм.Person8880 hovers the nerf bat over Tetryon damage
Website Find
Reply
« Next Oldest | Next Newest »


Messages In This Thread
LocInt's SF Help & Request Thread - by LocInt - 11-12-2014, 05:55 PM
RE: LocInt's SF Help & Request Thread - by Wirebuilder28 - 11-12-2014, 06:13 PM
RE: LocInt's SF Help & Request Thread - by LocInt - 11-12-2014, 06:41 PM
RE: LocInt's SF Help & Request Thread - by Person8880 - 11-12-2014, 07:21 PM
RE: LocInt's SF Help & Request Thread - by LocInt - 11-12-2014, 07:34 PM
RE: LocInt's SF Help & Request Thread - by Person8880 - 11-12-2014, 07:40 PM
RE: LocInt's SF Help & Request Thread - by LocInt - 11-12-2014, 07:41 PM
RE: LocInt's SF Help & Request Thread - by TheOneAndOnlyTee - 11-12-2014, 09:01 PM
RE: LocInt's SF Help & Request Thread - by Blackhawk - 11-12-2014, 11:28 PM
RE: LocInt's SF Help & Request Thread - by LocInt - 11-12-2014, 11:41 PM
RE: LocInt's SF Help & Request Thread - by Person8880 - 12-12-2014, 06:47 PM
RE: LocInt's SF Help & Request Thread - by SuperPlayer - 14-05-2015, 05:29 PM
RE: LocInt's SF Help & Request Thread - by LocInt - 14-05-2015, 06:04 PM
RE: LocInt's SF Help & Request Thread - by Person8880 - 14-05-2015, 06:06 PM
RE: LocInt's SF Help & Request Thread - by SuperPlayer - 14-05-2015, 06:24 PM
RE: LocInt's SF Help & Request Thread - by Salira - 16-05-2015, 05:46 PM

  • View a Printable Version
Forum Jump:


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

Powered By MyBB, © 2002-2026 MyBB Group.