I keep getting the Unpooled message error. But on serverside, I have declared it.
Serverside:
[CODE]
AddCSLuaFile( "../client/jhinv.lua" )
util.AddNetworkString( "InvSave" )
whitelist = {"door"}
function chatCommand(ply, text, public)
if (string.sub(text, 1, 6) == "/trade") then
print('Attempting to trade')
return(false)
end
end
hook.Add("PlayerSay", "chatCommand", chatCommand)
function InvSave( ) {
ent = net.ReadEntity()
for k,v in pairs(whitelist) do
if string.find(string.lower(trace.Entity.weaponclass), v) then
print("This can be put in your inventory")
return
end
end
print(trace.Entity.weaponclass)
}
net.Receive( "InvSave", InvSave )
[/CODE]
Clientside:
[CODE]
whitelist = {"door"}
local function KeyPress()
if input.IsKeyDown(KEY_LALT) and input.IsKeyDown(KEY_E) then
--self.Weapon:SetNextPrimaryFire(CurTime() + 0.2)
trace = LocalPlayer():GetEyeTrace()
if not IsValid(trace.Entity) or (SERVER and trace.Entity:IsPlayerHolding()) then
return
end
if LocalPlayer():EyePos():Distance(trace.HitPos) > 150 then
return
end
net.Start( "InvSave" )
net.SendToServer()
end
end
hook.Add("Think", "KeyPress", KeyPress)
[/CODE]
[B]Edit: [/B]Thanks for the correction. I really failed there..
why are you using {'s in the function InvSave that is not valid lua syntax and you are not even ending the function.
Wow. That sux. :P
Why does Lua have to be like that.
Solved it.
[QUOTE=jonasrh;42583690]Wow. That sux. :P
Why does Lua have to be like that.
Solved it.[/QUOTE]
There isn't a programming language on earth that doesn't require you to end your functions in some way, pal.
Sorry, you need to Log In to post a reply to this thread.