Probléme d'entity

  • Initiateur de la discussion G-F-CD TheFrench
  • Date de début
  • Initiateur de la discussion
G-F-CD TheFrench

G-F-CD TheFrench

namespace Arthur;
Messages
451
Score réaction
38
Points
140
Bonjour , J'aimerais faire un barre de chargement qui est relier a mon CurTime .


Merci .


Code:
AddCSLuaFile("shared.lua")
include("shared.lua")
function ENT:Initialize() self:SetModel( "models/props_interiors/refrigerator03.mdl" ) self:PhysicsInit( SOLID_VPHYSICS ) self:SetMoveType( MOVETYPE_VPHYSICS ) self:SetSolid( SOLID_VPHYSICS ) self.isRunning = false local phys = self:GetPhysicsObject() if (phys:IsValid()) then phys:Wake() end self.isBaking = false self.finishBakeTime = 0
end
function ENT:StartTouch(ent) if ent:GetClass() == "hot tea" and self.isBaking == false then ent:Remove() self.isBaking = true self.finishBakeTime = CurTime() + 8 end
end
function ENT:Think() if self.isBaking == true then if self.finishBakeTime <= CurTime() then self.isBaking = false local pa2 = ents.Create( "ice tea" ) pa2:SetPos(self:GetPos() + Vector(0,25,0)) pa2:Spawn() end end
end
 
Discord d'entraide
Rejoignz-nous sur Discord