I have a SENT which is assigned the variable VALUE before sending the entity and the variable its assigned separately to all players.
local cash=ents.Create("rw_cash") cash.Value=victim.Money local cashamount = cash.Value cash:SetPos(victim:GetPos()+Vector(0,0,50)) cash:Spawn() umsg.Start("DroppedCash"); umsg.Entity(cash); umsg.Short(cashamount); umsg.End()
I want the player to receive the ENT in question and the value given to it. With these two things the player would see the amount drawn above the cash with a simple Paint hook I’m sure works.
function cash(um) local ent = um:ReadEntity() print(ent) local short = um:ReadShort() print(short) ent.Value = short print(ent.Value) end usermessage.Hook("DroppedCash", cash)
The ent and short are both received correctly, but I want to assign the value to the ENT clientside. But this is where I run into trouble.
When I print the ENT’s value it always returns nil. What do?
Also, I tried replacing what ent.Value equals from the var short to a string: “hello”
It still did not work.