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 … 14 15 16 17 18 Next »
Release Scifi door
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Release Scifi door
25-10-2014, 12:08 PM, (This post was last modified: 25-10-2014, 12:21 PM by LocInt.)
#1
LocInt Offline
Long gone
****
Posts: 489
Threads: 91
Joined: Aug 2014
Scifi door
Here is my first release. Newest version can always be found in my shared folder.
Code:
--@name Scifi_door --@author LocInt --@model models/lt_c/sci_fi/door_airlock_96x192x16_frame.mdl if SERVER then local HoloLib = loadLibrary("holograms") local FindLib = loadLibrary("find") local EntLib = loadLibrary("ents") local PropLib = loadLibrary("props") local Entity = EntLib.self() local TimeLib = loadLibrary("time") local SoundLib = loadLibrary("sounds") local TableLib = loadLibrary("table") local GlobalLib= loadLibrary("globaltables") local Close = 0 local Open = 0 local function IsValid( Ent ) return Ent and Ent.isValid and Ent:isValid() end local function Filter( Ent ) -- check rank here. if Ent:isPlayer() then return true else return false end end function doorClose() DoorHolo:setAnim(3) TimeLib.timer( "BackToThink", 5, 1, function() DoorHolo:remove() DoorProp:setAlpha(1000) DoorProp:setMaterial("") DoorProp:setNotSolid(false) Open=0 end) end function doorOpen() DoorProp:setAlpha(1) DoorProp:setMaterial("models/props_canal/metalwall005b") DoorProp:setNotSolid(true) if(not IsValid(DoorHolo)) then DoorHolo = HoloLib.create( Entity:getPos(), Entity:ang(), "models/lt_c/sci_fi/door_airlock_96x192x16.mdl", 1 ) end DoorHolo:setAnim(2) DoorHolo:setSkin(2) TimeLib.timer( "DoorClose", 5, 1, function() doorClose() end) end local function think() local Players = find.inSphere(Entity:pos(), 100, Filter) if Players != nil then if #Players > 0 then for i,v in pairs(Players) do if v and IsValid(v) then if(Close == 0 and Open == 0) then Open=1 TimeLib.timer( "DoorOpen", 0.1, 1, function() doorOpen() end) break end end end end end end local function createDoor() DoorProp=FindLib.inSphere( ents.self():pos(), 100, function( Ent ) return Ent:model():lower()=="models/lt_c/sci_fi/door_airlock_96x192x16_static.mdl" end ) if(not IsValid(DoorProp[1])) then DoorProp = PropLib.create("models/lt_c/sci_fi/door_airlock_96x192x16_static.mdl",Entity:getPos(),Entity:ang()) DoorProp:setFrozen(true) DoorProp:parentTo(Entity) DoorProp:setSkin(1) Entity:setSkin(1) end TimeLib.timer( "Think", 1,0, function() think() end) end TimeLib.timer( "CreateDoor", 1,1, function() createDoor() end) end

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


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