Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin RotateQuill
- ; Local script applied to unique quill.
- ; Quill floats and rotates to face specific
- ; coordinates when placed on the ground.
- ; Requires Tribunal for GetSquareRoot.
- float FixedX
- float FixedY
- float GetX
- float GetY
- float Math
- short NewAng
- short OnPCDrop
- if ( MenuMode )
- return
- endif
- if ( OnPCDrop == 0 )
- return
- elseif ( OnPCDrop )
- set OnPCDrop to 0
- endif
- set GetX to ( XCoordinate - ( GetPos, X ) )
- set FixedX to GetX
- if ( GetX < 0 )
- set GetX to ( 0 - GetX )
- endif
- set GetY to ( YCoordinate - ( GetPos, Y ) )
- set FixedY to GetY
- if ( GetY < 0 )
- set GetY to ( 0 - GetY )
- endif
- set Math to ( ( GetX * GetX ) + ( GetY * GetY ) )
- set Math to ( GetX / ( GetSquareRoot, Math ) )
- if ( Math < 0.767 )
- if ( Math < 0.18 )
- set NewAng to 5
- elseif ( Math >= 0.18 )
- if ( Math < 0.26 )
- set NewAng to 10
- elseif ( Math >= 0.26 )
- if ( Math < 0.35 )
- set NewAng to 15
- elseif ( Math >= 0.35 )
- if ( Math < 0.43 )
- set NewAng to 20
- elseif ( Math >= 0.43 )
- if ( Math < 0.5 )
- set NewAng to 25
- elseif ( Math >= 0.5 )
- if ( Math < 0.575 )
- set NewAng to 30
- elseif ( Math >= 0.575 )
- if ( Math < 0.643 )
- set NewAng to 35
- elseif ( Math >= 0.643 )
- if ( Math < 0.708 )
- set NewAng to 40
- elseif ( Math >= 0.708 )
- set NewAng to 45
- endif
- endif
- endif
- endif
- endif
- endif
- endif
- endif
- elseif ( Math >= 0.767 )
- if ( Math < 0.82 )
- set NewAng to 50
- elseif ( Math >= 0.82 )
- if ( Math < 0.87 )
- set NewAng to 55
- elseif ( Math >= 0.87 )
- if ( Math < 0.907 )
- set NewAng to 60
- elseif ( Math >= 0.907 )
- if ( Math < 0.94 )
- set NewAng to 65
- elseif ( Math >= 0.94 )
- if ( Math < 0.966 )
- set NewAng to 70
- elseif ( Math >= 0.966 )
- if ( Math < 0.986 )
- set NewAng to 75
- elseif ( Math >= 0.986 )
- if ( Math < 0.997 )
- set NewAng to 80
- elseif ( Math >= 0.997 )
- if ( Math < 1 )
- set NewAng to 85
- elseif ( Math == 1 )
- set NewAng to 90
- endif
- endif
- endif
- endif
- endif
- endif
- endif
- endif
- endif
- if ( FixedX > 0 )
- if ( FixedY == 0 )
- set NewAng to 180
- elseif ( FixedY > 0 )
- set NewAng to ( 180 + NewAng )
- elseif ( FixedY < 0 )
- set NewAng to ( 360 - NewAng )
- endif
- elseif ( FixedX < 0 )
- if ( FixedY == 0 )
- set NewAng to 0
- elseif ( FixedY > 0 )
- set NewAng to ( 180 - NewAng )
- endif
- elseif ( FixedX == 0 )
- if ( FixedY == 0 )
- set NewAng to 0
- SetAngle, X, 270
- elseif ( FixedY > 0 )
- set NewAng to 270
- elseif ( FixedY < 0 )
- set NewAng to 90
- endif
- endif
- set Math to ( ( Player->GetPos, Z ) + 55 )
- SetPos, Z, Math
- SetAngle, Z, NewAng
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement