SetupDataTables() not networking from Entity -> Weapon?
4 replies, posted
I'm attempting to use a DataTable function in my swep I have, and it seems that when I use the SetupDataTable function on my Entity, then I set it, and then attempt to call it from my swep.
Seeing as SetupDataTable() creates the functions for example GetDifficulty and SetDifficulty. Here is what I'm doing on my swep:
[CODE]local ent = ply:GetEyeTraceNoCursor()
if ent:GetDifficulty() == "veasy" then
local forgive = 10
end[/CODE]
Yes, I am setting it. But, it doesn't matter seeing as the error isn't that GetDifficulty returns a nil value, it's that GetDifficulty is an invalid method.
and here is what I'm doing on my entity:
[CODE]function ENT:SetupDataTables()
self:NetworkVar("String", 0, "Difficulty")
end[/CODE]
According to the wiki, DataTables are better than NWVars, and were for the prediction of sweps. But I find it odd that SetDifficulty is an invalid method when I'm calling it from my swep. I would've used SetNWString and GetNWString but apparently GetNWString doesn't work on sweps.
Is the SetupDataTables in a shared file?
[QUOTE=Donkie;48016842]Is the SetupDataTables in a shared file?[/QUOTE]
It's in an entity, so yes.
GetEyeTraceNoCursor only returns a trace result, not an entity.
[QUOTE=Chessnut;48022383]GetEyeTraceNoCursor only returns a trace result, not an entity.[/QUOTE]
I'm pretty sure i included EyeTraceNoCursor().Entity, apparently not.
Sorry, you need to Log In to post a reply to this thread.