• Falcos Prop Protection, DarkRP - get and set the owner.
    2 replies, posted
Hi. All the entities bought in the F4 shop gets owned by "World prop" in Falcos Prop Protection. I need my custom entity to be owned by the player who buys it. I've tried with the Money Printer code (that sets the name of the owner on the printer client side), but that actually broke FPP until I restarted - but of course, I can have made a mistake. ent:CPPISetOwner(), I tried to set this to owning_ent.
Under Initialize: [code] --init.lua self:CPPISetOwner(self.dt.owning_ent) self.SID = self.dt.owning_ent.SID [/code] Tis what I do. It shouldn't be counted as a world entity if your DarkRP and entity is set up correctly, did you throw owning_ent in the shared lua? [code] --shared.lua function ENT:SetupDataTables() self:NetworkVar("Entity", 1,"owning_ent") end [/code]
[QUOTE=MuteTM;42173290]Under Initialize: [code] --init.lua self:CPPISetOwner(self.dt.owning_ent) self.SID = self.dt.owning_ent.SID [/code] Tis what I do. It shouldn't be counted as a world entity if your DarkRP and entity is set up correctly, did you throw owning_ent in the shared lua? [code] --shared.lua function ENT:SetupDataTables() self:NetworkVar("Entity", 1,"owning_ent") end [/code][/QUOTE] [ERROR] gamemodes/darkrp/gamemode/fpp/sh_cppi.lua:46: attempt to index local 'ply' (a nil value) From line 23: self:CPPISetOwner(self.dt.owning_ent) self.SID = self.dt.owning_ent.SID shared.lua: function ENT:SetupDataTables() self:NetworkVar("Entity",1,"owning_ent") end
Sorry, you need to Log In to post a reply to this thread.