So im trying to make it where when you buy an item out of the vending machine it will drop on the floor
[ERROR] addons/police_locker/lua/entities/drp_vend/init.lua:51: Tried to use a NULL entity!
1. GetPos - [C]:-1
2. func - addons/police_locker/lua/entities/drp_vend/init.lua:51
3. unknown - lua/includes/extensions/net.lua:32
Server Side line 51:
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) ) < LINE 51, LINE 51
button:Spawn()
end)
Your recievedent is invalid. Add a check to make sure it's valid/try to figure out why it's not valid.
You can tell it's the recievedent based on the second line of the stack trace where it notes the GetPos function being called. The only ent that GetPos is called on is recievedent.
im confused what do i do then?
i fixed it thank you!
Sorry, you need to Log In to post a reply to this thread.