Just a small command that throws a shoe towards whoever/whatever.
localfunction ThrowShoe( Ply, Args )-- // Run checks hereif!Ply:Alive()thenreturnendif Ply.ShoeThrowDelay && Ply.ShoeThrowDelay >= CurTime()thenreturnend-- // Prevent stopping the player during velocity and from getting stuck if spawned underneath themselvesif Ply:EyeAngles().p >60thenreturnendlocal Shoe = ents.Create("prop_physics")
Shoe:SetModel("models/props_junk/shoe001a.mdl")-- // Make sure it does not get stuck on the player when throwing by pushing it forward
Shoe:SetPos( Ply:EyePos()+( Ply:GetAimVector()*35))
Shoe:SetAngles( Ply:GetAngles())
Shoe:Spawn()
Shoe:SetCollisionGroup(4)
Ply.ShoeThrowDelay = CurTime()+3local Phys = Shoe:GetPhysicsObject()if IsValid( Phys )then
Phys:SetVelocity( Ply:GetAimVector()*650)end-- // Delete shoe after a few seconds.
timer.Simple(5,function()if!IsValid( Shoe )thenreturnend
Shoe:Remove()end)end-- // Replace with whatever chat function the server uses.
ChatCommand.Add("/shoe", ThrowShoe )
Shoe command
in Archived
Posted
Just a small command that throws a shoe towards whoever/whatever.