• Client doesn't download entity from hosted server.
    8 replies, posted
I am currently hosting a test server running the latest DarkRP gamemode, and I'm having some troubles getting my entity in the Entities tab(Q menu). My client just simply does not download the LUA files and I have no idea why. I have made ENT.AdminSpawnable = true. Here is what I have done. I have uploaded the cl_init.lua, init.lua, shared.lua files into XXX.XXX.XX.XXX_port_27015/orangebox/garrysmod/gamemodes/DarkRP/entities/entities/test_x I restart the server, connect to it. While I am connecting and retrieving server data I notice my client does not download the LUA files. My game initializes, I press Q, check entity tab.. Nothing. What did I forget/done wrong?
Did you remember to put the AddCSLuaFile lines in init.lua?
AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") Those are the top 3 lines, of init.lua. Will a faulty script still be downloaded to the client? Because if that is not the case. The probem will most likely be inside the script.
Please use [lua][/lua] tags I will fix this for you. [lua]AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua")[/lua] Those are the top 3 lines, of init.lua. Will a faulty script still be downloaded to the client? Because if that is the case. The probem will most likely be inside the script. [lua]AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") function ENT:Use(activator, caller) activator:SetJumpPower(400) self.Entity:Remove() end function ENT:SpawnFunction( ply, tr ) if ( !tr.Hit ) then return end local SpawnPos = tr.HitPos + tr.HitNormal * 16 local ent = ents.Create( self.Classname ) ent:SetPos( SpawnPos ) ent:Spawn() ent:Activate() return ent end function ENT:Initialize() self:SetModel( "models/katharsmodels/syringe_out/syringe_out.mdl" ) self:PhysicsInit( SOLID_VPHYSICS ) local phys = self:GetPhysicsObject() if phys:IsValid() then phys:Wake() end end end[/lua] There we go, added tags
I have managed to get it working. The script was faulty.
Are you using an editor like Notepad++? On top of syntax highlighting it has a collapsible statement block feature that can help you recognise having too many (or not enough) ends.
im runnig a mdoified version of darkrp, but i need the server to force download the models and sounds and stuff, so it dosnt give people a big error when they see it, ive tried some things, but nothing works, what can i do
Simple, you use [url=http://wiki.garrysmod.com/?title=resource.AddFile]resource.AddFile[/url] in your gamemode's init.lua
thank you sir
Sorry, you need to Log In to post a reply to this thread.