• Need help with when buy an item drops on floor
    1 replies, posted
when i click purchase trying to make it where the food goes on the floor then you can eat it off the floor or goes in your inventory it gives me this error [ERROR] addons/police_locker/lua/entities/drp_vend/init.lua:48: attempt to call field 'Readentity' (a nil value)   1. func - addons/police_locker/lua/entities/drp_vend/init.lua:48    2. unknown - lua/includes/extensions/net.lua:32 SERVER SIDE net.Receive("GivePoliceVending", function(len, pl) local button = ents.Create( "gmod_button" ) local recievedent = net.Readentity() if ( !IsValid( button ) ) then return end button:SetModel( "models/dav0r/buttons/button.mdl" ) button:SetPos( recievedent :GetPos()+(recievedent :GetForward()*10) ) button:Spawn() end) CLIENT SIDE local vendingmachinebutton = vgui.Create( "DButton", vendingmachinebackkkk) vendingmachinebutton:SetPos( 200, 15) vendingmachinebutton:SetSize( 300, 600) vendingmachinebutton:SetFont( "buytext" ) vendingmachinebutton:SetTextColor( Color(200,200,200,200) ) vendingmachinebutton:SetExpensiveShadow( 2, Color(0,0,0, 200) ) vendingmachinebutton:SetText( "" ) vendingmachinebutton.Paint = function( self, w, h ) draw.RoundedBox( 0, 0, 0,self:GetWide(),self:GetTall(),Color(40,40,40,0)) draw.SimpleText( PoliceLocker.Config.Language.PurchaseButton, "buytext", 30, 2, Color( 200, 200, 200, 200 ) ) end function vendingmachinebutton:DoClick() net.Start("GivePoliceVending") net.WriteString( k ) net.WriteEntity( drp_vend ) net.SendToServer() end
Try and change net.Readentity() To net.ReadEntity()
Sorry, you need to Log In to post a reply to this thread.