Skip to content

Instantly share code, notes, and snippets.

@codeliger
Created January 3, 2015 05:10
Show Gist options
  • Save codeliger/147f5f2210018202e6a1 to your computer and use it in GitHub Desktop.
Save codeliger/147f5f2210018202e6a1 to your computer and use it in GitHub Desktop.
-- get map constraints
-- set global variables
-- register configurable variables
-- register gui
TOOL.Category = "Precision"
TOOL.Name = "Nudger"
TOOL.ClientConVar[ "nudge_val" ] = "1"
TOOL.ClientConVar[ "nudge_min" ] = "1"
TOOL.ClientConVar[ "nudge_max" ] = "100"
function TOOL:Deploy()
print(table.ToString(self, "Self", true))
end
function TOOL.Nudge(t)
-- Validate Map Constraints
-- Nudge (Push or Pull)
end
function TOOL.isPropOwner(ent)
return not ent:IsWorld() && ent:GetOwner() == LocalPlayer()
end
function TOOL:LeftClick(t)
print(LocalPlayer():isPropOwner(t.Entity))
-- Push Entity
self:Nudge(t)
end
function TOOL:RightClick(t)
-- Pull Entity
self:Nudge(t)
end
function TOOL.Reload()
-- Undo Nudge History
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment