Hi.
First , yes i know there is 999999 thread about it , but actually i’m completly lost.
When i try to reproduce something it never works.
Actually that’s what i’ve :
https://image.noelshack.com/fichiers/2017/44/3/1509569455-dossiers.png
So actually i want call a variable that is in the “cl_init.lua” file of the “Bucket” folder called BWaterAmount
in to the “init.lua” file of the “Water Container” folder.
cl_init.lua of Bucket :
include("shared.lua")
BWaterAmount = 2
surface.CreateFont( "TheDefaultSettings", {
font = "Arial", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
extended = true,
size = 40,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true,
underline = false,
italic = false,
strikeout = false,
symbol = false,
rotary = false,
shadow = true,
additive = false,
outline = false,
} )
function ENT:Draw()
self.Entity:DrawModel()
cam.Start3D2D(self:GetPos() + Vector(0,-9,10), Angle(0, 0, 90), 0.1)
draw.DrawText("Bucket","TheDefaultSettings",0,-15,Color(120,120,255),1,1)
draw.DrawText("Water"..BWaterAmount,"TheDefaultSettings",0,45,Color(240,195,0),1,1)
cam.End3D2D()
end
init.lua of Water Container :
AddCSLuaFile('cl_init.lua')
AddCSLuaFile('shared.lua')
include('shared.lua')
function ENT:Initialize( )
self:SetModel( "models/props_borealis/bluebarrel001.mdl" )
self:PhysicsInit( SOLID_VPHYSICS )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_BBOX )
self:SetUseType( SIMPLE_USE )
self:DrawShadow( false )
end
function ENT:Touch( ent )
if ent:IsPlayer() then
local effectdata = EffectData()
effectdata:SetOrigin( self:GetPos() )
effectdata:SetScale(1)
end
end
function ENT:StartTouch(ent)
if ent:GetClass() == "bucket" then
print ("Water:"..BWaterAmount)
end
end
So actually what should i add on these 2 files ?