So... How to make SWEP that teleports you to place where you aim?
Using self.Owner:SetPos(self.Owner:GetEyeTrace().HitPos)
I made a very simple tool for it ages ago (although this isn't a SWEP)-
[CODE]
TOOL.Category = "Poser"
TOOL.Name = "#Teleporter"
TOOL.Command = nil
TOOL.ConfigName = ''
if CLIENT then
language.Add("tool.stupidteleporter.name", "Teleporting Tool")
language.Add("tool.stupidteleporter.desc", "Teleports yourself")
language.Add("tool.stupidteleporter.0", "Left click to teleport. Right click does nothing.")
end
function TOOL:LeftClick( trace )
self:GetOwner():SetPos(trace.HitPos)
return true
end
function TOOL:RightClick( trace )
return false
end
[/CODE]
Note you might get stuck in walls and stuff since all it does is set a position without checking anything. It goes in 'lua\weapons\gmod_tool\stools'
Sorry, you need to Log In to post a reply to this thread.