I have decompiled the old Pikmin add-on for Garry's Mod because it's producing the following error:
[ERROR] workshop/lua/sv_pikmin.lua:38: attempt to call global 'ValidEntity' (a nil value) 1. v - workshop/lua/sv_pikmin.lua:38 2. Call - lua/includes/modules/hook.lua:84 3. unknown - gamemodes/sandbox/entities/weapons/gmod_tool/shared.lua:279
This section of code is on line 38:
local function DontToolMe(ply, tr, tool)
if (ValidEntity(tr.Entity) && tr.Entity:GetClass() == "pikmin_onion" || tr.Entity:GetClass() == "pikmin" || tr.Entity:GetClass() == "pikmin_model") then
if (tool == "duplicator") then
return false;
end
end
return true;
end
Line 38 is specifically the "if" statement with the "ValidEntity" keyword.
I would like to somehow be able to update this fantastic add-on so we can use it along with the tool-gun.
I have the whole project here: https://drive.google.com/file/d/0Bwr6tf5HSyxyRXZ0c2VkQmEtU2M/view?usp=sharing
Thanks, Pikmin25.