YOU NEED setPos AND setAng FOR THIS TO WORK!
Hello everyone 
this time i made something which is fo Builders who liked Physgun Buildmode
but... after the new update of Garry's mod its broken...
so I made a simple Version of it.
[Chat Commands:]
$help -> Prints Help to your Chat.
$posprec -> <Position Precision> changes the Precision ofPposition snaping.
$angprec -> <Angle Precision> changes the Precision of Angle snaping.
[What it does]
if you grab a prop and freeze it in the air (or somewhere else) it will instantly snap the position
and the angles i.E. :
if you hold a Prop at Position[0.755, 751.577, 1337.7331] it automaticly snaps in: [1, 752, 1338].
You know ?
And the same Sheme for the Angles
Thats it
here is the code:
Code:
@name Physgun Buildmode
@persist [Pos Chat_Color]:vector Ang:angle
@persist Position_Precision Angle_Precision
@persist Freeze Frozen
runOnTick(1)
runOnChat(1)
if(first()){
Chat_Color = vec(125,0,0)
Angle_Precision = 11.25
Position_Precision = 2
printColor(Chat_Color,"Physgun Buildmode [E2 Version] by MPAP Activated")
printColor(Chat_Color,"Angle Precision set to "+Angle_Precision)
printColor(Chat_Color,"Position Precision set to "+Position_Precision)
printColor(Chat_Color,"Tip: you can chage The Angle/Position-Precision")
printColor(Chat_Color,"Though the chat by saying: '$angprec <Angle Precision>'")
printColor(Chat_Color,"or '$posprec <Position Precision>'")
printColor(Chat_Color,"You can show this message again by saying: '$help'")
}
O = owner()
AE = O:aimEntity()
Freeze = O:keyAttack2()
LS = O:lastSaid():lower()
LSE = LS:explode(" ")
Said = chatClk(O)
if(Said & LSE[1,string]=="$help"){
hideChat(1)
printColor(Chat_Color,"Tip: you can chage The Angle/Position-Precision")
printColor(Chat_Color,"Though the chat by saying: '$angprec <Angle Precision>'")
printColor(Chat_Color,"or '$posprec <Position Precision>'")
printColor(Chat_Color,"You can show this message again by saying: '$help'")
}
if(Said & LSE[1,string]=="$posprec"){
hideChat(1)
Position_Precision = LSE[2,string]:toNumber()
print("Set Position Precision: to "+Position_Precision)
}
if(Said & LSE[1,string]=="$angprec"){
hideChat(1)
Angle_Precision = LSE[2,string]:toNumber()
print("Set Angle Precision to: "+Angle_Precision)
}
Frozen = AE:isFrozen()
if(O:weapon():type():find("physgun") & Freeze & $Freeze){
Ang = AE:angles()
Pos = AE:pos()
AE:propFreeze(1)
AE:setPos(round(Pos/Position_Precision)*Position_Precision)
AE:setAng(round(Ang/Angle_Precision)*Angle_Precision)
ModelArr = AE:model():replace("_"," "):replace(".mdl",""):explode("/")
hint("Set Position of '"+ModelArr[ModelArr:count(),string]+"' to "+toString(round(AE:pos()/0.01)*0.01):replace(",",", "),5)
hint("Set Angle of '"+ModelArr[ModelArr:count(),string]+"' to "+toString(round(AE:angles()/0.01)*0.01):replace(",",", "),5)
} Please comment ^_^
Bookmarks