mirror of
https://github.com/metrostroi-repo/MetrostroiAddon.git
synced 2026-05-04 00:52:33 +00:00
init
This commit is contained in:
33
lua/entities/gmod_track_horlift_signal/init.lua
Normal file
33
lua/entities/gmod_track_horlift_signal/init.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
include("shared.lua")
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Load key-values defined in VMF
|
||||
--------------------------------------------------------------------------------
|
||||
function ENT:KeyValue(key, value)
|
||||
self.VMF = self.VMF or {}
|
||||
self.VMF[key] = value
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
self.VMF = self.VMF or {}
|
||||
self.Type = (tonumber(self.VMF.Type) or 0)
|
||||
if self.Type == 0 then
|
||||
self:SetModel("models/metrostroi/signals/mus/light_2_horlift_out.mdl")
|
||||
else
|
||||
self:SetModel("models/metrostroi/signals/mus/light_2_horlift_in.mdl")
|
||||
end
|
||||
self:SetNWInt("Type",self.Type)
|
||||
|
||||
self.YellowSignal = true
|
||||
self.WhiteSignal = false
|
||||
|
||||
end
|
||||
function ENT:Think()
|
||||
self:SetNWBool("Yellow",self.YellowSignal)
|
||||
self:SetNWBool("White",self.WhiteSignal)
|
||||
self:SetNWBool("White2",self.PeopleGoing)
|
||||
self:NextThink(CurTime() + 0.50)
|
||||
return true
|
||||
end
|
||||
Reference in New Issue
Block a user