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
Pages (2): 1 2 Next »
Threaded Mode
LocInt's SF Help & Request Thread
11-12-2014, 05:55 PM,
#1
LocInt Offline
Long gone
****
Posts: 489
Threads: 91
Joined: Aug 2014
Heart  LocInt's SF Help & Request Thread
Hello,

Im kind of bored and I want something do. I can simply help you with your script or write it for you.

There is certain restrictions:

-The script you're requesting is something cool.
-You post the whole function and all functions related to the function you have issue with.
-I do only screens and processors.

тѕсм.Person8880 hovers the nerf bat over Tetryon damage
Website Find
Reply
11-12-2014, 06:13 PM,
#2
Wirebuilder28 Offline
TSCM Member
***
Posts: 13
Threads: 4
Joined: Jun 2014
Star  RE: LocInt's SF Help & Request Thread
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)

Insert sound effect of your liking here
Find
Reply
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
11-12-2014, 07:21 PM,
#4
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: LocInt's SF Help & Request Thread
I'd like to point out that the loadLibrary code you have is entirely pointless. What it's doing is essentially:

wire = wire
ents = ents
find = find

All libraries are in the global table already, loadLibrary should be avoided as it's useless, deprecated and will eventually be removed.

Also, for Starfall code on the forums, use the lua tags rather than the code tags as it formats nicely.
Find
Reply
11-12-2014, 07:34 PM,
#5
LocInt Offline
Long gone
****
Posts: 489
Threads: 91
Joined: Aug 2014
RE: LocInt's SF Help & Request Thread
(11-12-2014, 07:21 PM)Person8880 Wrote: I'd like to point out that the loadLibrary code you have is entirely pointless. What it's doing is essentially:

wire = wire
ents = ents
find = find

All libraries are in the global table already, loadLibrary should be avoided as it's useless, deprecated and will eventually be removed.

Also, for Starfall code on the forums, use the lua tags rather than the code tags as it formats nicely.

I bet you know as a coder how hard is it to let go of coding habits. 8D

тѕсм.Person8880 hovers the nerf bat over Tetryon damage
Website Find
Reply
11-12-2014, 07:40 PM,
#6
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: LocInt's SF Help & Request Thread
Sure, but for wirebuilder as a new coder to Starfall, it's better for him not to learn the old, bad habits. Tongue
Find
Reply
11-12-2014, 07:41 PM,
#7
LocInt Offline
Long gone
****
Posts: 489
Threads: 91
Joined: Aug 2014
RE: LocInt's SF Help & Request Thread
(11-12-2014, 07:40 PM)Person8880 Wrote: Sure, but for wirebuilder as a new coder to Starfall, it's better for him not to learn the old, bad habits. Tongue

Agreed. Im pretty sure the old habits came from me to T-16 and then to everyone else. Blush

тѕсм.Person8880 hovers the nerf bat over Tetryon damage
Website Find
Reply
11-12-2014, 09:01 PM,
#8
TheOneAndOnlyTee Offline
GMod Admin
Posts: 755
Threads: 47
Joined: Oct 2013
RE: LocInt's SF Help & Request Thread
yeah i may have passed that on but still Wirebuilder great progress

Steam Profile
My Discord Server
Need help with E2 or SF? , just ask me and i'll try to help.
[Image: 98Dkcoz.gif]
Find
Reply
11-12-2014, 11:28 PM,
#9
Blackhawk Offline
GMod Admin
Posts: 204
Threads: 9
Joined: Sep 2013
RE: LocInt's SF Help & Request Thread
Also this isn't lua syntax:
if target and pos != Vector( 0,0,0 ) then ... end
Use "~=" instead of "!=". The correct syntax is:
if target and pos ~= Vector( 0,0,0 ) then ... end
Find
Reply
11-12-2014, 11:41 PM,
#10
LocInt Offline
Long gone
****
Posts: 489
Threads: 91
Joined: Aug 2014
RE: LocInt's SF Help & Request Thread
(11-12-2014, 11:28 PM)_BL4CKH4WK Wrote: Also this isn't lua syntax:
if target and pos != Vector( 0,0,0 ) then ... end
Use "~=" instead of "!=". The correct syntax is:
if target and pos ~= Vector( 0,0,0 ) then ... end

I know that was for wire but my opinion:

I don't really care if its deprecated to use "!=" because this is not real lua we write here. If person would rename all functions like in lua and add those useful lua functions which person call "cheaty" then I would start to write correct lua.

тѕсм.Person8880 hovers the nerf bat over Tetryon damage
Website Find
Reply
« Next Oldest | Next Newest »
Pages (2): 1 2 Next »


  • 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.