Run it
Copy the script and paste it into your executor.
Players = :()
RunService = :()
UIS = :()
GuiService = :()
SoundService = :()
Debris = :()
(() == .new, )
plr = Players.LocalPlayer
env = ( ())
env.WuzSniperCleanup (env.WuzSniperCleanup)
.WuzSniperStop =
.WuzSniperSmooth == .WuzSniperSmooth =
.WuzSniperCustomMove == .WuzSniperCustomMove =
.WuzSniperSeeBody == .WuzSniperSeeBody =
.WuzSniperDeleteWorld == .WuzSniperDeleteWorld =
.WuzSniperIgnoreAccessories == .WuzSniperIgnoreAccessories =
.WuzSniperAutoRescope == .WuzSniperAutoRescope =
.WuzSniperRecoilKick == .WuzSniperRecoilKick =
.WuzSniperBreathSway == .WuzSniperBreathSway =
.WuzSniperCrosshair == .WuzSniperCrosshair =
.WuzSniperScopeBlur == .WuzSniperScopeBlur =
.WuzSniperVolume == .WuzSniperVolume =
.WuzSniperMute == .WuzSniperMute =
.WuzSniperAimAssist == .WuzSniperAimAssist =
.WuzSniperAimAssistCone == .WuzSniperAimAssistCone =
.WuzSniperAimAssistStrength == .WuzSniperAimAssistStrength =
RENDER_STEP_NAME =
THEMES = {
{
name = ,
armor = .(, , ), frame = .(, , ),
trim = .(, , ), piston = .(, , ),
glow = .(, , ), core = .(, , ),
gearDark = .(, , ), gearCloth = .(, , ),
gearArmor = .(, , ), gearAccent = .(, , ),
gearLeather = .(, , ), brass = .(, , ),
visor = .(, , ), optic = .(, , ),
},
{
name = ,
armor = .(, , ), frame = .(, , ),
trim = .(, , ), piston = .(, , ),
glow = .(, , ), core = .(, , ),
gearDark = .(, , ), gearCloth = .(, , ),
gearArmor = .(, , ), gearAccent = .(, , ),
gearLeather = .(, , ), brass = .(, , ),
visor = .(, , ), optic = .(, , ),
},
{
name = ,
armor = .(, , ), frame = .(, , ),
trim = .(, , ), piston = .(, , ),
glow = .(, , ), core = .(, , ),
gearDark = .(, , ), gearCloth = .(, , ),
gearArmor = .(, , ), gearAccent = .(, , ),
gearLeather = .(, , ), brass = .(, , ),
visor = .(, , ), optic = .(, , ),
},
{
name = ,
armor = .(, , ), frame = .(, , ),
trim = .(, , ), piston = .(, , ),
glow = .(, , ), core = .(, , ),
gearDark = .(, , ), gearCloth = .(, , ),
gearArmor = .(, , ), gearAccent = .(, , ),
gearLeather = .(, , ), brass = .(, , ),
visor = .(, , ), optic = .(, , ),
},
{
name = ,
armor = .(, , ), frame = .(, , ),
trim = .(, , ), piston = .(, , ),
glow = .(, , ), core = .(, , ),
gearDark = .(, , ), gearCloth = .(, , ),
gearArmor = .(, , ), gearAccent = .(, , ),
gearLeather = .(, , ), brass = .(, , ),
visor = .(, , ), optic = .(, , ),
},
}
V, C = .new, .new
(x, y, z, rx, ry, rz)
(x, y, z) * .(.(rx ), .(ry ), .(rz ))
(axis, x, y, z, rx, ry, rz)
r = (axis == .(, , .())) (axis == .(, .(), )) .identity
(x, y, z, rx, ry, rz) * r
(name, shape, cf, sz, role, prio, flags)
flags = flags
{
name = name, shape = shape , cf = cf, sz = sz, role = role, prio = prio ,
isBody = .(flags, , , ) ~= ,
isHead = .(flags, , , ) ~= ,
isArm = .(flags, , , ) ~= ,
fxType = (flags ~= .(flags, , ) == ) .(flags, ) ,
}
ARM_UPPER_LEN =
ARM_FORE_LEN =
LEG_THIGH_LEN =
LEG_SHIN_LEN =
BONE_ORDER = {
, , ,
, , ,
, , ,
, , ,
, , , ,
, , , , ,
, , ,
, , ,
,
}
BONE_WEAPON = {
Rifle = , Bolt = , BoltHandle = , Trigger = , Mag = ,
AK47 = , AK_Mag = , AK_Bolt = ,
Deagle = , Deagle_Slide = , Deagle_Mag = ,
}
MODEL_SPEC = {
Pelvis = {
(, , (, , ), (, , ), , , ),
(, , (, -, -, , , ), (, , ), , , ),
(, , (, -, ), (, , ), , , ),
(, , (-, -, ), (, , ), , , ),
(, , (, -, ), (, , ), , , ),
(, , (, , ), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (-, , -, , , ), (, , ), , , ),
(, , (-, , , -, , ), (, , ), , , ),
(, , (, , , , -, -), (, , ), , , ),
},
Torso = {
(, , (, , ), (, , ), , , ),
(, , (-, , , , , ), (, , ), , , ),
(, , (, , , , -, ), (, , ), , , ),
(, , (, , ), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, , ), (, , ), , , ),
(, , (, , , , , ), (, , ), , , ),
(, , (-, , , , , ), (, , ), , , ),
(, , (, , , , -, ), (, , ), , , ),
(, , (-, , , , , -), (, , ), , , ),
(, , (, , , , , ), (, , ), , , ),
(, , (, , , ), (, , ), , , ),
(, , (-, , -), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, , ), (, , ), , , ),
(, , (, , , , , ), (, , ), , , ),
(, , (-, , ), (, , ), , , ),
(, , (-, , -), (, , ), , , ),
(, , (, -, , , -, , ), (, , ), , , ),
},
Head = {
(, , (, , , ), (, , ), , , ),
(, , (, , ), (, , ), , , ),
(, , (, , -, , , ), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, , , -), (, , ), , , ),
(, , (, -, , -, , ), (, , ), , , ),
(, , (, , , -, , -), (, , ), , , ),
(, , (, , ), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, , , , , ), (, , ), , , ),
(, , (, , ), (, , ), , , ),
(, , (-, , -, -, , ), (, , ), , , ),
(, , (, , -, -, , ), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, , -, -, , ), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, , ), (, , ), , , ),
(, , (, -, , ), (, , ), , , ),
(, , (, , , ), (, , ), , , ),
(, , (, -, , -, -, -), (, , ), , , ),
},
ThighL = {
(, , (, , , -LEG_THIGH_LEN * ), (, , ), , , ),
(, , (, , , -LEG_THIGH_LEN * ), (, , ), , , ),
(, , (-, , -, , , ), (, , ), , , ),
(, , (, , , -), (, , ), , , ),
(, , (, , -LEG_THIGH_LEN), (, , ), , , ),
(, , (, , -LEG_THIGH_LEN), (, , ), , , ),
(, , (, , -LEG_THIGH_LEN), (, , ), , , ),
},
ShinL = {
(, , (, , -, -LEG_SHIN_LEN * ), (, , ), , , ),
(, , (, , , -LEG_SHIN_LEN * ), (, , ), , , ),
(, , (, , , -LEG_SHIN_LEN * ), (, , ), , , ),
(, , (, , -LEG_SHIN_LEN * ), (, , ), , , ),
},
FootL = {
(, , (, , , ), (, , ), , , ),
(, , (, -, ), (, , ), , , ),
(, , (, -, -), (, , ), , , ),
(, , (, -, -), (, , ), , , ),
(, , (, -, -), (, , ), , , ),
},
ThighR = {
(, , (, , , -LEG_THIGH_LEN * ), (, , ), , , ),
(, , (, , , -LEG_THIGH_LEN * ), (, , ), , , ),
(, , (, , , -), (, , ), , , ),
(, , (, , , -), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, -, -, , , -), (, , ), , , ),
(, , (, , -LEG_THIGH_LEN), (, , ), , , ),
(, , (, , -LEG_THIGH_LEN), (, , ), , , ),
(, , (, , -LEG_THIGH_LEN), (, , ), , , ),
},
ShinR = {
(, , (, , -, -LEG_SHIN_LEN * ), (, , ), , , ),
(, , (, , , -LEG_SHIN_LEN * ), (, , ), , , ),
(, , (, , , -LEG_SHIN_LEN * ), (, , ), , , ),
(, , (, , -LEG_SHIN_LEN * ), (, , ), , , ),
},
FootR = {
(, , (, , , ), (, , ), , , ),
(, , (, -, ), (, , ), , , ),
(, , (, -, -), (, , ), , , ),
(, , (, -, -), (, , ), , , ),
(, , (, -, -), (, , ), , , ),
},
UpperArmL = {
(, , (, , -), (, , ), , , ),
(, , (, , , -ARM_UPPER_LEN * ), (ARM_UPPER_LEN, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, , -ARM_UPPER_LEN), (, , ), , , ),
(, , (, , -ARM_UPPER_LEN), (, , ), , , ),
},
ForearmL = {
(, , (, , , -), (, , ), , , ),
(, , (, , , -ARM_FORE_LEN * ), (, , ), , , ),
(, , (, , , -ARM_FORE_LEN * ), (, , ), , , ),
(, , (, , , -ARM_FORE_LEN + ), (, , ), , , ),
},
HandL = {
(, , (, , -), (, , ), , , ),
(, , (, , ), (, , ), , , ),
(, , (, , ), (, , ), , , ),
(, , (, , ), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (-, -, -, , , ), (, , ), , , ),
(, , (, -, -, , , ), (, , ), , , ),
(, , (, , , -, -, -), (, , ), , , ),
},
UpperArmR = {
(, , (, , -), (, , ), , , ),
(, , (, , , -ARM_UPPER_LEN * ), (ARM_UPPER_LEN, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, , -ARM_UPPER_LEN), (, , ), , , ),
(, , (, , -ARM_UPPER_LEN), (, , ), , , ),
},
ForearmR = {
(, , (, , , -), (, , ), , , ),
(, , (, , , -ARM_FORE_LEN * ), (, , ), , , ),
(, , (, , , -ARM_FORE_LEN * ), (, , ), , , ),
(, , (, , , -ARM_FORE_LEN + ), (, , ), , , ),
},
HandR = {
(, , (, , -), (, , ), , , ),
(, , (, , ), (, , ), , , ),
(, , (, , -), (, , ), , , ),
(, , (, -, -, , , ), (, , ), , , ),
(, , (, -, , -, -, ), (, , ), , , ),
},
TriggerFinger = {
(, , (, -, -), (, , ), , , ),
},
Rifle = {
(, , (, -, ), (, , ), , ),
(, , (, -, ), (, , ), , ),
(, , (, -, ), (, , ), , ),
(, , (, -, , , , ), (, , ), , ),
(, , (, , , ), (, , ), , ),
(, , (, -, , ), (, , ), , ),
(, , (, , , ), (, , ), , ),
(, , (, , -, ), (, , ), , ),
(, , (, , , -, , ), (, , ), , ),
(, , (, -, , -, , ), (, , ), , ),
(, , (, -, , -, , ), (, , ), , ),
(, , (, -, ), (, , ), , ),
(, , (, -, -), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (-, , -, , , ), (, , ), , ),
(, , (, , -, , -, ), (, , ), , ),
(, , (-, -, -), (, , ), , ),
(, , (, -, -), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (, -, ), (, , ), , ),
(, , (, -, , , , ), (, , ), , ),
(, , (, -, , -, , ), (, , ), , ),
(, , (, -, -), (, , ), , ),
(, , (, -, -), (, , ), , ),
(, , (, -, -, , , ), (, , ), , ),
(, , (, -, -, -), (, , ), , ),
(, , (, -, -), (, , ), , ),
(, , (, -, -, -, , ), (, , ), , ),
(, , (, , -, -, , -), (, , ), , ),
(, , (, -, -, -, , ), (, , ), , ),
(, , (, , -, -, , -), (, , ), , ),
(, , (, , , -), (, , ), , ),
(, , (, , , -), (, , ), , ),
(, , (, , , -), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (, , , -), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (, , ), (, , ), , ),
(, , (, , , -), (, , ), , ),
(, , (, , , ), (, , ), , ),
(, , (, , , -), (, , ), , ),
(, , (, , , -), (, , ), , ),
(, , (, , , -), (, , ), , ),
(, , (, , , ), (, , ), , ),
(, , (, , , ), (, , ), , ),
(, , (-, , , , , ), (, , ), , ),
(, , (, , , -), (, , ), , ),
(, , (, , , -), (, , ), , ),
(, , (, -, , -), (, , ), , ),
(, , (, , , -), (, , ), , ),
(, , (, , , ), (, , ), , ),
},
Bolt = {
(, , (, , , -), (, , ), , ),
(, , (, , , ), (, , ), , ),
(, , (, , , ), (, , ), , ),
},
BoltHandle = {
(, , (, , , ), (, , ), , ),
(, , (, , -, , , -, -), (, , ), , ),
(, , (, -, ), (, , ), , ),
},
Trigger = {
(, , (, -, , , , ), (, , ), , ),
},
Mag = {
(, , (, -, , -, , ), (, , ), , ),
(, , (, -, -, -, , ), (, , ), , ),
(, , (, -, -, -, , ), (, , ), , ),
(, , (, , , -), (, , ), , ),
},
AK47 = {
(, , (, , ), (, , ), , ),
(, , (, -, ), (, , ), , ),
(, , (, -, , -, , , ), (, , ), , ),
(, , (, , , -, , , ), (, , ), , ),
(, , (, , ), (, , ), , ),
(, , (, , ), (, , ), , ),
(, , (, , -, , , ), (, , ), , ),
(, , (, , , -, -, , ), (, , ), , ),
(, , (, , , , , -), (, , ), , ),
(, , (, , , , , ), (, , ), , ),
(, , (, , ), (, , ), , ),
(, , (, , -, -, , ), (, , ), , ),
(, , (, , -, -, , ), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (-, , -, , , ), (, , ), , ),
(, , (, , -, , , -), (, , ), , ),
(, , (, , , -), (, , ), , ),
(, , (, , , -), (, , ), , ),
(, , (, , , -, -, , ), (, , ), , ),
(, , (, , -, -), (, , ), , ),
(, , (, , , -, , , ), (, , ), , ),
(, , (, , -, , , ), (, , ), , ),
(, , (, , -, -, , ), (, , ), , ),
(, , (, -, -), (, , ), , ),
(, , (-, -, -), (, , ), , ),
(, , (, -, -), (, , ), , ),
(, , (, , -, , , -), (, , ), , ),
(, , (, -, , -, , ), (, , ), , ),
(, , (-, -, , -, , ), (, , ), , ),
(, , (, -, ), (, , ), , ),
(, , (, -, , , , ), (, , ), , ),
(, , (, -, , , , ), (, , ), , ),
(, , (, -, -), (, , ), , ),
(, , (, , ), (, , ), , ),
(, , (, -, , -, , ), (, , ), , ),
(, , (, , , -, , ), (, , ), , ),
(, , (, -, , -, , ), (, , ), , ),
(, , (, , ), (, , ), , ),
(, , (, -, -, , , , ), (, , ), , ),
},
AK_Mag = {
(, , (, -, -, , , ), (, , ), , ),
(, , (, -, -, , , ), (, , ), , ),
(, , (, -, -, , , ), (, , ), , ),
(, , (, -, -, , , ), (, , ), , ),
(, , (-, -, -, , , ), (, , ), , ),
(, , (, , , -, , , ), (, , ), , ),
},
AK_Bolt = {
(, , (, , ), (, , ), , ),
(, , (, , , , , ), (, , ), , ),
},
Deagle = {
(, , (, -, -), (, , ), , ),
(, , (, -, -), (, , ), , ),
(, , (, -, , -, , ), (, , ), , ),
(, , (, -, , -, , ), (, , ), , ),
(, , (-, -, , -, , ), (, , ), , ),
(, , (, -, , -, , ), (, , ), , ),
(, , (, -, , -, , ), (, , ), , ),
(, , (, -, ), (, , ), , ),
(, , (, -, -), (, , ), , ),
(, , (, -, , , , ), (, , ), , ),
(, , (, , , -, , ), (, , ), , ),
(, , (-, , -), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (, , , -), (, , ), , ),
(, , (, , , -), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (-, , ), (, , ), , ),
},
Deagle_Slide = {
(, , (, , -), (, , ), , ),
(, , (, , ), (, , ), , ),
(, , (, , -), (, , ), , ),
(, , (, , ), (, , ), , ),
(, , (-, , ), (, , ), , ),
(, , (, , ), (, , ), , ),
(, , (, , -), (, , ), , ),
},
Deagle_Mag = {
(, , (, -, , -, , ), (, , ), , ),
(, , (, -, , -, , ), (, , ), , ),
},
FX = {
(, , .identity, (, , ), , , ),
(, , .identity, (, , ), , , ),
(, , .identity, (, , ), , , ),
(, , .identity, (, , ), , , ),
(, , .identity, (, , ), , , ),
(, , .identity, (, , ), , , ),
(, , .identity, (, , ), , , ),
},
}
BLUEPRINT = {}
_, boneName (BONE_ORDER)
_, spec (MODEL_SPEC[boneName])
spec.bone = boneName
spec.weaponId = BONE_WEAPON[boneName]
BLUEPRINT[#BLUEPRINT + ] = spec
TOTAL = #BLUEPRINT
WEAPONS = {
awp = {
slot = , name = , auto = , maxAmmo = ,
fireRate = , reloadTime = , equipTime = ,
fovADS = , hasScope = ,
recoilPos = (, , ),
recoilRot = (, , ),
damage = , kickPitch = , kickYaw = , kickRoll = ,
sfxFire = ,
},
ak47 = {
slot = , name = , auto = , maxAmmo = ,
fireRate = , reloadTime = , equipTime = ,
fovADS = , hasScope = ,
recoilPos = (, , ),
recoilRot = (, , ),
damage = , kickPitch = , kickYaw = , kickRoll = ,
sfxFire = ,
},
deagle = {
slot = , name = , auto = , maxAmmo = ,
fireRate = , reloadTime = , equipTime = ,
fovADS = , hasScope = ,
recoilPos = (, , ),
recoilRot = (, , ),
damage = , kickPitch = , kickYaw = , kickRoll = ,
sfxFire = ,
},
}
CFG = {
themeIdx = , baseFOV = , scopeFOV = , maxAmmo = ,
boltTime = , boltDelay = , reloadTime = , inspectTime = , equipTime = , holsterTime = ,
batchSize = , maxInflightBatches = , sendTick = , armStyle = ,
bulletSpeed = , bulletGravity = , bulletMaxDist = , bulletMaxLife = ,
runSpeed = , walkSpeed = , crouchSpeed = , scopeSpeed = ,
groundAccel = , groundFriction = , stopSpeed = , airAccel = , airWishCap = ,
dollyInStuds = , dollyOutStuds = , dollyInTime = , dollyBackTime = , dollyEquipTime = ,
}
STATE = {
alive = , epoch = , blocks = {}, r6Blocks = {}, unsupportedShapes = {},
holePool = {}, holeActive = {}, holeCarved = {},
inFlightBatches = , lastSendAt = , avgRTT = , sentParts = , sentBatches = , rejectCount = ,
cachedTool = , cachedEndpoint = , mustEquipTool = , checkedBackpack = , lastEquipTry = ,
connections = {}, savedBToolsGuis = {},
}
CTRL = {
weaponId = , primaryId = ,
ammoByWep = { awp = , ak47 = , deagle = },
fireHeld = , fireCooldown = ,
equipped = , transition = , transAlpha = , equipSettle = ,
aimHold = , aimToggle = , aimAlpha = , prevScoped = ,
ammo = , reloading = , reloadTimer = , reloadStage = , reloadFromEmpty = ,
boltTimer = , boltStage = , postShotHold = , inspecting = , inspectTimer = , inspectVariant = , triggerPull = ,
moveVelXZ = (), wallStuckTimer = , crouchHold = , crouchToggle = , crouching = ,
crouchAlpha = , walking = , leanAlpha = , inAir = , inAirAlpha = , wasInAir = ,
jumpBuffer = , landDip = , gaitPhase = , gaitAmp = , lastStepIdx = , lowerYaw = , turnStepAlpha = ,
timeAcc = , swayPitch = , swayYaw = , swayPosX = , swayPosY = , prevCamLook = ,
recoilPos = (), recoilRot = (), springPos = (), springPosVel = (), springRot = (), springRotVel = (),
fovKick = , shotKickPending = , lastLocalAimCF = , lastMuzzlePos = ,
fxTimer = , fxDuration = , fxMuzzlePos = (), fxMuzzleCF = .identity, fxHitPos = (), fxRoll = ,
shell = { active = , pos = (), vel = (), rot = (), angVel = (), age = , maxAge = },
projectiles = {}, activeF3XBullet = ,
savedCamMode = , savedMinZoom = , savedMaxZoom = , savedFOV = , savedMouseIcon = , savedSens = ,
savedWalkSpeed = , savedAutoRotate = , savedCameraOffset = , savedFaceTrans = {}, savedDefaultSounds = {},
dolly = { active = , phase = , t = , from = , to = , dur = }, pristineCam = ,
camRestored = , moveRestored = ,
serverBodyHidden = , bodyMaterialBusy = , bodyMaterialNextAt = ,
rayParams = , rayDirty = , currentTargetText = , currentTargetDist = , currentTargetHostile = ,
hitMarkerTimer = , hitMarkerHostile = , lastDeleteNote = , lastDeleteAt = ,
}
SFX = {
folder = ,
mode = .WuzSniperSoundMode ,
synthAssets = {},
robloxAssets = {
fire = { id = , vol = , spd = },
ak_fire = { id = , vol = , spd = },
deagle_fire = { id = , vol = , spd = },
bolt_up = { id = , vol = , spd = },
bolt_pull = { id = , vol = , spd = },
bolt_push = { id = , vol = , spd = },
shell_drop = { id = , vol = , spd = },
mag_out = { id = , vol = , spd = },
mag_in = { id = , vol = , spd = },
scope_in = { id = , vol = , spd = },
scope_out = { id = , vol = , spd = },
scope_zoom = { id = , vol = , spd = },
equip = { id = , vol = , spd = },
holster = { id = , vol = , spd = },
hit = { id = , vol = , spd = },
kill = { id = , vol = , spd = },
dryfire = { id = , vol = , spd = },
step = { id = , vol = , spd = , tp = },
land = { id = , vol = , spd = },
},
classicAssets = {
fire = { id = , vol = , spd = },
ak_fire = { id = , vol = , spd = },
deagle_fire = { id = , vol = , spd = },
bolt_up = { id = , vol = , spd = },
bolt_pull = { id = , vol = , spd = },
bolt_push = { id = , vol = , spd = },
shell_drop = { id = , vol = , spd = },
mag_out = { id = , vol = , spd = },
mag_in = { id = , vol = , spd = },
scope_in = { id = , vol = , spd = },
scope_out = { id = , vol = , spd = },
scope_zoom = { id = , vol = , spd = },
equip = { id = , vol = , spd = },
holster = { id = , vol = , spd = },
hit = { id = , vol = , spd = },
kill = { id = , vol = , spd = },
dryfire = { id = , vol = , spd = },
step = { id = , vol = , spd = , tp = },
land = { id = , vol = , spd = },
},
}
(sr, dur, genFn)
n = .(, .(sr * dur))
dataBytes = n *
hasBuf = ((buffer) == buffer.create buffer.writestring buffer.writeu32 buffer.writeu16 buffer.writei16 buffer.tostring)
lp, rng = ,
()
rng = (rng * + ) %
(rng / ) -
(x, cut)
lp = lp + cut * (x - lp)
lp
hasBuf
b = buffer.( + dataBytes)
buffer.(b, , )
buffer.(b, , + dataBytes)
buffer.(b, , )
buffer.(b, , )
buffer.(b, , )
buffer.(b, , )
buffer.(b, , sr)
buffer.(b, , sr * )
buffer.(b, , )
buffer.(b, , )
buffer.(b, , )
buffer.(b, , dataBytes)
i = , n -
s = .((i / sr, rand, lowpass), -, )
buffer.(b, + i * , .(s * ))
buffer.(b)
(v)
.(v % , .(v / ) % , .(v / ) % , .(v / ) % )
(v)
.(v % , .(v / ) % )
out = { , ( + dataBytes), , (), (), (), (sr), (sr * ), (), (), , (dataBytes) }
i = , n -
v = .(.((i / sr, rand, lowpass), -, ) * )
v < v +=
out[#out + ] = .(v % , .(v / ) % )
.(out)
()
old = SoundService:()
old (() old:() )
f = .()
f.Name =
f.Parent = SoundService
SFX.folder = f
getAsset = getcustomasset getsynasset
canSynth = ((writefile) == (getAsset) == )
canSynth
dir =
(makefolder) ==
(()
((isfolder) == ()) ()
)
(isfolder) ~= () dir =
sr =
specs = {
fire = { , (t, r, lp)
thump = .( * ( * .(-t * ) + ) * t) * .(-t * ) *
crack = () * .(-t * ) *
body = ((), .(, * .(-t * ))) * .(-t * ) *
echo = (t > ) (((), ) * .(-(t - ) * ) * )
ring = (.( * * t) + * .( * * t)) * .(-t * ) *
mix = (thump + crack + body + echo + ring) *
mix / ( + .(mix) * )
, },
ak_fire = { , (t, r, lp)
punch = .( * ( * .(-t * ) + ) * t) * .(-t * ) *
crack = () * .(-t * ) *
body = ((), .(, * .(-t * ))) * .(-t * ) *
mix = (punch + crack + body) *
mix / ( + .(mix) * )
, },
deagle_fire = { , (t, r, lp)
boom = .( * ( * .(-t * ) + ) * t) * .(-t * ) *
snap = () * .(-t * ) *
ring = .( * * t) * .(-t * ) *
mix = (boom + snap + ring) *
mix / ( + .(mix) * )
, },
bolt_up = { , (t, r)
click = .( * * t) * .(-t * ) * + .( * * t) * .(-t * ) *
click + () * .(-t * ) *
, },
bolt_pull = { , (t, r, lp)
scrape = ((), ) * .(.(, t / ) * .pi) *
stop = (t > ) (.( * * (t - )) * .(-(t - ) * ) * + () * .(-(t - ) * ) * )
scrape + stop
, },
bolt_push = { , (t, r, lp)
slide = ((), ) * .(-t * ) *
lock = (t > ) (.( * * .(-(t - ) * ) * (t - )) * .(-(t - ) * ) * + .( * * (t - )) * .(-(t - ) * ) * )
slide + lock
, },
shell_drop = { , (t)
b1 = (.( * * t) + * .( * * t)) * .(-t * ) *
b2 = (t > ) ((.( * * (t - )) + * .( * * (t - ))) * .(-(t - ) * ) * )
b1 + b2
, },
mag_out = { , (t, r, lp)
latch = .( * * t) * .(-t * ) *
slide = ((), ) * .(-t * ) *
latch + slide
, },
mag_in = { , (t, r)
slap = .( * ( * .(-t * ) + ) * t) * .(-t * ) *
click = (t > ) (.( * * (t - )) * .(-(t - ) * ) * )
slap + click + () * .(-t * ) *
, },
scope_in = { , (t, r) .( * * t) * .(-t * ) * + () * .(-t * ) * , },
scope_out = { , (t, r) .( * * t) * .(-t * ) * + () * .(-t * ) * , },
scope_zoom = { , (t) .( * * t) * .(-t * ) * , },
equip = { , (t, r, lp)
cloth = ((), ) * .(.(, t / ) * .pi) *
clink = (t > ) (.( * * (t - )) * .(-(t - ) * ) * )
cloth + clink
, },
holster = { , (t, r, lp) ((), ) * .(-t * ) * + .( * * t) * .(-t * ) * , },
hit = { , (t) (.( * * t) + * .( * * t)) * .(-t * ) * , },
kill = { , (t, r) (.( * * t) + * .( * * t)) * .(-t * ) * + () * .(-t * ) * , },
dryfire = { , (t, r) .( * * t) * .(-t * ) * + () * .(-t * ) * , },
step = { , (t, r, lp) .( * * .(-t * ) * t) * .(-t * ) * + ((), ) * .(-t * ) * , },
land = { , (t, r, lp) .( * * .(-t * ) * t) * .(-t * ) * + ((), ) * .(-t * ) * , },
}
allOk =
name, sp (specs)
path = dir .. .. name ..
fileReady = ((isfile) == (path))
fileReady
fileReady = (writefile, path, (sr, sp[], sp[]))
fileReady
okA, assetId = (getAsset, path)
okA (assetId) == assetId ~=
SFX.synthAssets[name] = { id = assetId, vol = sp[], spd = }
allOk = ;
allOk = ;
allOk SFX.synthAssets = {}
SFX.mode == (SFX.synthAssets)
SFX.mode =
(name, volMul, pitchMul)
.WuzSniperMute SFX.folder
bank = (SFX.mode == SFX.synthAssets[name] SFX.synthAssets)
(SFX.mode == SFX.robloxAssets)
SFX.classicAssets
info = bank[name] SFX.classicAssets[name]
info
s = .()
s.Name = .. name
s.SoundId = info.id
s.Volume = .((info.vol ) * (volMul ) * ((.WuzSniperVolume) ), , )
s.PlaybackSpeed = .((info.spd ) * (pitchMul ), , )
info.tp s.TimePosition = info.tp
s.Parent = SFX.folder
s:()
Debris:(s, )
(hrp, mute)
hrp
_, n ({ , , , })
s = hrp:(n)
s s:()
mute
CTRL.savedDefaultSounds[s] == CTRL.savedDefaultSounds[s] = s.Volume
s.Volume =
CTRL.savedDefaultSounds[s] ~=
s.Volume = CTRL.savedDefaultSounds[s]
CTRL.savedDefaultSounds[s] =
() plr.Character
(c)
c
hrp = c:()
hum = c:()
torso = c:() c:()
head = c:()
realParts = {}
_, inst (c:())
inst:() inst ~= hrp inst.Name ~= inst:()
realParts[#realParts + ] = inst
{ hrp = hrp, hum = hum, torso = torso, head = head, realParts = realParts }
()
c = ()
bc = c c:()
aL = c (c:() c:())
aR = c (c:() c:())
{
skinL = (bc bc.LeftArmColor3) (aL aL.Color) .(, , ),
skinR = (bc bc.RightArmColor3) (aR aR.Color) .(, , ),
}
()
STATE.cachedTool STATE.cachedTool:() STATE.cachedTool
c = ()
bp = plr:()
t = (c c:()) (bp bp:())
STATE.cachedTool = t
STATE.cachedEndpoint =
t
(hide)
pg = plr:()
pg
hide
_, g (pg:())
g:()
n = .(g.Name)
.(n, , , ) .(n, , , ) .(n, , , )
STATE.savedBToolsGuis[g] == STATE.savedBToolsGuis[g] = g.Enabled
g.Enabled =
g, was (STATE.savedBToolsGuis)
g g.Parent g.Enabled = was
STATE.savedBToolsGuis = {}
(allowEquip)
t = ()
t
c = ()
hum = c c:()
allowEquip STATE.mustEquipTool c hum t.Parent ~= c
now = .()
now - STATE.lastEquipTry >=
STATE.lastEquipTry = now
(() hum:(t) )
handle = t:()
handle handle:() handle.LocalTransparencyModifier =
STATE.cachedEndpoint STATE.cachedEndpoint:(t) STATE.cachedEndpoint
api = t:()
ep = api api:()
STATE.cachedEndpoint = ep
ep
(b, theme, armCols)
b.role == b.role ==
(CFG.armStyle == ) ((b.role == ) armCols.skinL armCols.skinR) theme.gearCloth
b.role ==
(CFG.armStyle == ) armCols.skinL theme.gearCloth:(armCols.skinL, )
b.role ==
(CFG.armStyle == ) armCols.skinR theme.gearCloth:(armCols.skinR, )
b.role ==
(CFG.armStyle == ) armCols.skinL theme.gearDark
theme[b.role] theme.armor
(b)
b.role == b.role == b.role ==
.Material.Neon
b.role ==
.Material.Glass
b.role == b.role == b.role ==
.Material.Metal
b.role == b.role == b.role ==
.Material.Fabric
b.role == b.role == b.role == b.role ==
.Material.Plastic
.Material.SmoothPlastic
(b)
b.fxType
b.fxType == b.fxType == b.fxType ==
CTRL.fxTimer >
b.fxType ==
CTRL.shell.active
(CTRL.activeF3XBullet ~= CTRL.activeF3XBullet.alive)
(b)
b.weaponId
CTRL.equipped CTRL.transition ~=
b.weaponId == CTRL.weaponId
b.weaponId == CTRL.primaryId
(b)
(b)
b.fxType ==
b.fxType == b.fxType ==
(b)
b.fxType (b)
b.weaponId (b)
b.role ==
(themeIdx)
themeIdx CFG.themeIdx = ((themeIdx - ) % #THEMES) +
theme = THEMES[CFG.themeIdx]
armCols = ()
ep = ()
ep
colorItems, matItems, colItems = {}, {}, {}
i = , TOTAL
b = STATE.blocks[i]
b b.part b.part.Parent
col = (b, theme, armCols)
b.part.Color = col
colorItems[#colorItems + ] = { Part = b.part, Color = col }
mat = (b)
wantTrans = (b)
b.serverTrans = wantTrans
b.part.Material = mat
b.part.Transparency = wantTrans
matItems[#matItems + ] = { Part = b.part, Material = mat, Transparency = wantTrans }
colItems[#colItems + ] = { Part = b.part, CanCollide = }
#colorItems > .(() (() ep:(, colorItems) ) )
#matItems > .(() (() ep:(, matItems) ) )
#colItems > .(() (() ep:(, colItems) ) )
HOLE_HIDDEN_CF = .(, -, )
HOLE_RADIUS_BY_WEP = { awp = , deagle = , ak47 = }
HOLE_POOL_SIZE =
(ep, mode, list)
ep #list > .(() (() ep:(mode, list) ) )
(ep, count, out)
i = , count,
n, done = .(, count - i + ),
_ = , n
.(()
ok, p = (() ep:(, , HOLE_HIDDEN_CF, ) )
ok (p) == p:() p.Name = ; out[#out + ] = p
done +=
)
done < n .()
(ep)
ep
_, p (:())
p.Name == p:() #STATE.holePool < HOLE_POOL_SIZE STATE.holePool[#STATE.holePool + ] = p
(ep, HOLE_POOL_SIZE - #STATE.holePool, STATE.holePool)
a, c, m = {}, {}, {}
_, p (STATE.holePool)
a[#a + ], c[#c + ], m[#m + ] = { Part = p, Anchored = }, { Part = p, CanCollide = false }, { Part = p, Transparency = 1 }
end
syncHoleBatch(ep, "SyncAnchor", a); syncHoleBatch(ep, "SyncCollision", c); syncHoleBatch(ep, "SyncMaterial", m)
end
local function refreshRayParams()
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
params.RespectCanCollide = false
params.IgnoreWater = true
local ignore = {}
local c = getChar()
if c then ignore[#ignore + 1] = c end
for i = 1, TOTAL do
local b = STATE.blocks[i]
if b and b.part then ignore[#ignore + 1] = b.part end
end
params.FilterDescendantsInstances = ignore
CTRL.rayParams = params
CTRL.rayDirty = false
end
local function makeBlockRecord(idx, p, bp)
return {
id = idx, part = p, bone = bp.bone, weaponId = bp.weaponId, name = bp.name, shape = bp.shape, role = bp.role, prio = bp.prio,
isArm = bp.isArm, isBody = bp.isBody, isHead = bp.isHead, fxType = bp.fxType,
localCF = bp.cf, localSize = bp.sz, serverCF = p.CFrame, serverSize = p.Size, serverTrans = p.Transparency,
targetCF = p.CFrame, targetSize = bp.sz, inTransit = false, matInTransit = false, failCount = 0, retryAt = 0, lastSentAt = 0,
}
end
local function createPartWithShape(ep, shape, cf)
local targetShape = STATE.unsupportedShapes[shape] and "Normal" or shape
local ok, p = pcall(function() return ep:InvokeServer("CreatePart", targetShape, cf, workspace) end)
if ok and typeof(p) == "Instance" and p:IsA("BasePart") then return p, targetShape end
if targetShape ~= "Normal" then
STATE.unsupportedShapes[shape] = true
local ok2, p2 = pcall(function() return ep:InvokeServer("CreatePart", "Normal", cf, workspace) end)
if ok2 and typeof(p2) == "Instance" and p2:IsA("BasePart") then return p2, "Normal" end
end
return nil, nil
end
local function calibrateAll(ep)
local anchorItems, sizeItems = {}, {}
for i = 1, TOTAL do
local b = STATE.blocks[i]
if b and b.part and b.part.Parent then
if not b.part.Anchored then anchorItems[#anchorItems + 1] = { Part = b.part, Anchored = true } end
if (b.part.Size - b.localSize).Magnitude > 0.03 then
sizeItems[#sizeItems + 1] = { block = b, item = { Part = b.part, Size = b.localSize, CFrame = b.part.CFrame } }
end
end
end
if #anchorItems > 0 then pcall(function() ep:InvokeServer("SyncAnchor", anchorItems) end) end
for start = 1, #sizeItems, CFG.batchSize do
local lot, entries = {}, {}
for k = start, math.min(start + CFG.batchSize - 1, #sizeItems) do
lot[#lot + 1] = sizeItems[k].item
entries[#entries + 1] = sizeItems[k]
end
local ok, res = pcall(function() return ep:InvokeServer("SyncResize", lot) end)
if ok and res ~= false then
for _, e in ipairs(entries) do e.block.serverSize = e.item.Size; e.block.part.Size = e.item.Size end
end
end
end
local function buildOrScan()
local c = getChar()
local hrp = c and (c:FindFirstChild("HumanoidRootPart") or c:WaitForChild("HumanoidRootPart", 5))
local tool = getF3XTool()
assert(c and hrp, "Character not found.")
assert(tool, "'Building Tools' (F3X) not found in Backpack or Character!")
local ep = getF3XEndpoint(false)
assert(ep, "SyncAPI.ServerEndpoint not found inside Building Tools!")
local byIdx, freeByShape = {}, {}
for _, p in ipairs(workspace:GetChildren()) do
if p.Name == "WuzSniper" and p:IsA("BasePart") then
local idx = p:GetAttribute("WuzSniperIdx")
local sh = p:GetAttribute("WuzSniperShape") or "Normal"
if typeof(idx) == "number" and BLUEPRINT[idx] and BLUEPRINT[idx].shape == sh and not byIdx[idx] then
byIdx[idx] = p
else
freeByShape[sh] = freeByShape[sh] or {}
table.insert(freeByShape[sh], p)
end
end
end
if not STATE.checkedBackpack then
STATE.checkedBackpack = true
if tool.Parent ~= c then
local probeOk = false
local existing = next(byIdx) and byIdx[next(byIdx)]
if not existing then
for _, list in pairs(freeByShape) do if list[1] then existing = list[1]; break end end
end
if existing then
local ok, res = pcall(function() return ep:InvokeServer("SyncColor", { { Part = existing, Color = existing.Color } }) end)
if ok and res ~= false then probeOk = true end
else
local ok, p = pcall(function() return ep:InvokeServer("CreatePart", "Normal", hrp.CFrame * C(0, 4, -8), workspace) end)
if ok and typeof(p) == "Instance" and p:IsA("BasePart") then
probeOk = true; p.Name = "WuzSniper"; p:SetAttribute("WuzSniperShape", "Normal")
freeByShape["Normal"] = freeByShape["Normal"] or {}
table.insert(freeByShape["Normal"], p)
end
end
if not probeOk then
STATE.mustEquipTool = true
local hum = c:FindFirstChildOfClass("Humanoid")
if hum then
pcall(function() hum:EquipTool(tool) end)
local t0 = os.clock()
while tool.Parent ~= c and os.clock() - t0 < 1.8 do task.wait() end
end
end
end
ep = getF3XEndpoint(true)
end
STATE.blocks = {}
local missing = {}
for i = 1, TOTAL do
local bp = BLUEPRINT[i]
local pool = freeByShape[bp.shape]
local p = byIdx[i] or (pool and table.remove(pool))
if p then
p:SetAttribute("WuzSniperIdx", i); p:SetAttribute("WuzSniperShape", bp.shape)
STATE.blocks[i] = makeBlockRecord(i, p, bp)
else
missing[#missing + 1] = i
end
end
if #missing > 0 then
local spawnBase = hrp.CFrame * C(0, 3, -8)
for _ = 1, 5 do
if #missing == 0 or _G.WuzSniperStop then break end
local nextMissing = {}
for start = 1, #missing, 5 do
local n = math.min(5, #missing - start + 1)
local done = 0
for k = 0, n - 1 do
local idx = missing[start + k]
local bp = BLUEPRINT[idx]
task.spawn(function()
local cf = spawnBase * C((idx % 8) * 1.2, math.floor((idx % 32) / 8) * 1.2, 0)
local p, actualShape = createPartWithShape(ep, bp.shape, cf)
if p then
p.Name = "WuzSniper"; p:SetAttribute("WuzSniperIdx", idx); p:SetAttribute("WuzSniperShape", actualShape)
STATE.blocks[idx] = makeBlockRecord(idx, p, bp)
else
nextMissing[#nextMissing + 1] = idx
end
done += 1
end)
end
while done < n do task.wait() end
task.wait(0.04)
end
missing = nextMissing
end
end
local unusedParts = {}
for _, list in pairs(freeByShape) do
for _, p in ipairs(list) do unusedParts[#unusedParts + 1] = p end
end
if #unusedParts > 0 then task.spawn(function() pcall(function() ep:InvokeServer("Remove", unusedParts) end) end) end
local count = 0
for i = 1, TOTAL do if STATE.blocks[i] then count += 1 end end
calibrateAll(ep)
task.spawn(initHolePool, ep)
paintAll(CFG.themeIdx)
CTRL.rayDirty = true
return count
end
-------------------------------------------------------------------
-- CUSTOM MOVEMENT ENGINE (CS:GO ACCEL, COUNTER-STRAFE, CROUCH, LEAN, AIR-STRAFE)
-------------------------------------------------------------------
local function saveAndSetupMovement(parts)
if not parts or not parts.hum then return end
if CTRL.moveRestored then
CTRL.savedWalkSpeed = parts.hum.WalkSpeed
CTRL.savedAutoRotate = parts.hum.AutoRotate
CTRL.savedCameraOffset = parts.hum.CameraOffset
CTRL.moveRestored = false
end
parts.hum.AutoRotate = false
end
local function restoreMovement()
if CTRL.moveRestored then return end
CTRL.moveRestored = true
local c = getChar()
local hum = c and c:FindFirstChildOfClass("Humanoid")
local hrp = c and c:FindFirstChild("HumanoidRootPart")
if hum then
if CTRL.savedWalkSpeed ~= nil then hum.WalkSpeed = CTRL.savedWalkSpeed end
if CTRL.savedAutoRotate ~= nil then hum.AutoRotate = CTRL.savedAutoRotate end
if CTRL.savedCameraOffset ~= nil then hum.CameraOffset = CTRL.savedCameraOffset end
end
muteDefaultFootsteps(hrp, false)
end
local function getMoveWishDir(cam, hum)
if UIS:GetFocusedTextBox() or GuiService.MenuIsOpen then return V() end
local f = (UIS:IsKeyDown(Enum.KeyCode.W) and 1 or 0) - (UIS:IsKeyDown(Enum.KeyCode.S) and 1 or 0)
local r = (UIS:IsKeyDown(Enum.KeyCode.D) and 1 or 0) - (UIS:IsKeyDown(Enum.KeyCode.A) and 1 or 0)
if f ~= 0 or r ~= 0 then
local flatLook = V(cam.CFrame.LookVector.X, 0, cam.CFrame.LookVector.Z)
flatLook = (flatLook.Magnitude < 1e-4) and V(0, 0, -1) or flatLook.Unit
local flatRight = V(-flatLook.Z, 0, flatLook.X)
local dir = flatLook * f + flatRight * r
return (dir.Magnitude > 1e-4) and dir.Unit or V()
end
if hum and hum.MoveDirection.Magnitude > 0.01 then
local md = V(hum.MoveDirection.X, 0, hum.MoveDirection.Z)
return (md.Magnitude > 1e-4) and md.Unit or V()
end
return V()
end
local function stepCustomMovement(dt, cam, parts)
local hum, hrp = parts.hum, parts.hrp
saveAndSetupMovement(parts)
muteDefaultFootsteps(hrp, _G.WuzSniperCustomMove)
local typing = (UIS:GetFocusedTextBox() ~= nil or GuiService.MenuIsOpen)
local wantCrouch = not typing and (CTRL.crouchHold or CTRL.crouchToggle)
CTRL.crouch = wantCrouch
CTRL.crouching = wantCrouch
CTRL.walking = not typing and UIS:IsKeyDown(Enum.KeyCode.LeftShift) and not wantCrouch
local leanTarget = (not typing) and ((UIS:IsKeyDown(Enum.KeyCode.X) and 1 or 0) - (UIS:IsKeyDown(Enum.KeyCode.Z) and 1 or 0)) or 0
CTRL.crouchAlpha += ((wantCrouch and 1 or 0) - CTRL.crouchAlpha) * (1 - math.exp(-15 * dt))
CTRL.leanAlpha += (leanTarget - CTRL.leanAlpha) * (1 - math.exp(-13 * dt))
CTRL.landDip = math.max(0, CTRL.landDip - dt * 3.6)
if CTRL.jumpBuffer > 0 then CTRL.jumpBuffer = math.max(0, CTRL.jumpBuffer - dt) end
local hState = hum:GetState()
local isAir = (hState == Enum.HumanoidStateType.Freefall or hState == Enum.HumanoidStateType.Jumping)
CTRL.inAir = isAir
if CTRL.wasInAir and not isAir then
local impact = math.clamp(math.abs(hrp.AssemblyLinearVelocity.Y) / 48, 0.25, 1.0)
CTRL.landDip = impact
CTRL.springPosVel += V(0, -impact * 1.15, 0)
playSFX("land", 0.35 + impact * 0.65, 0.94 + math.random() * 0.12)
end
CTRL.wasInAir = isAir
CTRL.inAirAlpha += ((isAir and 1 or 0) - CTRL.inAirAlpha) * (1 - math.exp(-14 * dt))
if not _G.WuzSniperCustomMove then
local v = hrp.AssemblyLinearVelocity
CTRL.moveVelXZ = V(v.X, 0, v.Z)
hum.AutoRotate = true
return
end
local maxSpd = CFG.runSpeed
if wantCrouch then maxSpd = CFG.crouchSpeed elseif CTRL.walking then maxSpd = CFG.walkSpeed end
if CTRL.equipped and CTRL.aimAlpha > 0.5 then maxSpd = math.min(maxSpd, CFG.scopeSpeed) end
local wishDir = getMoveWishDir(cam, hum)
local actualVelXZ = V(hrp.AssemblyLinearVelocity.X, 0, hrp.AssemblyLinearVelocity.Z)
if not isAir then
local spd = CTRL.moveVelXZ.Magnitude
if spd > 0.01 then
local drop = math.max(spd, CFG.stopSpeed) * CFG.groundFriction * dt
CTRL.moveVelXZ *= math.max(0, spd - drop) / spd
end
if wishDir.Magnitude > 0.01 then
local curSpd = CTRL.moveVelXZ:Dot(wishDir)
local addSpd = maxSpd - curSpd
if addSpd > 0 then
local boost = (curSpd < -0.5) and 1.55 or 1.0
CTRL.moveVelXZ += wishDir * math.min(CFG.groundAccel * boost * maxSpd * dt, addSpd)
end
end
if CTRL.moveVelXZ.Magnitude > 3.0 and actualVelXZ.Magnitude < CTRL.moveVelXZ.Magnitude * 0.35 then
CTRL.wallStuckTimer += dt
if CTRL.wallStuckTimer > 0.12 then CTRL.moveVelXZ = CTRL.moveVelXZ:Lerp(actualVelXZ, 0.5) end
else
CTRL.wallStuckTimer = 0
end
local spdOut = CTRL.moveVelXZ.Magnitude
if spdOut > 0.08 then
hum.WalkSpeed = spdOut
hum:Move(CTRL.moveVelXZ / spdOut, false)
else
hum.WalkSpeed = 0
hum:Move(V(), false)
end
if CTRL.jumpBuffer > 0 then
CTRL.jumpBuffer = 0
hum.Jump = true
playSFX("equip", 0.30, 1.35)
end
else
if wishDir.Magnitude > 0.01 then
local curSpd = CTRL.moveVelXZ:Dot(wishDir)
local addSpd = math.min(maxSpd, CFG.airWishCap) - curSpd
if addSpd > 0 then CTRL.moveVelXZ += wishDir * math.min(CFG.airAccel * maxSpd * dt, addSpd) end
end
hrp.AssemblyLinearVelocity = V(CTRL.moveVelXZ.X, hrp.AssemblyLinearVelocity.Y, CTRL.moveVelXZ.Z)
end
local flatLook = V(cam.CFrame.LookVector.X, 0, cam.CFrame.LookVector.Z)
flatLook = (flatLook.Magnitude > 1e-4) and flatLook.Unit or V(0, 0, -1)
local camYaw = math.atan2(-flatLook.X, -flatLook.Z)
local targetHrpYaw = (CTRL.equipped or CTRL.transition == "equip" or CTRL.moveVelXZ.Magnitude <= 1.2)
and camYaw or math.atan2(-CTRL.moveVelXZ.X, -CTRL.moveVelXZ.Z)
local hrpLook = V(hrp.CFrame.LookVector.X, 0, hrp.CFrame.LookVector.Z)
local curHrpYaw = (hrpLook.Magnitude > 1e-4) and math.atan2(-hrpLook.X, -hrpLook.Z) or targetHrpYaw
local diffYaw = math.atan2(math.sin(targetHrpYaw - curHrpYaw), math.cos(targetHrpYaw - curHrpYaw))
local rotAlpha = CTRL.equipped and (1 - math.exp(-22 * dt)) or (1 - math.exp(-10 * dt))
hrp.CFrame = C(hrp.Position) * CFrame.Angles(0, curHrpYaw + diffYaw * rotAlpha, 0)
hum.CameraOffset = V(CTRL.leanAlpha * 0.78, -1.24 * CTRL.crouchAlpha - CTRL.landDip * 0.36, 0)
end
-------------------------------------------------------------------
-- UNIFIED 2-BONE IK + REALISTIC CS:GO OPERATOR RIG + SHELL PHYSICS
-------------------------------------------------------------------
local function stepSpringV3(pos, vel, target, stiffness, damping, dt)
local force = (target - pos) * stiffness - vel * damping
vel = vel + force * dt
pos = pos + vel * dt
return pos, vel
end
local function solveTwoBoneIK(rootPos, targetPos, bendHintDir, L1, L2, anchorAtTarget)
local delta = targetPos - rootPos
local rawDist = delta.Magnitude
local fwdDir = (rawDist > 1e-4) and (delta / rawDist) or V(0, -1, 0)
local bendDir = bendHintDir - fwdDir * bendHintDir:Dot(fwdDir)
if bendDir.Magnitude < 1e-4 then bendDir = fwdDir:Cross((math.abs(fwdDir.Y) < 0.9) and Vector3.yAxis or Vector3.xAxis) end
bendDir = bendDir.Unit
local d = math.clamp(rawDist, math.abs(L1 - L2) + 0.05, (L1 + L2) * 0.996)
local cosA = math.clamp((L1 * L1 + d * d - L2 * L2) / (2 * L1 * d), -1, 1)
local jointPos = rootPos + fwdDir * (L1 * cosA) + bendDir * (L1 * math.sqrt(math.max(0, 1 - cosA * cosA)))
local upperDir = jointPos - rootPos
upperDir = (upperDir.Magnitude > 1e-4) and upperDir.Unit or fwdDir
local sideVec = upperDir:Cross(bendDir)
sideVec = (sideVec.Magnitude > 1e-4) and sideVec.Unit or Vector3.xAxis
local upperCF = CFrame.lookAt(rootPos, rootPos + upperDir, sideVec:Cross(upperDir).Unit)
local foreVec = targetPos - jointPos
local foreDir = (foreVec.Magnitude > 1e-4) and foreVec.Unit or fwdDir
local lowerOrigin = anchorAtTarget and (targetPos - foreDir * L2) or jointPos
local lowerCF = CFrame.lookAt(lowerOrigin, lowerOrigin + foreDir, sideVec:Cross(foreDir).Unit)
return upperCF, lowerCF, lowerOrigin + foreDir * L2
end
local function computeHolsterCF(torsoCF)
return torsoCF * C(0.06, 0.72, 0.54) * CFrame.Angles(0, 0, math.rad(46)) * CFrame.Angles(0, math.rad(-90), 0)
end
local function ejectShell(rifleCF)
local sh = CTRL.shell
sh.active = true
sh.age = 0
sh.bounced = false
sh.dropSoundPlayed = false
sh.pos = rifleCF:PointToWorldSpace(V(0.14, 0.14, -0.06))
sh.vel = rifleCF:VectorToWorldSpace(V(7.4 + math.random() * 2.4, 5.4 + math.random() * 1.4, 2.1 + math.random() * 1.4)) + CTRL.moveVelXZ * 0.45
sh.rot = V(math.random() * 3.14, math.random() * 3.14, math.random() * 3.14)
sh.angVel = V(16 + math.random() * 12, (math.random() - 0.5) * 28, 12 + math.random() * 12)
end
local function stepShell(dt)
local sh = CTRL.shell
if not sh.active then return end
sh.age += dt
if sh.age >= sh.maxAge then sh.active = false; return end
sh.vel += V(0, -34 * dt, 0)
local stepV = sh.vel * dt
if not sh.bounced and sh.age > 0.10 and stepV.Magnitude > 1e-4 then
if CTRL.rayDirty or not CTRL.rayParams then refreshRayParams() end
local hit = workspace:Raycast(sh.pos, stepV + V(0, -0.06, 0), CTRL.rayParams)
if hit then
sh.pos = hit.Position + hit.Normal * 0.04
local vDot = sh.vel:Dot(hit.Normal)
if vDot < 0 then sh.vel -= hit.Normal * (1.35 * vDot) end
sh.vel *= 0.52
sh.angVel *= 0.38
sh.bounced = true
if not sh.dropSoundPlayed then
sh.dropSoundPlayed = true
playSFX("shell_drop", 0.75, 0.94 + math.random() * 0.12)
end
else
sh.pos += stepV
end
else
sh.pos += stepV
end
if not sh.dropSoundPlayed and sh.age >= 0.46 then
sh.dropSoundPlayed = true
playSFX("shell_drop", 0.45, 0.92 + math.random() * 0.14)
end
sh.rot += sh.angVel * dt
end
local function evaluateRig(dt, cam, parts)
local t, hrp, hum, camCF = CTRL.timeAcc, parts.hrp, parts.hum, cam.CFrame
local floorOffset = (hum.RigType == Enum.HumanoidRigType.R15) and (hrp.Size.Y * 0.5 + hum.HipHeight) or (hrp.Size.Y * 0.5 + 2.0)
local groundPos = hrp.Position - V(0, floorOffset, 0)
local flatCamLook = V(camCF.LookVector.X, 0, camCF.LookVector.Z)
flatCamLook = (flatCamLook.Magnitude > 1e-4) and flatCamLook.Unit or V(0, 0, -1)
local camYaw = math.atan2(-flatCamLook.X, -flatCamLook.Z)
local camPitch = math.asin(math.clamp(camCF.LookVector.Y, -0.98, 0.98))
local speed = CTRL.moveVelXZ.Magnitude
CTRL.gaitAmp += (math.clamp(speed / CFG.runSpeed, 0, 1.3) - CTRL.gaitAmp) * (1 - math.exp(-12 * dt))
if CTRL.gaitAmp > 0.02 and not CTRL.inAir then
CTRL.gaitPhase += dt * (6.2 + CTRL.gaitAmp * 5.2)
local stepIdx = math.floor(CTRL.gaitPhase / math.pi)
if stepIdx ~= CTRL.lastStepIdx then
CTRL.lastStepIdx = stepIdx
if speed > 2.2 then
local stepVol = CTRL.walking and 0.14 or (CTRL.crouching and 0.22 or 0.65)
playSFX("step", stepVol, 0.92 + math.random() * 0.16)
end
end
end
local armed = (CTRL.equipped or CTRL.transition == "equip")
local desiredUpperYaw = (not CTRL.equipped and CTRL.transition == nil and speed > 1.2)
and math.atan2(-CTRL.moveVelXZ.X, -CTRL.moveVelXZ.Z) or camYaw
if CTRL.lowerYaw == nil then CTRL.lowerYaw = desiredUpperYaw end
local yawDelta = math.atan2(math.sin(desiredUpperYaw - CTRL.lowerYaw), math.cos(desiredUpperYaw - CTRL.lowerYaw))
if speed > 0.8 or math.abs(yawDelta) > math.rad(32) then
CTRL.lowerYaw += yawDelta * (1 - math.exp(-11.5 * dt))
if speed <= 0.8 then CTRL.turnStepAlpha = math.min(1, CTRL.turnStepAlpha + dt * 5.5) end
else
CTRL.turnStepAlpha = math.max(0, CTRL.turnStepAlpha - dt * 5.0)
end
local bladeYaw = armed and math.rad(22) or 0
local lowerRelTwist = math.atan2(math.sin(desiredUpperYaw - CTRL.lowerYaw), math.cos(desiredUpperYaw - CTRL.lowerYaw)) + bladeYaw
local pelvisHeight = 2.68 - 1.24 * CTRL.crouchAlpha - (1 - CTRL.inAirAlpha) * math.abs(math.sin(CTRL.gaitPhase)) * 0.11 * CTRL.gaitAmp - CTRL.landDip * 0.30
local hipRoll = (1 - CTRL.inAirAlpha) * math.sin(CTRL.gaitPhase) * 0.048 * CTRL.gaitAmp
local pelvisCF = C(groundPos.X, groundPos.Y + pelvisHeight, groundPos.Z)
* CFrame.Angles(0, CTRL.lowerYaw, 0) * C(CTRL.leanAlpha * 0.26, 0, 0) * CFrame.Angles(0, 0, hipRoll)
local localVel = CFrame.Angles(0, -desiredUpperYaw, 0):VectorToObjectSpace(CTRL.moveVelXZ)
local fwdFrac = math.clamp(-localVel.Z / CFG.runSpeed, -1, 1)
local strafeFrac = math.clamp(localVel.X / CFG.runSpeed, -1, 1)
local torsoHunch = -math.rad(16 * CTRL.crouchAlpha + 7.5 * math.max(0, fwdFrac) * (1 - CTRL.inAirAlpha))
local torsoAimPitch = armed and math.clamp(camPitch * 0.42, math.rad(-22), math.rad(22)) or 0
local torsoLean = -CTRL.leanAlpha * math.rad(17) - strafeFrac * math.rad(3.8)
local breathBody = math.sin(t * 1.45) * math.rad(1.1)
local torsoCF = pelvisCF * C(0, 0.20, 0) * CFrame.Angles(0, lowerRelTwist, 0)
* CFrame.Angles(torsoHunch + torsoAimPitch + breathBody, 0, torsoLean)
local headPitch = armed and (camPitch - torsoAimPitch) or math.clamp(camPitch * 0.55, math.rad(-28), math.rad(28))
local headRelYaw = (not armed and speed > 1.2)
and math.clamp(math.atan2(math.sin(camYaw - desiredUpperYaw), math.cos(camYaw - desiredUpperYaw)), math.rad(-50), math.rad(50))
or -bladeYaw
local cheekWeldRoll = armed and math.rad(-9 * CTRL.aimAlpha) or 0
local headCF = torsoCF * C(0, 1.16, 0.02) * CFrame.Angles(0, headRelYaw, 0)
* CFrame.Angles(headPitch, 0, -torsoLean * 0.35 + cheekWeldRoll)
-- 2-Bone Legs & Boots IK
local hipL, hipR = pelvisCF:PointToWorldSpace(V(-0.42, -0.08, 0)), pelvisCF:PointToWorldSpace(V(0.42, -0.08, 0))
local lowerBasis = C(groundPos) * CFrame.Angles(0, CTRL.lowerYaw + bladeYaw * 0.55, 0)
local moveDirUnit = (speed > 0.5) and (CTRL.moveVelXZ / speed) or lowerBasis.LookVector
local bladeAmt = armed and 1 or 0.22
local strideDist = math.clamp(speed / CFG.runSpeed, 0, 1.25) * (1.14 - 0.28 * CTRL.crouchAlpha)
local footLift = math.clamp(speed / CFG.runSpeed, 0, 1.1) * (0.50 - 0.15 * CTRL.crouchAlpha)
local pL, pR = CTRL.gaitPhase, CTRL.gaitPhase + math.pi
local walkOffL = moveDirUnit * (math.sin(pL) * strideDist) + Vector3.yAxis * (math.max(0, math.cos(pL)) * footLift + math.sin(CTRL.turnStepAlpha * math.pi) * 0.20)
local walkOffR = moveDirUnit * (math.sin(pR) * strideDist) + Vector3.yAxis * (math.max(0, math.cos(pR)) * footLift)
local crouchFootOut = 0.08 * CTRL.crouchAlpha
local ankleL = (lowerBasis:PointToWorldSpace(V(-0.46 - crouchFootOut, 0.29, -0.24 * bladeAmt)) + walkOffL):Lerp(lowerBasis:PointToWorldSpace(V(-0.46, 1.22, -0.40)), CTRL.inAirAlpha)
local ankleR = (lowerBasis:PointToWorldSpace(V(0.50 + crouchFootOut, 0.29, 0.28 * bladeAmt)) + walkOffR):Lerp(lowerBasis:PointToWorldSpace(V(0.50, 0.80, 0.30)), CTRL.inAirAlpha)
local kneeL = (lowerBasis.LookVector * (1 + 0.55 * CTRL.crouchAlpha) - lowerBasis.RightVector * (0.20 + 0.14 * CTRL.crouchAlpha)).Unit
local kneeR = (lowerBasis.LookVector * (1 + 0.55 * CTRL.crouchAlpha) + lowerBasis.RightVector * (0.24 + 0.14 * CTRL.crouchAlpha)).Unit
local thighL_CF, shinL_CF, footAnchorL = solveTwoBoneIK(hipL, ankleL, kneeL, LEG_THIGH_LEN, LEG_SHIN_LEN, false)
local thighR_CF, shinR_CF, footAnchorR = solveTwoBoneIK(hipR, ankleR, kneeR, LEG_THIGH_LEN, LEG_SHIN_LEN, false)
local footL_CF = C(footAnchorL) * CFrame.Angles(0, CTRL.lowerYaw + bladeYaw * 0.4 + math.rad(6), 0)
* CFrame.Angles(-math.sin(pL) * math.rad(18) * CTRL.gaitAmp * (1 - CTRL.inAirAlpha) - math.rad(24) * CTRL.inAirAlpha, 0, 0)
local footR_CF = C(footAnchorR) * CFrame.Angles(0, CTRL.lowerYaw + bladeYaw * 0.4 - math.rad(14 * bladeAmt + 6), 0)
* CFrame.Angles(-math.sin(pR) * math.rad(18) * CTRL.gaitAmp * (1 - CTRL.inAirAlpha) - math.rad(14) * CTRL.inAirAlpha, 0, 0)
-- First-Person Viewmodel + Per-Weapon Poses, Blowback, Reload & Inspect
local holsterCF = computeHolsterCF(torsoCF)
local aimFrameCF = camCF
if CTRL.equipped then
CTRL.lastLocalAimCF = torsoCF:ToObjectSpace(camCF)
elseif CTRL.transition == "holster" then
aimFrameCF = torsoCF * (CTRL.lastLocalAimCF or C(0, 1.5, 0))
elseif CTRL.transition == "equip" then
aimFrameCF = C(headCF:PointToWorldSpace(V(0, 0.46, 0))) * camCF.Rotation
end
local curLook = aimFrameCF.LookVector
if CTRL.prevCamLook and dt > 0 then
local ld = aimFrameCF:VectorToObjectSpace(CTRL.prevCamLook)
local damp = 1 - math.exp(-13 * dt)
CTRL.swayYaw += (math.clamp(ld.X * 1.85, -0.14, 0.14) - CTRL.swayYaw) * damp
CTRL.swayPitch += (math.clamp(-ld.Y * 1.85, -0.14, 0.14) - CTRL.swayPitch) * damp
CTRL.swayPosX += (math.clamp(ld.X * 0.24, -0.055, 0.055) - CTRL.swayPosX) * (1 - math.exp(-10 * dt))
CTRL.swayPosY += (math.clamp(-ld.Y * 0.20, -0.045, 0.045) - CTRL.swayPosY) * (1 - math.exp(-10 * dt))
end
CTRL.prevCamLook = curLook
if dt > 0 then
CTRL.springPos, CTRL.springPosVel = stepSpringV3(CTRL.springPos, CTRL.springPosVel, V(), 190, 17, dt)
CTRL.springRot, CTRL.springRotVel = stepSpringV3(CTRL.springRot, CTRL.springRotVel, V(), 175, 15.5, dt)
local rd = 1 - math.exp(-12.5 * dt)
CTRL.recoilPos = CTRL.recoilPos:Lerp(V(), rd)
CTRL.recoilRot = CTRL.recoilRot:Lerp(V(), rd)
CTRL.triggerPull = math.max(0, CTRL.triggerPull - dt * 5.2)
CTRL.equipSettle = math.max(0, (CTRL.equipSettle or 0) - dt * 3.4)
end
local canSprintPose = CTRL.equipped and CTRL.transition == nil and not CTRL.aimHold and not CTRL.aimToggle
and not CTRL.reloading and CTRL.boltTimer <= 0 and CTRL.postShotHold <= 0 and not CTRL.inspecting
and not CTRL.walking and not CTRL.crouching and speed > 13.5 and not CTRL.inAir
CTRL.sprintAlpha = (CTRL.sprintAlpha or 0) + ((canSprintPose and 1 or 0) - (CTRL.sprintAlpha or 0)) * (1 - math.exp(-8.5 * dt))
local spA = CTRL.sprintAlpha
local wep = WEAPONS[CTRL.weaponId] or WEAPONS.awp
local hipBase, adsBase
if CTRL.weaponId == "ak47" then
hipBase = C(0.32, -0.46, -0.88) * CFrame.Angles(0, math.rad(4), 0)
adsBase = C(0.00, -0.34, -0.78)
elseif CTRL.weaponId == "deagle" then
hipBase = C(0.28, -0.42, -0.95) * CFrame.Angles(0, math.rad(2), 0)
adsBase = C(0.00, -0.32, -0.86)
else
hipBase = C(0.36, -0.53, -1.04) * CFrame.Angles(0, math.rad(5), 0)
adsBase = C(0.00, -0.45, -1.03)
end
local a = CTRL.aimAlpha
local adsArc = math.sin(a * math.pi)
local sprintPose = degCF(-0.18, -0.20, 0.04, -14, 34, 18)
local steadyMul = (1 - 0.72 * a) * (1 - 0.35 * CTRL.crouchAlpha) * (CTRL.walking and 0.65 or 1.0)
local breathX = (math.sin(t * 1.45) + 0.35 * math.sin(t * 2.9) + 0.15 * math.cos(t * 4.3)) * 0.006 * steadyMul
local breathY = (math.cos(t * 1.45) * 0.0075 - math.sin(t * 2.9) * 0.0022) * steadyMul
local bobScale = (1 - 0.78 * a) * CTRL.gaitAmp * (1 - CTRL.inAirAlpha) * (1 + 0.55 * spA)
local settleDip = math.sin((CTRL.equipSettle or 0) * math.pi)
local baseOffset = hipBase:Lerp(adsBase, a)
* CFrame.identity:Lerp(sprintPose, spA)
* C(
breathX + math.cos(CTRL.gaitPhase * 0.5) * 0.028 * bobScale + CTRL.swayPosX * (1 - 0.7 * a) - adsArc * 0.035,
breathY + math.abs(math.sin(CTRL.gaitPhase)) * -0.028 * bobScale + CTRL.swayPosY * (1 - 0.7 * a) - CTRL.landDip * 0.095 * (1 - a) - settleDip * 0.045 - adsArc * 0.025,
settleDip * 0.045
)
* C(CTRL.recoilPos + CTRL.springPos)
* CFrame.Angles(
CTRL.recoilRot.X + CTRL.springRot.X + CTRL.swayPitch * (1 - 0.65 * a) + settleDip * math.rad(-3.8) + adsArc * math.rad(-2.2),
CTRL.recoilRot.Y + CTRL.springRot.Y + CTRL.swayYaw * (1 - 0.65 * a),
CTRL.recoilRot.Z + CTRL.springRot.Z + CTRL.swayYaw * 0.65 * (1 - 0.65 * a) + math.rad(-strafeFrac * 4.2 - CTRL.leanAlpha * 11) * (1 - 0.8 * a) + adsArc * math.rad(4.5)
)
local boltPullBack, boltLiftDeg, magOffset = 0, 0, CFrame.identity
local rightHandOnBolt, leftHandOnMag, rightHandBack = 0, 0, 0
local blowback = 0
if CTRL.fireCooldown > 0 and wep.fireRate > 0 then
local fFrac = CTRL.fireCooldown / wep.fireRate
blowback = math.sin(math.clamp(fFrac, 0, 1) * math.pi)
end
if CTRL.boltTimer > 0 and CTRL.weaponId == "awp" then
local p = 1 - (CTRL.boltTimer / CFG.boltTime)
if p >= 0.14 and CTRL.boltStage < 1 then
CTRL.boltStage = 1; playSFX("bolt_up")
CTRL.springRotVel += V(math.rad(14), math.rad(-10), math.rad(-28))
end
if p >= 0.34 and CTRL.boltStage < 2 then
CTRL.boltStage = 2; playSFX("bolt_pull")
CTRL.springPosVel += V(0, -0.15, 0.95)
end
if p >= 0.58 and CTRL.boltStage < 3 then
CTRL.boltStage = 3; playSFX("bolt_push")
CTRL.springPosVel += V(0, 0.12, -1.10)
CTRL.springRotVel += V(math.rad(-16), 0, math.rad(22))
end
if p < 0.14 then
rightHandOnBolt = p / 0.14
baseOffset *= degCF(0.02*rightHandOnBolt, 0.02*rightHandOnBolt, 0, 5*rightHandOnBolt, -7*rightHandOnBolt, -14*rightHandOnBolt)
elseif p < 0.34 then
local u = (p - 0.14) / 0.20; u = u * u * (3 - 2 * u)
rightHandOnBolt = 1; boltLiftDeg = 60 * u
baseOffset *= degCF(0.03, 0.02, 0.05 * u, 6, -9, -16)
elseif p < 0.58 then
local u = (p - 0.34) / 0.24; rightHandOnBolt = 1; boltLiftDeg = 60; boltPullBack = 0.48 * math.sin(u * math.pi * 0.5)
baseOffset *= degCF(0.03, 0.02, 0.06, 6, -9, -16)
elseif p < 0.80 then
local u = (p - 0.58) / 0.22; u = u * u; rightHandOnBolt = 1; boltLiftDeg = 60; boltPullBack = 0.48 * (1 - u)
baseOffset *= degCF(0.03, 0.02, 0.05 * (1 - u), 6, -9, -16)
else
local u = (p - 0.80) / 0.20; rightHandOnBolt = 1 - u; boltLiftDeg = 60 * (1 - u)
baseOffset *= degCF(0.03*(1-u), 0.02*(1-u), 0, 6*(1-u), -9*(1-u), -16*(1-u))
end
elseif CTRL.reloading then
local baseR = wep.reloadTime
local totalR = CTRL.reloadFromEmpty and baseR or (baseR * 0.78)
local p = math.clamp(1 - (CTRL.reloadTimer / math.max(0.1, totalR)), 0, 1)
if p >= 0.18 and CTRL.reloadStage < 1 then
CTRL.reloadStage = 1; playSFX("mag_out")
CTRL.springPosVel += V(0, -0.35, 0.2)
end
if p >= 0.65 and CTRL.reloadStage < 2 then
CTRL.reloadStage = 2; playSFX("mag_in")
CTRL.springPosVel += V(0, 0.85, -0.25)
CTRL.springRotVel += V(math.rad(28), 0, math.rad(-18))
end
if CTRL.reloadFromEmpty and p >= 0.82 and CTRL.reloadStage < 3 then
CTRL.reloadStage = 3; playSFX("bolt_push", 0.92)
CTRL.springPosVel += V(0, 0.15, -0.95)
end
if p < 0.18 then
local u = p / 0.18; leftHandOnMag = u
baseOffset *= degCF(-0.10*u, 0.06*u, 0.05*u, 14*u, 18*u, -30*u)
elseif p < 0.52 then
local u = (p - 0.18) / 0.34; leftHandOnMag = 1
magOffset = degCF(-0.24*u, -0.92*u, 0.12*u, 18*u, 0, 14*u)
baseOffset *= degCF(-0.10, 0.06, 0.05, 14, 18, -30)
elseif p < 0.82 then
local u = (p - 0.52) / 0.30; local inv = 1 - u; leftHandOnMag = 1
magOffset = degCF(-0.24*inv, -0.92*inv, 0.12*inv, 18*inv, 0, 14*inv)
local slap = (u > 0.80) and math.sin(((u - 0.80) / 0.20) * math.pi) * 0.05 or 0
baseOffset *= degCF(-0.10, 0.06 + slap, 0.05, 14 + slap * 45, 18, -30)
else
local u = (p - 0.82) / 0.18; local inv = 1 - u; leftHandOnMag = inv
baseOffset *= degCF(-0.10*inv, 0.06*inv, 0.05*inv, 14*inv, 18*inv, -30*inv)
end
end
local preInspectOffset = baseOffset
if CTRL.inspecting then
local p = 1 - (CTRL.inspectTimer / CFG.inspectTime)
if CTRL.weaponId == "deagle" then
if p < 0.18 then
local u = p / 0.18
u = u * u * (3 - 2 * u)
baseOffset *= degCF(-0.08 * u, 0.08 * u, -0.05 * u, 28 * u, 16 * u, -68 * u)
elseif p < 0.60 then
local u = (p - 0.18) / 0.42
local spin = u * 720
local wobble = math.sin(u * math.pi * 4) * 5
baseOffset *= degCF(-0.08, 0.08 + math.sin(u * math.pi * 4) * 0.012, -0.05, 18 + wobble, 16 + spin, -72)
elseif p < 0.86 then
local u = (p - 0.60) / 0.26
local arcY = 4 * u * (1 - u) * 0.56
local airSpin = u * 360
baseOffset *= degCF(-0.08 * (1 - u * 0.4), 0.08 + arcY, -0.05 - 0.06 * math.sin(u * math.pi), 18 * (1 - u), 16 + airSpin, -72 * (1 - u * 0.5))
else
local u = (p - 0.86) / 0.14
local catchDip = math.sin(u * math.pi) * 0.06
local inv = 1 - u
baseOffset *= degCF(-0.05 * inv, 0.08 * inv - catchDip, -0.05 * inv, 28 * inv - catchDip * 120, 0, -24 * inv)
end
else
local v = CTRL.inspectVariant or 1
if v == 1 then
local s1 = math.sin(math.min(1, p / 0.48) * math.pi)
local s2 = (p > 0.44) and math.sin(math.min(1, (p - 0.44) / 0.56) * math.pi) or 0
baseOffset *= degCF(-0.22 * s1 + 0.12 * s2, 0.12 * (s1 + s2), -0.10 * s1, 14 * s1 + 8 * s2, 46 * s1 - 36 * s2, -32 * s1 + 24 * s2)
elseif v == 2 then
local s = math.sin(p * math.pi)
local check = (p > 0.25 and p < 0.78) and math.sin(((p - 0.25) / 0.53) * math.pi) or 0
rightHandOnBolt = (CTRL.weaponId == "awp") and check or 0
boltLiftDeg = 42 * check
boltPullBack = 0.18 * check
baseOffset *= degCF(-0.14 * s, 0.08 * s, 0.04 * s, 10 * s, 26 * s, -42 * s)
else
local s1 = math.sin(math.min(1, p / 0.52) * math.pi)
local s2 = (p > 0.48) and math.sin(math.min(1, (p - 0.48) / 0.52) * math.pi) or 0
baseOffset *= degCF(-0.10 * s1, 0.18 * s1 - 0.06 * s2, -0.14 * s1, -18 * s1 + 22 * s2, -28 * s1 + 18 * s2, 24 * s1 - 18 * s2)
end
end
end
local fpsRifleCF = aimFrameCF * baseOffset
local stableRifleCF = aimFrameCF * preInspectOffset
local rifleCF = fpsRifleCF
if CTRL.transition == "equip" then
local u = CTRL.transAlpha
if u < 0.38 then
rightHandBack = math.sin((u / 0.38) * math.pi * 0.5); rifleCF = holsterCF
else
local k = (u - 0.38) / 0.62; local s = k * k * (3 - 2 * k)
rifleCF = holsterCF:Lerp(fpsRifleCF, s) + aimFrameCF:VectorToWorldSpace(V(0.88, 0.28, -0.34) * math.sin(s * math.pi))
rightHandBack = 1 - s
end
elseif CTRL.transition == "holster" then
local u = 1 - CTRL.transAlpha
if u < 0.62 then
local k = u / 0.62; local s = k * k * (3 - 2 * k)
rifleCF = fpsRifleCF:Lerp(holsterCF, s) + aimFrameCF:VectorToWorldSpace(V(0.88, 0.28, -0.34) * math.sin(s * math.pi))
rightHandBack = s
else
rightHandBack = 1 - ((u - 0.62) / 0.38); rifleCF = holsterCF
end
elseif not CTRL.equipped then
rifleCF = holsterCF
end
if CTRL.weaponId == "awp" then
if CTRL.boltTimer > 0 and not CTRL.shellEjected and (1 - CTRL.boltTimer / CFG.boltTime) >= 0.36 then
CTRL.shellEjected = true; ejectShell(rifleCF)
elseif CTRL.reloading and CTRL.reloadFromEmpty and not CTRL.shellEjected then
local p = 1 - (CTRL.reloadTimer / wep.reloadTime)
if p >= 0.72 then CTRL.shellEjected = true; ejectShell(rifleCF) end
end
end
local boneCFs = {
Pelvis = pelvisCF, Torso = torsoCF, Head = headCF,
ThighL = thighL_CF, ShinL = shinL_CF, FootL = footL_CF,
ThighR = thighR_CF, ShinR = shinR_CF, FootR = footR_CF,
Rifle = rifleCF,
Bolt = rifleCF * C(0, 0, boltPullBack),
Trigger = rifleCF * C(0, -0.10, 0.26) * CFrame.Angles(math.rad(-22 * CTRL.triggerPull), 0, 0),
Mag = rifleCF * C(0, -0.20, -0.24) * magOffset,
AK47 = rifleCF,
AK_Bolt = rifleCF * C(0, 0, blowback * 0.34),
AK_Mag = rifleCF * magOffset,
Deagle = rifleCF,
Deagle_Slide = rifleCF * C(0, 0, (CTRL.ammo <= 0 and CTRL.weaponId == "deagle") and 0.22 or (blowback * 0.24)),
Deagle_Mag = rifleCF * magOffset,
FX = rifleCF,
}
boneCFs.BoltHandle = boneCFs.Bolt * C(0.08, 0.13, 0.14) * CFrame.Angles(0, 0, math.rad(boltLiftDeg))
local shoulderL, shoulderR = torsoCF:PointToWorldSpace(V(-0.88, 0.94, 0.02)), torsoCF:PointToWorldSpace(V(0.88, 0.94, 0.02))
local handL_T, handR_T, handL_CF, handR_CF
local armSwing = math.sin(CTRL.gaitPhase) * 0.56 * CTRL.gaitAmp * (1 - CTRL.inAirAlpha)
local handRefCF = rifleCF
if not CTRL.equipped and CTRL.transition == nil then
local airLift = CTRL.inAirAlpha * 0.28
handL_T = torsoCF:PointToWorldSpace(V(-0.92, -0.82 + airLift + math.max(0, armSwing * 0.18), -0.18 - armSwing * 0.85))
handR_T = torsoCF:PointToWorldSpace(V(0.92, -0.82 + airLift + math.max(0, -armSwing * 0.18), -0.18 + armSwing * 0.85))
else
local deagleInspect = CTRL.inspecting and CTRL.weaponId == "deagle"
handRefCF = deagleInspect and stableRifleCF or rifleCF
local gripW, foreW
if CTRL.weaponId == "ak47" then
gripW = handRefCF:PointToWorldSpace(V(0.03, -0.18, 0.44))
foreW = handRefCF:PointToWorldSpace(V(-0.06, -0.06, -0.56))
elseif CTRL.weaponId == "deagle" then
local ip = deagleInspect and (1 - (CTRL.inspectTimer / CFG.inspectTime)) or 0
local tossLift = (deagleInspect and ip >= 0.55 and ip < 0.88) and math.sin(((ip - 0.55) / 0.33) * math.pi) * 0.14 or 0
gripW = handRefCF:PointToWorldSpace(V(0.02, -0.16 + tossLift, 0.16))
foreW = deagleInspect
and torsoCF:PointToWorldSpace(V(-0.92, -0.55, -0.22))
or handRefCF:PointToWorldSpace(V(-0.05, -0.18, 0.18))
else
gripW = handRefCF:PointToWorldSpace(V(0.04, -0.16, 0.62))
foreW = handRefCF:PointToWorldSpace(V(-0.08, -0.14, -0.64))
end
local boltK = boneCFs.BoltHandle:PointToWorldSpace(V(0.24, -0.02, 0.14))
local magH = (CTRL.weaponId == "ak47" and boneCFs.AK_Mag or (CTRL.weaponId == "deagle" and boneCFs.Deagle_Mag or boneCFs.Mag)):PointToWorldSpace(V(-0.08, -0.18, 0.16))
local backG = torsoCF:PointToWorldSpace(V(0.42, 1.38, 0.56))
handR_T = gripW:Lerp(boltK, rightHandOnBolt):Lerp(backG, rightHandBack)
handL_T = foreW:Lerp(magH, leftHandOnMag)
if CTRL.transition == "equip" and CTRL.transAlpha < 0.38 then
handL_T = torsoCF:PointToWorldSpace(V(-0.96, -0.18, -0.12)):Lerp(foreW, CTRL.transAlpha / 0.38)
elseif CTRL.transition == "holster" and (1 - CTRL.transAlpha) > 0.62 then
local k = ((1 - CTRL.transAlpha) - 0.62) / 0.38
handL_T = foreW:Lerp(torsoCF:PointToWorldSpace(V(-0.96, -0.18, -0.12)), k)
handR_T = backG:Lerp(torsoCF:PointToWorldSpace(V(0.96, -0.18, -0.12)), k)
end
end
local armBasis = armed and aimFrameCF or torsoCF
local bendHintL = armed and armBasis:VectorToWorldSpace(V(-0.80, -0.65, 0.45)) or torsoCF:VectorToWorldSpace(V(-0.22, -0.25, 0.94))
local bendHintR = armed and armBasis:VectorToWorldSpace(V(0.80, -0.65, 0.45)) or torsoCF:VectorToWorldSpace(V(0.22, -0.25, 0.94))
local upL, foL, endL = solveTwoBoneIK(shoulderL, handL_T, bendHintL, ARM_UPPER_LEN, ARM_FORE_LEN, armed or CTRL.transition ~= nil)
local upR, foR, endR = solveTwoBoneIK(shoulderR, handR_T, bendHintR, ARM_UPPER_LEN, ARM_FORE_LEN, armed or CTRL.transition ~= nil)
if not CTRL.equipped and CTRL.transition == nil then
handL_CF = C(endL) * foL.Rotation * CFrame.Angles(math.rad(-12), 0, math.rad(-82))
handR_CF = C(endR) * foR.Rotation * CFrame.Angles(math.rad(-12), 0, math.rad(82))
else
local deagleInspect = CTRL.inspecting and CTRL.weaponId == "deagle"
local inspectBlend, openBlend = 0, 0
if deagleInspect then
local ip = 1 - (CTRL.inspectTimer / CFG.inspectTime)
if ip < 0.18 then
local u = ip / 0.18
inspectBlend = u * u * (3 - 2 * u)
elseif ip < 0.60 then
inspectBlend = 1
elseif ip < 0.86 then
inspectBlend = 1
local u = (ip - 0.60) / 0.26
openBlend = math.sin(u * math.pi)
else
inspectBlend = 1 - ((ip - 0.86) / 0.14)
end
end
local gripRot = (handRefCF * CFrame.Angles(math.rad(-22), math.rad(10), math.rad(80))).Rotation
local spinHandRot = (handRefCF * CFrame.Angles(math.rad(42), math.rad(14), math.rad(12))).Rotation
local openPalmRot = (handRefCF * CFrame.Angles(math.rad(18), math.rad(-18), math.rad(-75))).Rotation
gripRot = gripRot:Lerp(spinHandRot:Lerp(openPalmRot, openBlend), inspectBlend)
local foreRot = (handRefCF * CFrame.Angles(math.rad(14), math.rad(-28), math.rad(42))).Rotation
local magRot = (boneCFs.Mag * CFrame.Angles(0, math.rad(-45), math.rad(65))).Rotation
local boltRot = (boneCFs.BoltHandle * CFrame.Angles(0, math.rad(35), math.rad(75))).Rotation
handL_CF = C(endL) * foreRot:Lerp(magRot, leftHandOnMag)
handR_CF = C(endR) * gripRot:Lerp(boltRot, rightHandOnBolt)
end
boneCFs.UpperArmL, boneCFs.ForearmL, boneCFs.HandL = upL, foL, handL_CF
boneCFs.UpperArmR, boneCFs.ForearmR, boneCFs.HandR = upR, foR, handR_CF
local fPitch, fYaw
if not CTRL.equipped and CTRL.transition == nil then
fPitch, fYaw = math.rad(-34), math.rad(4)
elseif CTRL.inspecting and CTRL.weaponId == "deagle" then
local ip = 1 - (CTRL.inspectTimer / CFG.inspectTime)
if ip >= 0.60 and ip < 0.86 then
local u = (ip - 0.60) / 0.26
local openAmt = math.sin(u * math.pi)
fPitch = math.rad(28 - 24 * openAmt)
fYaw = math.rad(-14 * openAmt)
elseif ip >= 0.86 then
local u = (ip - 0.86) / 0.14
fPitch = math.rad(28 * (1 - u) - 14 * u)
fYaw = math.rad(14 * u)
else
fPitch, fYaw = math.rad(28), math.rad(0)
end
elseif spA > 0.25 or CTRL.reloading or CTRL.boltTimer > 0 or CTRL.inspecting or CTRL.transition ~= nil then
fPitch, fYaw = math.rad(6), math.rad(-6)
else
fPitch = math.rad(-14 - 22 * CTRL.triggerPull)
fYaw = math.rad(14)
end
boneCFs.TriggerFinger = C(handR_CF:PointToWorldSpace(V(-0.095, 0.018, -0.24))) * handR_CF.Rotation * CFrame.Angles(fPitch, fYaw, 0)
local muzzleZ = (CTRL.weaponId == "ak47" and -2.15) or (CTRL.weaponId == "deagle" and -0.55) or -3.58
local muzzleCF = rifleCF * C(0, 0.08, muzzleZ)
CTRL.lastMuzzleCF = muzzleCF
CTRL.lastMuzzlePos = muzzleCF.Position
return boneCFs, muzzleCF.Position
end
local function computeBlockTarget(b, boneCFs)
if b.fxType == "bullet_tip" or b.fxType == "bullet_core" or b.fxType == "bullet_trail" then
local proj = CTRL.activeF3XBullet
if proj and proj.alive then
local dir = (proj.vel.Magnitude > 1e-3) and proj.vel.Unit or V(0, 0, -1)
local headCF = CFrame.lookAt(proj.pos, proj.pos + dir)
if b.fxType == "bullet_tip" then
return headCF * C(0, 0, -0.22), V(0.12, 0.12, 0.44)
elseif b.fxType == "bullet_core" then
return headCF * C(0, 0, 0.45) * CFrame.Angles(0, math.rad(90), 0), V(1.10, 0.11, 0.11)
else
local tl = math.clamp(proj.dist * 0.65, 0.45, 14)
return headCF * C(0, 0, 1.00 + tl * 0.5) * CFrame.Angles(0, math.rad(90), 0), V(tl, 0.07, 0.07)
end
end
return boneCFs.Rifle, V(0.12, 0.12, 0.18)
elseif b.fxType == "flash_core" or b.fxType == "flash_side_l" or b.fxType == "flash_side_r" then
if CTRL.fxTimer > 0.002 then
local a = CTRL.fxTimer / math.max(0.01, CTRL.fxDuration)
local mCF = CTRL.fxMuzzleCF
if b.fxType == "flash_core" then
return mCF * C(0, 0, -0.14) * CFrame.Angles(0, 0, CTRL.fxRoll), V(0.16 + 0.24 * a, 0.16 + 0.24 * a, 0.24 + 0.46 * a)
elseif b.fxType == "flash_side_l" then
return mCF * C(-0.26 - 0.12 * a, 0, 0.08) * CFrame.Angles(0, math.rad(-14), 0), V(0.42 + 0.44 * a, 0.12 + 0.08 * a, 0.12 + 0.08 * a)
else
return mCF * C(0.26 + 0.12 * a, 0, 0.08) * CFrame.Angles(0, math.rad(14), 0), V(0.42 + 0.44 * a, 0.12 + 0.08 * a, 0.12 + 0.08 * a)
end
end
return boneCFs.Rifle, V(0.12, 0.12, 0.12)
elseif b.fxType == "shell" then
if CTRL.shell.active then
local sh = CTRL.shell
return C(sh.pos) * CFrame.Angles(sh.rot.X, sh.rot.Y, sh.rot.Z), V(0.28, 0.065, 0.065)
end
return boneCFs.Rifle, V(0.12, 0.065, 0.065)
end
return boneCFs[b.bone] * b.localCF, b.localSize
end
local function applyLocalVisuals(boneCFs)
local wep = WEAPONS[CTRL.weaponId] or WEAPONS.awp
local scopeMask = (CTRL.equipped and wep.hasScope and CTRL.aimAlpha >= 0.82)
local hideBody1P = CTRL.equipped and not _G.WuzSniperSeeBody
local hideTopRound = (CTRL.ammo <= 0) or (CTRL.reloading and CTRL.reloadFromEmpty and CTRL.reloadTimer > (wep.reloadTime * 0.55))
for i = 1, TOTAL do
local b = STATE.blocks[i]
if b and b.part and b.part.Parent then
local gCF, gSz = computeBlockTarget(b, boneCFs)
b.targetCF, b.targetSize = gCF, gSz
if _G.WuzSniperSmooth then b.part.CFrame = gCF; b.part.Size = gSz end
if b.fxType then
local activeFx = isFxBlockActive(b)
b.part.Transparency = desiredFxTransparency(b)
b.part.LocalTransparencyModifier = activeFx and 0 or 1
elseif b.weaponId and not isWeaponBlockVisible(b) then
b.part.Transparency = 1
b.part.LocalTransparencyModifier = 1
elseif b.name == "MagTopRound" or b.name == "AK_MagTopRound" then
b.part.Transparency = hideTopRound and 1 or 0
b.part.LocalTransparencyModifier = scopeMask and 1 or 0
elseif b.isHead then
b.part.LocalTransparencyModifier = (CTRL.equipped or CTRL.transition == "equip" or scopeMask) and 1 or 0
elseif b.isBody then
b.part.LocalTransparencyModifier = (hideBody1P or scopeMask) and 1 or 0
else
b.part.Transparency = desiredBlockTransparency(b)
b.part.LocalTransparencyModifier = scopeMask and 1 or 0
end
end
end
end
-------------------------------------------------------------------
-- CAMERA, EQUIP & WEAPON SWITCHING (real operator camera dolly)
-------------------------------------------------------------------
local DOLLY_MIN, DOLLY_MAX = 0.5, 400
local restoreCameraAndMouse, enterFirstPerson, stopDolly, stepDolly
local function capturePristineCam()
if CTRL.pristineCam then return end
local cam = workspace.CurrentCamera
CTRL.pristineCam = {
mode = plr.CameraMode,
min = plr.CameraMinZoomDistance,
max = plr.CameraMaxZoomDistance,
fov = cam and cam.FieldOfView or CFG.baseFOV,
icon = UIS.MouseIconEnabled,
sens = UIS.MouseDeltaSensitivity,
}
CTRL.savedSens = CTRL.pristineCam.sens
CTRL.savedFOV = CTRL.pristineCam.fov
end
local function camHeadDistance()
local cam = workspace.CurrentCamera
local c = getChar()
local head = c and (c:FindFirstChild("Head") or c:FindFirstChild("HumanoidRootPart"))
if not cam or not head then return DOLLY_MIN end
return math.clamp((cam.CFrame.Position - head.Position).Magnitude, DOLLY_MIN, DOLLY_MAX)
end
-- Roblox clamps Min down to Max, so raise Max first, then pin both together
local function setCamDistance(dist)
dist = math.clamp(dist, DOLLY_MIN, DOLLY_MAX)
pcall(function()
plr.CameraMaxZoomDistance = DOLLY_MAX
plr.CameraMinZoomDistance = dist
plr.CameraMaxZoomDistance = dist
end)
end
function stopDolly()
local d = CTRL.dolly
d.active = false
d.phase = nil
d.t = 0
end
local function startDolly(phase, from, to, dur)
local d = CTRL.dolly
d.active = true
d.phase = phase
d.from = from
d.to = to
d.t = 0
d.dur = math.max(0.05, dur)
end
local function easeOutBack(u)
local c1 = 1.70158
local c3 = c1 + 1
return 1 + c3 * (u - 1) ^ 3 + c1 * (u - 1) ^ 2
end
function stepDolly(dt, cam)
local d = CTRL.dolly
if not d.active or not cam then return end
d.t += dt
local u = math.clamp(d.t / d.dur, 0, 1)
if d.phase == "in" then
setCamDistance(d.from + (d.to - d.from) * (1 - (1 - u) * (1 - u)))
if u >= 1 then
startDolly("out", camHeadDistance(), CFG.dollyOutStuds, CFG.dollyBackTime)
return
end
elseif d.phase == "out" then
setCamDistance(d.from + (d.to - d.from) * easeOutBack(u))
if u >= 1 then
stopDolly()
restoreCameraAndMouse()
return
end
elseif d.phase == "equip" then
setCamDistance(d.from + (d.to - d.from) * (1 - (1 - u) * (1 - u)))
if u >= 1 then
stopDolly()
enterFirstPerson()
return
end
end
local pr = CTRL.pristineCam
if pr and d.phase ~= "equip" then
cam.FieldOfView += (pr.fov - cam.FieldOfView) * (1 - math.exp(-9 * dt))
end
end
local function startOperatorDolly()
local cam = workspace.CurrentCamera
if not cam or not STATE.alive then restoreCameraAndMouse(); return end
capturePristineCam()
stopDolly()
local d0 = camHeadDistance()
pcall(function() plr.CameraMode = Enum.CameraMode.Classic end)
setCamDistance(d0)
pcall(function() UIS.MouseIconEnabled = CTRL.pristineCam.icon end)
startDolly("in", d0, math.min(d0, CFG.dollyInStuds), CFG.dollyInTime)
end
local function startEquipDolly(equipTime)
local cam = workspace.CurrentCamera
if not cam then return end
capturePristineCam()
stopDolly()
local d0 = camHeadDistance()
if d0 <= 1.2 then return end
pcall(function() plr.CameraMode = Enum.CameraMode.Classic end)
setCamDistance(d0)
startDolly("equip", d0, 0.6, (equipTime or 0.4) * 0.9)
end
local function beginHolster()
if not STATE.alive or _G.WuzSniperStop then return end
CTRL.equipped = false
CTRL.transition = "holster"
CTRL.transAlpha = 1
CTRL.aimHold, CTRL.aimToggle, CTRL.aimAlpha, CTRL.prevScoped = false, false, 0, false
CTRL.reloading, CTRL.inspecting, CTRL.boltTimer, CTRL.postShotHold, CTRL.fireHeld = false, false, 0, 0, false
playSFX("holster")
startOperatorDolly()
end
local function beginEquip()
if not STATE.alive or _G.WuzSniperStop then return end
local wep = WEAPONS[CTRL.weaponId] or WEAPONS.awp
CTRL.aimHold, CTRL.aimToggle, CTRL.aimAlpha, CTRL.prevScoped = false, false, 0, false
CTRL.reloading, CTRL.inspecting, CTRL.boltTimer, CTRL.postShotHold, CTRL.fireHeld = false, false, 0, 0, false
CTRL.transition = "equip"
CTRL.transAlpha = 0
playSFX("equip")
startEquipDolly(wep.equipTime)
end
function restoreCameraAndMouse()
if CTRL.camRestored then return end
CTRL.camRestored = true
stopDolly()
capturePristineCam()
local pr, cam = CTRL.pristineCam, workspace.CurrentCamera
if pr then
pcall(function()
plr.CameraMaxZoomDistance = pr.max
plr.CameraMinZoomDistance = pr.min
plr.CameraMaxZoomDistance = pr.max
end)
pcall(function() plr.CameraMode = pr.mode end)
if cam then cam.FieldOfView = pr.fov end
pcall(function() UIS.MouseIconEnabled = pr.icon end)
pcall(function() UIS.MouseDeltaSensitivity = pr.sens end)
end
local t = getF3XTool()
local handle = t and t:FindFirstChild("Handle")
if handle and handle:IsA("BasePart") then handle.LocalTransparencyModifier = 0 end
suppressBToolsUI(false)
end
function enterFirstPerson()
if CTRL.dolly.active and CTRL.dolly.phase == "equip" then return end
capturePristineCam()
CTRL.camRestored = false
plr.CameraMode = Enum.CameraMode.LockFirstPerson
plr.CameraMinZoomDistance, plr.CameraMaxZoomDistance = 0.5, 0.5
UIS.MouseIconEnabled = false
suppressBToolsUI(true)
end
local function hideLocalRealBody(parts, hide)
if not parts then return end
local mod = hide and 1 or 0
for _, p in ipairs(parts.realParts) do p.LocalTransparencyModifier = mod end
if parts.head then
for _, d in ipairs(parts.head:GetChildren()) do
if d:IsA("Decal") then
if hide then
if CTRL.savedFaceTrans[d] == nil then CTRL.savedFaceTrans[d] = d.Transparency end
d.Transparency = 1
elseif CTRL.savedFaceTrans[d] ~= nil then
d.Transparency = CTRL.savedFaceTrans[d]; CTRL.savedFaceTrans[d] = nil
end
end
end
end
end
local function syncRealBodyVisibility(hide)
if CTRL.bodyMaterialBusy or CTRL.serverBodyHidden == hide or os.clock() < CTRL.bodyMaterialNextAt then return end
local ep, parts = getF3XEndpoint(true), getCharParts(getChar())
if not ep or not parts then return end
local matItems, targetT = {}, hide and 1 or 0
for _, p in ipairs(parts.realParts) do
if p and p.Parent then
matItems[#matItems + 1] = { Part = p, Transparency = targetT }
end
end
if #matItems == 0 then CTRL.serverBodyHidden = hide; return end
CTRL.bodyMaterialBusy = true
local epEpoch = STATE.epoch
task.spawn(function()
local ok, res = pcall(function() return ep:InvokeServer("SyncMaterial", matItems) end)
if STATE.alive and epEpoch == STATE.epoch and (not ok or res == false) then
local anyOk = false
for _, item in ipairs(matItems) do
local ok1, res1 = pcall(function() return ep:InvokeServer("SyncMaterial", { item }) end)
if ok1 and res1 ~= false then anyOk = true end
end
ok, res = anyOk, anyOk
end
CTRL.bodyMaterialBusy = false
if STATE.alive and epEpoch == STATE.epoch then
if ok and res ~= false then
CTRL.serverBodyHidden = hide
CTRL.bodyMaterialNextAt = os.clock() + 0.05
else
CTRL.bodyMaterialNextAt = os.clock() + 0.50
end
end
end)
end
local function switchWeapon(targetId)
if not STATE.alive or _G.WuzSniperStop then return end
if not WEAPONS[targetId] then return end
if CTRL.equipped and CTRL.weaponId == targetId and CTRL.transition == nil then
beginHolster()
return
end
CTRL.ammoByWep[CTRL.weaponId] = CTRL.ammo
CTRL.weaponId = targetId
if WEAPONS[targetId].slot == 1 then CTRL.primaryId = targetId end
CTRL.ammo = CTRL.ammoByWep[targetId] or WEAPONS[targetId].maxAmmo
beginEquip()
end
local function toggleEquip()
if not STATE.alive or _G.WuzSniperStop then return end
if CTRL.transition == "equip" then beginHolster(); return end
if CTRL.transition == "holster" then beginEquip(); return end
if not CTRL.equipped then
CTRL.ammo = CTRL.ammoByWep[CTRL.weaponId] or WEAPONS[CTRL.weaponId].maxAmmo
beginEquip()
else
beginHolster()
end
end
-------------------------------------------------------------------
-- HITSCAN RAYCAST, BALLISTIC PROJECTILES & DYNAMIC F3X HOLE CARVING
-------------------------------------------------------------------
local function performPenetratingRaycast(origin, direction)
if CTRL.rayDirty or not CTRL.rayParams then refreshRayParams() end
local baseList, tempFilter = CTRL.rayParams.FilterDescendantsInstances, {}
for i = 1, #baseList do tempFilter[i] = baseList[i] end
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
params.RespectCanCollide, params.IgnoreWater = false, true
params.FilterDescendantsInstances = tempFilter
local curOrigin, remaining, unitDir = origin, direction.Magnitude, direction.Unit
for _ = 1, 12 do
if remaining <= 0.1 then break end
local hit = workspace:Raycast(curOrigin, unitDir * remaining, params)
if not hit then return nil end
local inst, skip = hit.Instance, false
if inst.Name == "HumanoidRootPart" or inst.Name == "__WuzSniperBullet" or inst.Name == "__WuzSniperImpact" then
skip = true
elseif _G.WuzSniperIgnoreAccessories and inst:FindFirstAncestorOfClass("Accessory") then
skip = true
else
local model = inst:FindFirstAncestorOfClass("Model")
local hum = model and model:FindFirstChildOfClass("Humanoid")
if hum and model ~= getChar() then return hit, model, hum
elseif inst.Transparency >= 0.98 and not inst.CanCollide then skip = true end
end
if skip then
tempFilter[#tempFilter + 1] = inst
params.FilterDescendantsInstances = tempFilter
remaining -= (hit.Position - curOrigin).Magnitude + 0.02
curOrigin = hit.Position + unitDir * 0.02
else
return hit, nil, nil
end
end
return nil
end
local function spawnImpactBurst(pos, isHostile)
task.spawn(function()
local p = Instance.new("Part")
p.Name = "__WuzSniperImpact"; p.Shape = Enum.PartType.Ball; p.Material = Enum.Material.Neon
p.Color = isHostile and Color3.fromRGB(255, 58, 72) or THEMES[CFG.themeIdx].core
p.Size = isHostile and V(0.75, 0.75, 0.75) or V(0.38, 0.38, 0.38)
p.Anchored, p.CanCollide, p.CanQuery, p.CanTouch, p.CastShadow = true, false, false, false, false
p.CFrame, p.Parent = C(pos), workspace
local t0 = os.clock()
while p.Parent do
local a = (os.clock() - t0) / 0.20
if a >= 1 then break end
p.Size = (isHostile and V(0.65, 0.65, 0.65) or V(0.34, 0.34, 0.34)) * (1 + a * 1.5)
p.Transparency = a
RunService.RenderStepped:Wait()
end
if p.Parent then p:Destroy() end
end)
end
local function startReload()
local wep = WEAPONS[CTRL.weaponId] or WEAPONS.awp
if not CTRL.equipped or CTRL.transition ~= nil or CTRL.reloading or CTRL.ammo >= wep.maxAmmo then return end
CTRL.reloadFromEmpty = (CTRL.ammo <= 0)
CTRL.reloading = true
CTRL.reloadTimer = CTRL.reloadFromEmpty and wep.reloadTime or (wep.reloadTime * 0.78)
CTRL.reloadStage = 0
CTRL.shellEjected = false
CTRL.boltTimer = 0
CTRL.postShotHold = 0
CTRL.inspecting = false
CTRL.aimHold, CTRL.aimToggle = false, false
end
local function makeBulletSubPart(name, size, mat, color, trans)
local p = Instance.new("Part")
p.Name, p.Size, p.Material, p.Color, p.Transparency = name, size, mat, color, trans
p.Anchored, p.CanCollide, p.CanQuery, p.CanTouch, p.CastShadow = true, false, false, false, false
p.Parent = workspace
return p
end
local function destroyLocalBulletVisual(proj)
if proj and proj.vis then
for _, p in ipairs(proj.vis) do if p and p.Parent then pcall(function() p:Destroy() end) end end
proj.vis = nil
end
end
local function updateLocalBulletVisual(proj, showLocal)
if not showLocal or not proj.alive then destroyLocalBulletVisual(proj); return end
local th = THEMES[CFG.themeIdx]
if not proj.vis then
proj.vis = {
makeBulletSubPart("__WuzSniperBullet", V(0.12, 0.12, 0.44), Enum.Material.Metal, th.brass, 0),
makeBulletSubPart("__WuzSniperBullet", V(0.11, 0.11, 1.10), Enum.Material.Neon, th.core, 0),
makeBulletSubPart("__WuzSniperBullet", V(0.07, 0.07, 3.50), Enum.Material.Neon, th.glow, 0.45),
}
end
local dir = (proj.vel.Magnitude > 1e-3) and proj.vel.Unit or V(0, 0, -1)
local headCF = CFrame.lookAt(proj.pos, proj.pos + dir)
local tl = math.clamp(proj.dist * 0.65, 0.45, 14)
proj.vis[1].CFrame = headCF * C(0, 0, -0.22)
proj.vis[2].CFrame = headCF * C(0, 0, 0.45)
proj.vis[3].Size = V(0.07, 0.07, tl); proj.vis[3].CFrame = headCF * C(0, 0, 1.00 + tl * 0.5)
end
local function carveHoleInHit(ep, part, hitPos, norm, rad)
if not ep or STATE.holeCarved[part] or not part or not part.Parent or part:IsA("Terrain") then return false end
if part.Name == "WuzSniper" or (part.Name == "Baseplate" and part.Size.Magnitude > 1200) then return false end
local cf, sz = part.CFrame, part.Size
local lHit, lNorm = cf:PointToObjectSpace(hitPos), cf:VectorToObjectSpace(norm)
local ax, ay, az = math.abs(lNorm.X), math.abs(lNorm.Y), math.abs(lNorm.Z)
local u = (ax >= ay and ax >= az) and "Y" or "X"
local w = (ax < ay and ay >= az) and "Z" or ((ax >= ay and ax >= az) and "Z" or "Y")
local hU, hW = sz[u] * 0.5, sz[w] * 0.5
if sz[u] < 0.25 or sz[w] < 0.25 then return false end
local cU = math.clamp(lHit[u], -hU + 0.05, hU - 0.05)
local cW = math.clamp(lHit[w], -hW + 0.05, hW - 0.05)
local radU = rad * (0.85 + math.random() * 0.33)
local radW = rad * (0.85 + math.random() * 0.33)
local u0, u1 = math.max(-hU, cU - radU), math.min(hU, cU + radU)
local w0, w1 = math.max(-hW, cW - radW), math.min(hW, cW + radW)
if (u1 - u0) < 0.08 or (w1 - w0) < 0.08 then return false end
local function box(a0, a1, b0, b1, pad)
local da, db = a1 - a0, b1 - b0
if da <= 0.02 or db <= 0.02 then return nil end
local o, s = { X = 0, Y = 0, Z = 0 }, { X = sz.X + pad, Y = sz.Y + pad, Z = sz.Z + pad }
o[u], o[w], s[u], s[w] = (a0 + a1) * 0.5, (b0 + b1) * 0.5, da, db
return { cf = cf * C(o.X, o.Y, o.Z), sz = V(s.X, s.Y, s.Z) }
end
local pcs = {}
local function addBox(tbl, b)
if b then tbl[#tbl + 1] = b end
end
addBox(pcs, box(-hU, hU, w1, hW, 0))
addBox(pcs, box(-hU, hU, -hW, w0, 0))
addBox(pcs, box(-hU, u0, w0, w1, 0))
addBox(pcs, box(u1, hU, w0, w1, 0))
if #pcs == 0 then return false end
local t = 0.06
local rims = {}
if _G.WuzSniperHoleRim ~= false then
addBox(rims, box(u0, u1, w1 - t, w1, 0.01))
addBox(rims, box(u0, u1, w0, w0 + t, 0.01))
addBox(rims, box(u0, u0 + t, w0 + t, w1 - t, 0.01))
addBox(rims, box(u1 - t, u1, w0 + t, w1 - t, 0.01))
end
STATE.holeCarved[part] = true
local col, mat, tr, anc, can = part.Color, part.Material, part.Transparency, part.Anchored, part.CanCollide
task.spawn(function()
local need = #pcs + #rims
local got = {}
while #got < need and #STATE.holePool > 0 do
local p = table.remove(STATE.holePool)
if p and p.Parent then got[#got + 1] = p end
end
if #got < need then spawnHoleParts(ep, need - #got, got) end
if #got < #pcs then STATE.holeCarved[part] = nil; return end
local rz, cl, mt, co, an = {}, {}, {}, {}, {}
local function bind(p, sp, pCol, pMat, pTr, pCan, isRim)
STATE.holeActive[#STATE.holeActive + 1] = p
if isRim then STATE.holeCarved[p] = true end
p.CFrame, p.Size, p.Color, p.Material, p.Transparency = sp.cf, sp.sz, pCol, pMat, pTr
rz[#rz + 1], cl[#cl + 1] = { Part = p, Size = sp.sz, CFrame = sp.cf }, { Part = p, Color = pCol }
mt[#mt + 1], co[#co + 1], an[#an + 1] = { Part = p, Material = pMat, Transparency = pTr }, { Part = p, CanCollide = pCan }, { Part = p, Anchored = anc }
end
for i, sp in ipairs(pcs) do bind(got[i], sp, col, mat, tr, can, false) end
for j, sp in ipairs(rims) do if got[#pcs + j] then bind(got[#pcs + j], sp, Color3.fromRGB(24, 22, 22), Enum.Material.Slate, 0, false, true) end end
part.Transparency, part.CanCollide = 1, false
syncHoleBatch(ep, "SyncResize", rz); syncHoleBatch(ep, "SyncColor", cl); syncHoleBatch(ep, "SyncMaterial", mt)
syncHoleBatch(ep, "SyncCollision", co); syncHoleBatch(ep, "SyncAnchor", an); syncHoleBatch(ep, "Remove", { part })
end)
return true
end
local function handleBulletImpact(hit, hitModel, hitHum, shotDir)
local hitPos, hitPart = hit.Position, hit.Instance
if not hitPart or not hitPart.Parent then return end
local isPerson = (hitModel ~= nil and hitHum ~= nil)
spawnImpactBurst(hitPos, isPerson)
task.spawn(function()
local len = 6.5
local p = makeBulletSubPart("__WuzSniperBullet", V(0.07, 0.07, len), Enum.Material.Neon, THEMES[CFG.themeIdx].core, 0.35)
p.CFrame = CFrame.lookAt(hitPos - shotDir * (len * 0.5), hitPos)
local t0 = os.clock()
while p.Parent do
local a = (os.clock() - t0) / 0.16
if a >= 1 then break end
p.Transparency = 0.35 + a * 0.65; p.Size = V(0.07 * (1 - a * 0.65), 0.07 * (1 - a * 0.65), len)
RunService.RenderStepped:Wait()
end
if p.Parent then p:Destroy() end
end)
if isPerson or _G.WuzSniperDeleteWorld then
CTRL.hitMarkerTimer = 0.24; CTRL.hitMarkerHostile = isPerson
playSFX(isPerson and "kill" or "hit")
local tp = hitModel and Players:GetPlayerFromCharacter(hitModel)
CTRL.lastDeleteNote = string.format("DELETED: %s [%s]", tp and tp.Name or (hitModel and hitModel.Name or "World"), hitPart.Name)
CTRL.lastDeleteAt = os.clock()
local ep = getF3XEndpoint(true)
if ep then
local rad = isPerson and 0.35 or (HOLE_RADIUS_BY_WEP[CTRL.weaponId] or 0.55)
if not carveHoleInHit(ep, hitPart, hitPos, hit.Normal, rad) then
task.spawn(function()
local ok, res = pcall(function() return ep:InvokeServer("Remove", { hitPart }) end)
if not ok or res == false then STATE.rejectCount += 1 end
end)
end
end
else
CTRL.hitMarkerTimer = 0.14; CTRL.hitMarkerHostile = false
playSFX("hit", 0.55, 0.90)
end
end
local function stepProjectiles(dt)
local list = CTRL.projectiles
if #list == 0 then CTRL.activeF3XBullet = nil; return end
local grav, i = CFG.bulletGravity or 0, 1
while i <= #list do
local proj = list[i]
if not proj.alive then
destroyLocalBulletVisual(proj); table.remove(list, i)
else
proj.age += dt; proj.vel += V(0, -grav * dt, 0)
local stepVec = proj.vel * dt
local stepDist = stepVec.Magnitude
if stepDist > 1e-4 then
local hit, hitModel, hitHum = performPenetratingRaycast(proj.pos, stepVec)
if hit and hit.Instance then
proj.pos = hit.Position; proj.dist += (hit.Position - proj.prevPos).Magnitude; proj.alive = false
local shotDir = (proj.vel.Magnitude > 1e-3) and proj.vel.Unit or V(0, 0, -1)
destroyLocalBulletVisual(proj); handleBulletImpact(hit, hitModel, hitHum, shotDir)
if CTRL.activeF3XBullet == proj then CTRL.activeF3XBullet = nil end
table.remove(list, i)
else
proj.prevPos = proj.pos; proj.pos += stepVec; proj.dist += stepDist
if proj.age >= (CFG.bulletMaxLife or 4.0) or proj.dist >= (CFG.bulletMaxDist or 2500) or proj.pos.Y < -500 then
proj.alive = false; destroyLocalBulletVisual(proj)
if CTRL.activeF3XBullet == proj then CTRL.activeF3XBullet = nil end
table.remove(list, i)
else
updateLocalBulletVisual(proj, proj ~= CTRL.activeF3XBullet); i += 1
end
end
else i += 1 end
end
end
if not CTRL.activeF3XBullet and #list > 0 then
CTRL.activeF3XBullet = list[#list]; destroyLocalBulletVisual(CTRL.activeF3XBullet)
end
end
local function fireWeapon()
if not CTRL.equipped or CTRL.transition ~= nil or CTRL.reloading or CTRL.boltTimer > 0 or CTRL.postShotHold > 0 or CTRL.fireCooldown > 0 then return end
local wep = WEAPONS[CTRL.weaponId] or WEAPONS.awp
if CTRL.ammo <= 0 then playSFX("dryfire"); startReload(); return end
local cam = workspace.CurrentCamera
if not cam then return end
CTRL.ammo -= 1
CTRL.ammoByWep[CTRL.weaponId] = CTRL.ammo
CTRL.inspecting = false; CTRL.triggerPull = 1.0
CTRL.fireCooldown = wep.fireRate
if CTRL.weaponId == "awp" then
CTRL.postShotHold = (CTRL.ammo > 0) and CFG.boltDelay or 0
CTRL.boltTimer = 0; CTRL.boltStage = 0; CTRL.shellEjected = false
else
ejectShell(CTRL.lastMuzzleCF or cam.CFrame)
end
playSFX(wep.sfxFire, 1.0, 0.97 + math.random() * 0.06)
local adsScale = 1 - 0.35 * CTRL.aimAlpha
CTRL.recoilPos += wep.recoilPos * adsScale
CTRL.recoilRot += V(math.rad(wep.recoilRot.X * adsScale), math.rad((math.random() - 0.5) * wep.recoilRot.Y * adsScale), math.rad((math.random() - 0.5) * wep.recoilRot.Z * adsScale))
CTRL.springPosVel += V((math.random() - 0.5) * 0.9 * adsScale, 1.2 * adsScale, 3.8 * adsScale)
CTRL.springRotVel += V(math.rad(85 * adsScale), math.rad((math.random() - 0.5) * 24 * adsScale), math.rad((math.random() - 0.5) * 45 * adsScale))
if _G.WuzSniperRecoilKick then
CTRL.fovKick = (CTRL.weaponId == "awp" and 5.5 or 1.8) * (1 - 0.3 * CTRL.aimAlpha)
CTRL.camKickPitch = (CTRL.camKickPitch or 0) + math.rad((wep.kickPitch or 0.06) * (1 - 0.35 * CTRL.aimAlpha))
CTRL.camKickYaw = (CTRL.camKickYaw or 0) + math.rad((math.random() - 0.5) * (wep.kickYaw or 0.02) * (1 - 0.35 * CTRL.aimAlpha))
CTRL.camKickRoll = (CTRL.camKickRoll or 0) + math.rad((math.random() - 0.5) * (wep.kickRoll or 0.03) * (1 - 0.35 * CTRL.aimAlpha))
end
local camPos, camDir = cam.CFrame.Position, cam.CFrame.LookVector
local maxRange = CFG.bulletMaxDist or 2500
local aimHit = performPenetratingRaycast(camPos, camDir * maxRange)
local aimPoint = aimHit and aimHit.Position or (camPos + camDir * maxRange)
local muzzlePos = CTRL.lastMuzzlePos or (camPos + camDir * 2.5)
local spawnPos, launchDir = muzzlePos, camDir
if aimHit and (aimHit.Position - camPos).Magnitude <= (muzzlePos - camPos).Magnitude + 0.6 then
spawnPos = camPos + camDir * 0.45
else
local toAim = aimPoint - muzzlePos
if toAim.Magnitude > 1.0 and toAim.Unit:Dot(camDir) > 0.35 then launchDir = toAim.Unit end
end
CTRL.fxMuzzleCF = CTRL.lastMuzzleCF or (C(muzzlePos) * cam.CFrame.Rotation)
CTRL.fxMuzzlePos, CTRL.fxHitPos, CTRL.fxDuration, CTRL.fxTimer, CTRL.fxRoll = muzzlePos, aimPoint, 0.05, 0.05, math.random() * math.pi * 2
local proj = { pos = spawnPos, prevPos = spawnPos, vel = launchDir * (tonumber(_G.WuzSniperBulletSpeed) or CFG.bulletSpeed), dist = 0, age = 0, alive = true, vis = nil }
CTRL.projectiles[#CTRL.projectiles + 1] = proj
if CTRL.activeF3XBullet and CTRL.activeF3XBullet.alive then updateLocalBulletVisual(CTRL.activeF3XBullet, true) end
CTRL.activeF3XBullet = proj
if CTRL.ammo <= 0 then
task.delay(0.32, function()
if STATE.alive and CTRL.equipped and CTRL.ammo <= 0 and not CTRL.reloading then startReload() end
end)
end
end
-------------------------------------------------------------------
-- DRAWING API HUD (CS:GO PANORAMA HUD + SCOPE + KILLFEED)
-------------------------------------------------------------------
local DRAW = {
objs = {}, isSunc = false, lastVP = Vector2.zero,
lastSeenDeleteAt = 0, cash = 4750, kills = 0,
killfeed = {}, sessionStart = os.clock(), topInset = 36,
}
local function detectDrawingPolarity()
local ok, p = pcall(Drawing.new, "Square")
if ok and p then
local t = p.Transparency
pcall(function() if p.Remove then p:Remove() else p:Destroy() end end)
DRAW.isSunc = (t == 0)
end
end
local function dAlpha(opacity)
local a = math.clamp(opacity, 0, 1)
return DRAW.isSunc and (1 - a) or a
end
local function D(kind, props)
local obj = Drawing.new(kind)
if props then
for k, v in pairs(props) do
if k ~= "Opacity" then obj[k] = v end
end
if props.Opacity ~= nil then obj.Transparency = dAlpha(props.Opacity) end
end
DRAW.objs[#DRAW.objs + 1] = obj
return obj
end
local function measureTextW(obj, fallbackChars)
local b = obj.TextBounds
if b and b.X and b.X > 2 then return b.X end
return fallbackChars * ((obj.Size or 14) * 0.56)
end
local function formatCash(n)
local s = tostring(math.max(0, math.floor(n)))
return "$" .. (string.reverse((string.gsub(string.reverse(s), "(%d%d%d)", "%1,"))):gsub("^,", ""))
end
local function formatStanceTag()
local tag = CTRL.inAir and "AIR" or (CTRL.crouching and "CROUCH") or (CTRL.walking and "WALK") or (CTRL.moveVelXZ.Magnitude > 1.0 and "RUN" or "STAND")
if CTRL.leanAlpha < -0.25 then tag = tag .. " | PEEK L" elseif CTRL.leanAlpha > 0.25 then tag = tag .. " | PEEK R" end
return tag
end
local FONT_UI = (Drawing.Fonts and (Drawing.Fonts.Plex or Drawing.Fonts.UI)) or 2
local FONT_MONO = (Drawing.Fonts and Drawing.Fonts.Monospace) or 3
local function buildHUD()
for _, o in ipairs(DRAW.objs) do pcall(function() if o.Remove then o:Remove() else o:Destroy() end end) end
DRAW.objs = {}
DRAW.lastVP = Vector2.zero
DRAW.lastSeenDeleteAt = CTRL.lastDeleteAt or 0
DRAW.killfeed = {}
DRAW.sessionStart = os.clock()
detectDrawingPolarity()
local csBg = Color3.fromRGB(12, 15, 20)
local csWhite = Color3.fromRGB(244, 246, 250)
local csMuted = Color3.fromRGB(168, 176, 190)
DRAW.scopeSquares = {}
for i = 1, 4 do DRAW.scopeSquares[i] = D("Square", { Filled = true, Color = Color3.fromRGB(3, 4, 6), Opacity = 1, ZIndex = 20, Visible = false }) end
DRAW.scopeTris = {}
local triOk = pcall(function()
for i = 1, 32 do DRAW.scopeTris[i] = D("Triangle", { Filled = true, Color = Color3.fromRGB(3, 4, 6), Opacity = 1, ZIndex = 20, Visible = false }) end
end)
if not triOk then
for _, t in ipairs(DRAW.scopeTris) do pcall(function() t:Remove() end) end
DRAW.scopeTris = {}
DRAW.scopeFallback = D("Circle", { Filled = false, NumSides = 72, Thickness = 900, Color = Color3.fromRGB(3, 4, 6), Opacity = 1, ZIndex = 20, Visible = false })
end
DRAW.scopeShadow = D("Circle", { Filled = false, NumSides = 72, Thickness = 18, Color = Color3.fromRGB(4, 5, 8), Opacity = 0.56, ZIndex = 22, Visible = false })
DRAW.scopeRing = D("Circle", { Filled = false, NumSides = 72, Thickness = 3.5, Color = Color3.fromRGB(18, 20, 24), Opacity = 0.98, ZIndex = 23, Visible = false })
DRAW.scopeLineH = D("Line", { Thickness = 1.4, Color = Color3.fromRGB(8, 10, 12), Opacity = 0.95, ZIndex = 22, Visible = false })
DRAW.scopeLineV = D("Line", { Thickness = 1.4, Color = Color3.fromRGB(8, 10, 12), Opacity = 0.95, ZIndex = 22, Visible = false })
DRAW.scopeBlurH1 = D("Line", { Thickness = 1.5, Color = Color3.fromRGB(10, 12, 16), Opacity = 0.40, ZIndex = 22, Visible = false })
DRAW.scopeBlurH2 = D("Line", { Thickness = 1.5, Color = Color3.fromRGB(10, 12, 16), Opacity = 0.40, ZIndex = 22, Visible = false })
DRAW.scopeBlurV1 = D("Line", { Thickness = 1.5, Color = Color3.fromRGB(10, 12, 16), Opacity = 0.40, ZIndex = 22, Visible = false })
DRAW.scopeBlurV2 = D("Line", { Thickness = 1.5, Color = Color3.fromRGB(10, 12, 16), Opacity = 0.40, ZIndex = 22, Visible = false })
DRAW.scopePosts = {}
for i = 1, 4 do DRAW.scopePosts[i] = D("Line", { Thickness = 4.8, Color = Color3.fromRGB(6, 8, 10), Opacity = 0.98, ZIndex = 23, Visible = false }) end
DRAW.scopeTicks = {}
for i = 1, 16 do DRAW.scopeTicks[i] = D("Line", { Thickness = 1.4, Color = Color3.fromRGB(10, 12, 16), Opacity = 0.92, ZIndex = 23, Visible = false }) end
DRAW.scopeZoomLbl = D("Text", { Size = 14, Font = FONT_MONO, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = csMuted, Opacity = 0.9, ZIndex = 26, Visible = false })
DRAW.scopeDistLbl = D("Text", { Size = 14, Font = FONT_MONO, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = csMuted, Opacity = 0.9, ZIndex = 26, Visible = false })
DRAW.scopeTargetLbl = D("Text", { Size = 15, Font = FONT_MONO, Center = true, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = Color3.fromRGB(240, 74, 74), Opacity = 1, ZIndex = 26, Visible = false })
DRAW.chOut, DRAW.chFg = {}, {}
for i = 1, 4 do
DRAW.chOut[i] = D("Line", { Thickness = 3.6, Color = Color3.fromRGB(6, 8, 10), Opacity = 0.88, ZIndex = 30, Visible = false })
DRAW.chFg[i] = D("Line", { Thickness = 1.6, Color = Color3.fromRGB(76, 255, 104), Opacity = 0.96, ZIndex = 31, Visible = false })
end
DRAW.chDotOut = D("Square", { Filled = true, Size = Vector2.new(4, 4), Color = Color3.fromRGB(6, 8, 10), Opacity = 0.88, ZIndex = 30, Visible = false })
DRAW.chDot = D("Square", { Filled = true, Size = Vector2.new(2, 2), Color = Color3.fromRGB(76, 255, 104), Opacity = 0.96, ZIndex = 31, Visible = false })
DRAW.hitLines = {}
for i = 1, 4 do DRAW.hitLines[i] = D("Line", { Thickness = 2.0, Color = Color3.fromRGB(255, 62, 68), Opacity = 1, ZIndex = 35, Visible = false }) end
DRAW.matchBg = D("Square", { Filled = true, Color = csBg, Opacity = 0.68, ZIndex = 40, Visible = false })
DRAW.matchCtBar = D("Square", { Filled = true, Color = Color3.fromRGB(96, 152, 218), Opacity = 0.95, ZIndex = 41, Visible = false })
DRAW.matchTBar = D("Square", { Filled = true, Color = Color3.fromRGB(218, 176, 94), Opacity = 0.95, ZIndex = 41, Visible = false })
DRAW.matchCtLbl = D("Text", { Size = 16, Font = FONT_UI, Center = true, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = Color3.fromRGB(132, 184, 244), Opacity = 1, ZIndex = 42, Visible = false })
DRAW.matchTimeLbl = D("Text", { Size = 15, Font = FONT_MONO, Center = true, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = csWhite, Opacity = 1, ZIndex = 42, Visible = false })
DRAW.matchTLbl = D("Text", { Size = 16, Font = FONT_UI, Center = true, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = Color3.fromRGB(238, 198, 114), Opacity = 1, ZIndex = 42, Visible = false })
DRAW.cashBg = D("Square", { Filled = true, Color = csBg, Opacity = 0.66, ZIndex = 40, Visible = false })
DRAW.cashLbl = D("Text", { Size = 18, Font = FONT_UI, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = Color3.fromRGB(128, 204, 102), Opacity = 1, ZIndex = 42, Visible = false })
DRAW.stanceLbl = D("Text", { Size = 12, Font = FONT_MONO, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = csMuted, Opacity = 0.95, ZIndex = 42, Visible = false })
DRAW.hpBg = D("Square", { Filled = true, Color = csBg, Opacity = 0.72, ZIndex = 40, Visible = false })
DRAW.hpCrossH = D("Square", { Filled = true, Size = Vector2.new(14, 4), Color = csWhite, Opacity = 0.95, ZIndex = 42, Visible = false })
DRAW.hpCrossV = D("Square", { Filled = true, Size = Vector2.new(4, 14), Color = csWhite, Opacity = 0.95, ZIndex = 42, Visible = false })
DRAW.hpLbl = D("Text", { Size = 28, Font = FONT_UI, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = csWhite, Opacity = 1, ZIndex = 43, Visible = false })
DRAW.hpBarBg = D("Square", { Filled = true, Color = Color3.fromRGB(36, 42, 52), Opacity = 0.80, ZIndex = 41, Visible = false })
DRAW.hpBarFg = D("Square", { Filled = true, Color = csWhite, Opacity = 0.95, ZIndex = 42, Visible = false })
DRAW.hpSep = D("Square", { Filled = true, Size = Vector2.new(1, 32), Color = Color3.fromRGB(70, 78, 92), Opacity = 0.65, ZIndex = 41, Visible = false })
DRAW.armShield = D("Square", { Filled = true, Size = Vector2.new(12, 10), Color = csWhite, Opacity = 0.92, ZIndex = 42, Visible = false })
pcall(function()
DRAW.armTip = D("Triangle", { Filled = true, Color = csWhite, Opacity = 0.92, ZIndex = 42, Visible = false })
end)
DRAW.armLbl = D("Text", { Size = 28, Font = FONT_UI, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = csWhite, Opacity = 1, ZIndex = 43, Visible = false })
DRAW.armBarBg = D("Square", { Filled = true, Color = Color3.fromRGB(36, 42, 52), Opacity = 0.80, ZIndex = 41, Visible = false })
DRAW.armBarFg = D("Square", { Filled = true, Color = Color3.fromRGB(114, 166, 224), Opacity = 0.95, ZIndex = 42, Visible = false })
DRAW.slot1Bg = D("Square", { Filled = true, Color = csBg, Opacity = 0.62, ZIndex = 40, Visible = false })
DRAW.slot1Bar = D("Square", { Filled = true, Size = Vector2.new(3, 24), Color = csWhite, Opacity = 1, ZIndex = 42, Visible = false })
DRAW.slot1Lbl = D("Text", { Size = 14, Font = FONT_UI, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = csWhite, Text = "1 AWP", Opacity = 1, ZIndex = 42, Visible = false })
DRAW.slot2Bg = D("Square", { Filled = true, Color = csBg, Opacity = 0.62, ZIndex = 40, Visible = false })
DRAW.slot2Bar = D("Square", { Filled = true, Size = Vector2.new(3, 24), Color = csWhite, Opacity = 1, ZIndex = 42, Visible = false })
DRAW.slot2Lbl = D("Text", { Size = 14, Font = FONT_UI, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = csMuted, Text = "2 DEAGLE", Opacity = 1, ZIndex = 42, Visible = false })
DRAW.slot3Bg = D("Square", { Filled = true, Color = csBg, Opacity = 0.45, ZIndex = 40, Visible = false })
DRAW.slot3Bar = D("Square", { Filled = true, Size = Vector2.new(3, 24), Color = csWhite, Opacity = 1, ZIndex = 42, Visible = false })
DRAW.slot3Lbl = D("Text", { Size = 14, Font = FONT_UI, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = csMuted, Text = "3 OPERATOR", Opacity = 1, ZIndex = 42, Visible = false })
DRAW.ammoBg = D("Square", { Filled = true, Color = csBg, Opacity = 0.72, ZIndex = 40, Visible = false })
DRAW.ammoLbl = D("Text", { Size = 30, Font = FONT_UI, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = csWhite, Opacity = 1, ZIndex = 43, Visible = false })
DRAW.resLbl = D("Text", { Size = 17, Font = FONT_UI, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = csMuted, Opacity = 0.95, ZIndex = 43, Visible = false })
DRAW.stateLbl = D("Text", { Size = 12, Font = FONT_MONO, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = csMuted, Opacity = 0.95, ZIndex = 43, Visible = false })
DRAW.ammoProg = D("Square", { Filled = true, Color = csWhite, Opacity = 0.95, ZIndex = 42, Visible = false })
DRAW.hintLbl = D("Text", { Size = 12, Font = FONT_UI, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = csMuted, Text = "[1/2] Armas • [4/G] AWP/AK47 • [R] Reload • [Ctrl/C] Crouch", Opacity = 0.88, ZIndex = 43, Visible = false })
DRAW.ammoPips = {}
for i = 1, 7 do DRAW.ammoPips[i] = D("Square", { Filled = true, Size = Vector2.new(4, 16), Color = csWhite, Opacity = 0.95, ZIndex = 43, Visible = false }) end
DRAW.kfRows = {}
for i = 1, 4 do
local r = {
bg = D("Square", { Filled = true, Color = Color3.fromRGB(14, 16, 20), Opacity = 0.78, ZIndex = 44, Visible = false }),
border = D("Square", { Filled = false, Thickness = 1.5, Color = Color3.fromRGB(220, 52, 52), Opacity = 0.95, ZIndex = 45, Visible = false }),
killer = D("Text", { Size = 14, Font = FONT_UI, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = Color3.fromRGB(114, 166, 224), Opacity = 1, ZIndex = 46, Visible = false }),
awpBody = D("Square", { Filled = true, Size = Vector2.new(18, 4), Color = csWhite, Opacity = 0.95, ZIndex = 46, Visible = false }),
awpScope = D("Square", { Filled = true, Size = Vector2.new(8, 2), Color = csWhite, Opacity = 0.95, ZIndex = 46, Visible = false }),
awpBarl = D("Line", { Thickness = 1.8, Color = csWhite, Opacity = 0.95, ZIndex = 46, Visible = false }),
hsRing = D("Circle", { Filled = false, Radius = 5, NumSides = 16, Thickness = 1.4, Color = csWhite, Opacity = 0.95, ZIndex = 46, Visible = false }),
hsDot = D("Circle", { Filled = true, Radius = 2, NumSides = 12, Color = Color3.fromRGB(235, 62, 62), Opacity = 1, ZIndex = 47, Visible = false }),
victim = D("Text", { Size = 14, Font = FONT_UI, Outline = true, OutlineColor = Color3.new(0, 0, 0), Color = Color3.fromRGB(224, 184, 102), Opacity = 1, ZIndex = 46, Visible = false }),
}
DRAW.kfRows[i] = r
end
end
local function layoutStaticViewport(vp)
DRAW.lastVP = vp
local insetOk, topLeftInset = pcall(function() return (GuiService:GetGuiInset()) end)
local topInset = (insetOk and typeof(topLeftInset) == "Vector2") and topLeftInset.Y or 36
DRAW.topInset = topInset
local isMobile = UIS.TouchEnabled or _G.WuzSniperMobile
local cx, cy = vp.X * 0.5, vp.Y * 0.5
local R = math.floor(math.min(vp.X, vp.Y) * 0.42)
do
local mw, mh = 196, 32
local mx, my = math.floor(cx - mw * 0.5), topInset + 6
DRAW.matchBg.Position, DRAW.matchBg.Size = Vector2.new(mx, my), Vector2.new(mw, mh)
DRAW.matchCtBar.Position, DRAW.matchCtBar.Size = Vector2.new(mx, my), Vector2.new(54, 2)
DRAW.matchTBar.Position, DRAW.matchTBar.Size = Vector2.new(mx + mw - 54, my), Vector2.new(54, 2)
DRAW.matchCtLbl.Position = Vector2.new(mx + 27, my + 8)
DRAW.matchTimeLbl.Position = Vector2.new(cx, my + 8)
DRAW.matchTLbl.Position = Vector2.new(mx + mw - 27, my + 8)
end
do
local bw, bh = 260, 50
local bx, by
if isMobile then
bx = vp.X - bw - 16
by = topInset + 38
DRAW.cashBg.Position, DRAW.cashBg.Size = Vector2.new(bx, topInset + 8), Vector2.new(bw, 26)
DRAW.cashLbl.Position = Vector2.new(bx + 10, topInset + 12)
DRAW.stanceLbl.Position = Vector2.new(bx + 112, topInset + 15)
else
bx, by = 20, vp.Y - 72
DRAW.cashBg.Position, DRAW.cashBg.Size = Vector2.new(bx, by - 30), Vector2.new(bw, 26)
DRAW.cashLbl.Position = Vector2.new(bx + 10, by - 26)
DRAW.stanceLbl.Position = Vector2.new(bx + 112, by - 23)
end
DRAW.hpBg.Position, DRAW.hpBg.Size = Vector2.new(bx, by), Vector2.new(bw, bh)
DRAW.hpCrossH.Position = Vector2.new(bx + 12, by + 20)
DRAW.hpCrossV.Position = Vector2.new(bx + 17, by + 15)
DRAW.hpLbl.Position = Vector2.new(bx + 34, by + 7)
DRAW.hpBarBg.Position, DRAW.hpBarBg.Size = Vector2.new(bx + 12, by + 40), Vector2.new(104, 3)
DRAW.hpBarFg.Position, DRAW.hpBarFg.Size = Vector2.new(bx + 12, by + 40), Vector2.new(104, 3)
DRAW.hpSep.Position = Vector2.new(bx + 128, by + 9)
DRAW.armShield.Position = Vector2.new(bx + 140, by + 13)
if DRAW.armTip then
DRAW.armTip.PointA = Vector2.new(bx + 140, by + 23)
DRAW.armTip.PointB = Vector2.new(bx + 152, by + 23)
DRAW.armTip.PointC = Vector2.new(bx + 146, by + 30)
end
DRAW.armLbl.Position = Vector2.new(bx + 160, by + 7)
DRAW.armBarBg.Position, DRAW.armBarBg.Size = Vector2.new(bx + 140, by + 40), Vector2.new(106, 3)
DRAW.armBarFg.Position, DRAW.armBarFg.Size = Vector2.new(bx + 140, by + 40), Vector2.new(106, 3)
end
do
local aw, ah = 236, 50
local sw, sh = 164, 24
local ax = vp.X - aw - (isMobile and 16 or 20)
local ay = isMobile and (topInset + 102) or (vp.Y - ah - 20)
DRAW.slot3Bg.Size = Vector2.new(sw, sh)
DRAW.slot2Bg.Size = Vector2.new(sw, sh)
DRAW.slot1Bg.Size = Vector2.new(sw, sh)
DRAW.ammoBg.Position, DRAW.ammoBg.Size = Vector2.new(ax, ay), Vector2.new(aw, ah)
DRAW.ammoLbl.Position = Vector2.new(ax + 14, ay + 6)
DRAW.resLbl.Position = Vector2.new(ax + 54, ay + 15)
DRAW.ammoProg.Position, DRAW.ammoProg.Size = Vector2.new(ax, ay + ah - 3), Vector2.new(0, 3)
for i = 1, 7 do
DRAW.ammoPips[i].Position = Vector2.new(ax + 114 + (i - 1) * 10, ay + 15)
end
DRAW.hintLbl.Position = Vector2.new(vp.X - 420, vp.Y - 17)
end
do
local left, right, top, bot = cx - R, cx + R, cy - R, cy + R
DRAW.scopeSquares[1].Position, DRAW.scopeSquares[1].Size = Vector2.new(0, 0), Vector2.new(left, vp.Y)
DRAW.scopeSquares[2].Position, DRAW.scopeSquares[2].Size = Vector2.new(right, 0), Vector2.new(vp.X - right, vp.Y)
DRAW.scopeSquares[3].Position, DRAW.scopeSquares[3].Size = Vector2.new(left, 0), Vector2.new(R * 2, top)
DRAW.scopeSquares[4].Position, DRAW.scopeSquares[4].Size = Vector2.new(left, bot), Vector2.new(R * 2, vp.Y - bot)
if #DRAW.scopeTris == 32 then
local corners = {
{ Vector2.new(right, top), -math.pi * 0.5, 0 },
{ Vector2.new(right, bot), 0, math.pi * 0.5 },
{ Vector2.new(left, bot), math.pi * 0.5, math.pi },
{ Vector2.new(left, top), math.pi, math.pi * 1.5 },
}
local ti = 1
for _, q in ipairs(corners) do
local cPt, a0, a1 = q[1], q[2], q[3]
for s = 0, 7 do
local t0, t1 = a0 + (a1 - a0) * (s / 8), a0 + (a1 - a0) * ((s + 1) / 8)
local tri = DRAW.scopeTris[ti]
tri.PointA = cPt
tri.PointB = Vector2.new(cx + math.cos(t0) * R, cy + math.sin(t0) * R)
tri.PointC = Vector2.new(cx + math.cos(t1) * R, cy + math.sin(t1) * R)
ti += 1
end
end
elseif DRAW.scopeFallback then
DRAW.scopeFallback.Position = Vector2.new(cx, cy)
DRAW.scopeFallback.Radius = R + 450
end
DRAW.scopeRing.Position, DRAW.scopeRing.Radius = Vector2.new(cx, cy), R
DRAW.scopeLineH.From, DRAW.scopeLineH.To = Vector2.new(left, cy), Vector2.new(right, cy)
DRAW.scopeLineV.From, DRAW.scopeLineV.To = Vector2.new(cx, top), Vector2.new(cx, bot)
local postInner = math.floor(R * 0.36)
DRAW.scopePosts[1].From, DRAW.scopePosts[1].To = Vector2.new(left, cy), Vector2.new(cx - postInner, cy)
DRAW.scopePosts[2].From, DRAW.scopePosts[2].To = Vector2.new(cx + postInner, cy), Vector2.new(right, cy)
DRAW.scopePosts[3].From, DRAW.scopePosts[3].To = Vector2.new(cx, cy + postInner), Vector2.new(cx, bot)
DRAW.scopePosts[4].From, DRAW.scopePosts[4].To = Vector2.new(cx, top), Vector2.new(cx, cy - postInner * 1.15)
local tickStep = math.floor(R * 0.085)
local tk = 1
for m = -4, 4 do
if m ~= 0 then
local len = (math.abs(m) % 2 == 0) and 5 or 3
local lh = DRAW.scopeTicks[tk]; lh.From, lh.To = Vector2.new(cx + m * tickStep, cy - len), Vector2.new(cx + m * tickStep, cy + len); tk += 1
local lv = DRAW.scopeTicks[tk]; lv.From, lv.To = Vector2.new(cx - len, cy + m * tickStep), Vector2.new(cx + len, cy + m * tickStep); tk += 1
end
end
DRAW.scopeZoomLbl.Position = Vector2.new(cx - math.floor(R * 0.56), cy + math.floor(R * 0.50))
DRAW.scopeDistLbl.Position = Vector2.new(cx + math.floor(R * 0.28), cy + math.floor(R * 0.50))
DRAW.scopeTargetLbl.Position = Vector2.new(cx, cy + math.floor(R * 0.58))
end
end
local function updateHUD(cam)
if not cam or #DRAW.objs == 0 then return end
local vp = cam.ViewportSize
if (vp - DRAW.lastVP).Magnitude > 1 then layoutStaticViewport(vp) end
local th = THEMES[CFG.themeIdx]
local wep = WEAPONS[CTRL.weaponId] or WEAPONS.awp
local hudAlpha = math.clamp(tonumber(_G.WuzSniperHudAlpha) or 0.72, 0.25, 0.95)
local active = CTRL.equipped
local scoped = active and wep.hasScope and CTRL.aimAlpha >= 0.82
local spd = CTRL.moveVelXZ.Magnitude
local stanceStr = formatStanceTag()
local cx, cy = vp.X * 0.5, vp.Y * 0.5
local R = math.floor(math.min(vp.X, vp.Y) * 0.42)
if (CTRL.lastDeleteAt or 0) > (DRAW.lastSeenDeleteAt or 0) and CTRL.lastDeleteNote ~= "" then
DRAW.lastSeenDeleteAt = CTRL.lastDeleteAt
local target, part = string.match(CTRL.lastDeleteNote, "^DELETED:%s*(.-)%s*%[(.-)%]$")
target = target or "Target"
part = part or "Torso"
local isHS = (string.lower(part) == "head")
if CTRL.hitMarkerHostile then
DRAW.kills += 1
DRAW.cash = math.min(16000, DRAW.cash + (isHS and 300 or 100))
end
table.insert(DRAW.killfeed, 1, {
killer = plr.Name,
victim = CTRL.hitMarkerHostile and target or (target .. " [" .. part .. "]"),
headshot = isHS,
at = os.clock(),
})
while #DRAW.killfeed > 4 do table.remove(DRAW.killfeed) end
end
if active then
local hit, hitModel, hitHum = performPenetratingRaycast(cam.CFrame.Position, cam.CFrame.LookVector * 1500)
if hit and hit.Instance then
CTRL.currentTargetDist = math.floor((hit.Position - cam.CFrame.Position).Magnitude + 0.5)
if hitModel and hitHum then
local tp = Players:GetPlayerFromCharacter(hitModel)
CTRL.currentTargetHostile = true
CTRL.currentTargetText = string.format("%s [%s]", tp and tp.Name or hitModel.Name, hit.Instance.Name)
else
CTRL.currentTargetHostile = false; CTRL.currentTargetText = ""
end
else
CTRL.currentTargetDist = nil; CTRL.currentTargetHostile = false; CTRL.currentTargetText = ""
end
else
CTRL.currentTargetDist = nil; CTRL.currentTargetHostile = false; CTRL.currentTargetText = ""
end
do
local elapsed = math.floor(os.clock() - DRAW.sessionStart)
local mins, secs = math.floor(elapsed / 60), elapsed % 60
local aliveOther = math.max(0, #Players:GetPlayers() - 1)
DRAW.matchBg.Visible = true; DRAW.matchBg.Transparency = dAlpha(hudAlpha * 0.92)
DRAW.matchCtBar.Visible = true; DRAW.matchTBar.Visible = true
DRAW.matchCtLbl.Visible = true; DRAW.matchCtLbl.Text = tostring(DRAW.kills)
DRAW.matchTimeLbl.Visible = true; DRAW.matchTimeLbl.Text = string.format("%02d:%02d", mins, secs)
DRAW.matchTLbl.Visible = true; DRAW.matchTLbl.Text = tostring(aliveOther)
end
do
local char = plr.Character
local hum = char and char:FindFirstChildOfClass("Humanoid")
local hp = hum and math.clamp(math.floor(hum.Health + 0.5), 0, 999) or 100
local maxHp = hum and math.max(1, hum.MaxHealth) or 100
local hpFrac = math.clamp(hp / maxHp, 0, 1)
local lowHp = hp <= 25
local hpCol = lowHp and Color3.fromRGB(235, 58, 52) or Color3.fromRGB(244, 246, 250)
DRAW.cashBg.Visible = true; DRAW.cashBg.Transparency = dAlpha(hudAlpha * 0.9)
DRAW.cashLbl.Visible = true; DRAW.cashLbl.Text = formatCash(DRAW.cash)
DRAW.stanceLbl.Visible = true; DRAW.stanceLbl.Text = string.format("%s %.0f u/s", stanceStr, spd * 12)
DRAW.hpBg.Visible = true; DRAW.hpBg.Transparency = dAlpha(hudAlpha)
DRAW.hpCrossH.Visible = true; DRAW.hpCrossH.Color = hpCol
DRAW.hpCrossV.Visible = true; DRAW.hpCrossV.Color = hpCol
DRAW.hpLbl.Visible = true; DRAW.hpLbl.Text = tostring(hp); DRAW.hpLbl.Color = hpCol
DRAW.hpBarBg.Visible = true; DRAW.hpBarFg.Visible = true
DRAW.hpBarFg.Size = Vector2.new(math.max(1, math.floor(104 * hpFrac)), 3)
DRAW.hpBarFg.Color = hpCol
DRAW.hpSep.Visible = true
DRAW.armShield.Visible = true
if DRAW.armTip then DRAW.armTip.Visible = true end
DRAW.armLbl.Visible = true; DRAW.armLbl.Text = "100"
DRAW.armBarBg.Visible = true; DRAW.armBarFg.Visible = true
DRAW.armBarFg.Color = th.glow
end
do
local isMobile = UIS.TouchEnabled or _G.WuzSniperMobile
local aw, ah = 236, 50
local ax = vp.X - aw - (isMobile and 16 or 20)
local ay = isMobile and (DRAW.topInset + 102) or (vp.Y - ah - 20)
local sw, sh = 164, 24
local sx = vp.X - sw - (isMobile and 16 or 20)
local slot1Active = active and wep.slot == 1
local slot2Active = active and wep.slot == 2
DRAW.slot1Bg.Visible = true; DRAW.slot1Bg.Transparency = dAlpha(slot1Active and hudAlpha or hudAlpha * 0.62)
DRAW.slot1Bar.Visible = slot1Active; DRAW.slot1Bar.Color = th.glow
DRAW.slot1Lbl.Visible = true
DRAW.slot1Lbl.Text = "1 " .. WEAPONS[CTRL.primaryId].name
DRAW.slot1Lbl.Color = slot1Active and Color3.fromRGB(248, 250, 255) or Color3.fromRGB(145, 152, 166)
DRAW.slot2Bg.Visible = true; DRAW.slot2Bg.Transparency = dAlpha(slot2Active and hudAlpha or hudAlpha * 0.62)
DRAW.slot2Bar.Visible = slot2Active; DRAW.slot2Bar.Color = th.glow
DRAW.slot2Lbl.Visible = true
DRAW.slot2Lbl.Color = slot2Active and Color3.fromRGB(248, 250, 255) or Color3.fromRGB(145, 152, 166)
DRAW.slot3Bg.Visible = true; DRAW.slot3Bg.Transparency = dAlpha((not active) and hudAlpha or hudAlpha * 0.55)
DRAW.slot3Bar.Visible = not active; DRAW.slot3Bar.Color = Color3.fromRGB(238, 242, 250)
DRAW.slot3Lbl.Visible = true
DRAW.slot3Lbl.Color = (not active) and Color3.fromRGB(248, 250, 255) or Color3.fromRGB(145, 152, 166)
DRAW.ammoBg.Visible = active; DRAW.ammoBg.Transparency = dAlpha(hudAlpha)
DRAW.ammoLbl.Visible = active
DRAW.resLbl.Visible = active
DRAW.stateLbl.Visible = active
DRAW.hintLbl.Visible = true
DRAW.hintLbl.Text = active
and "[LMB] Fire • [1/2] Armas • [4/G] AWP/AK47 • [R] Reload • [F] Holster"
or "[1] Primary • [2] Deagle • [4/G] AWP/AK47 • [T] Theme • [F6] Stop"
local hintW = measureTextW(DRAW.hintLbl, #DRAW.hintLbl.Text)
DRAW.hintLbl.Position = Vector2.new(vp.X - hintW - 20, vp.Y - 16)
local pipCount = math.min(7, wep.maxAmmo)
for i = 1, 7 do
local pip = DRAW.ammoPips[i]
pip.Visible = active and (i <= pipCount) and (wep.maxAmmo <= 7)
if pip.Visible then
local filled = i <= CTRL.ammo
pip.Color = filled and Color3.fromRGB(244, 246, 250) or Color3.fromRGB(64, 70, 84)
pip.Transparency = dAlpha(filled and 0.95 or 0.38)
end
end
if active then
local lowAmmo = CTRL.ammo <= math.max(1, math.floor(wep.maxAmmo * 0.2))
DRAW.ammoLbl.Text = tostring(CTRL.ammo)
DRAW.ammoLbl.Color = lowAmmo and Color3.fromRGB(235, 58, 52) or Color3.fromRGB(246, 248, 252)
DRAW.resLbl.Text = "/ " .. tostring(wep.maxAmmo)
local progFrac = 0
if CTRL.reloading then
local tot = CTRL.reloadFromEmpty and wep.reloadTime or (wep.reloadTime * 0.78)
progFrac = 1 - math.clamp(CTRL.reloadTimer / math.max(0.05, tot), 0, 1)
DRAW.stateLbl.Text = CTRL.reloadFromEmpty and "RELOADING (EMPTY)" or "TACTICAL RELOAD"
DRAW.stateLbl.Color = Color3.fromRGB(242, 196, 78)
elseif CTRL.boltTimer > 0 then
progFrac = 1 - math.clamp(CTRL.boltTimer / CFG.boltTime, 0, 1)
DRAW.stateLbl.Text = "BOLT CYCLE"; DRAW.stateLbl.Color = Color3.fromRGB(162, 208, 255)
elseif CTRL.inspecting then
DRAW.stateLbl.Text = "INSPECT"; DRAW.stateLbl.Color = Color3.fromRGB(172, 232, 196)
elseif scoped then
DRAW.stateLbl.Text = string.format("ZOOM %.1fx", CFG.baseFOV / math.max(1, CFG.scopeFOV))
DRAW.stateLbl.Color = th.glow
elseif (CTRL.sprintAlpha or 0) > 0.45 then
DRAW.stateLbl.Text = "SPRINT"; DRAW.stateLbl.Color = Color3.fromRGB(236, 212, 138)
else
DRAW.stateLbl.Text = (CTRL.transition == "equip") and "DRAWING" or (wep.name .. " READY")
DRAW.stateLbl.Color = Color3.fromRGB(148, 224, 168)
end
local stW = measureTextW(DRAW.stateLbl, #DRAW.stateLbl.Text)
if isMobile then
local sy = ay + ah + 6
DRAW.slot1Bg.Position = Vector2.new(sx, sy); DRAW.slot1Bar.Position = Vector2.new(sx + sw - 3, sy); DRAW.slot1Lbl.Position = Vector2.new(sx + 12, sy + 5)
DRAW.slot2Bg.Position = Vector2.new(sx, sy + 28); DRAW.slot2Bar.Position = Vector2.new(sx + sw - 3, sy + 28); DRAW.slot2Lbl.Position = Vector2.new(sx + 12, sy + 33)
DRAW.slot3Bg.Position = Vector2.new(sx, sy + 56); DRAW.slot3Bar.Position = Vector2.new(sx + sw - 3, sy + 56); DRAW.slot3Lbl.Position = Vector2.new(sx + 12, sy + 61)
DRAW.stateLbl.Position = Vector2.new(vp.X - stW - 16, sy + 86)
DRAW.hintLbl.Visible = false
else
DRAW.stateLbl.Position = Vector2.new(vp.X - stW - 26, ay - 106)
DRAW.slot1Bg.Position = Vector2.new(sx, ay - 30); DRAW.slot1Bar.Position = Vector2.new(sx + sw - 3, ay - 30); DRAW.slot1Lbl.Position = Vector2.new(sx + 12, ay - 25)
DRAW.slot2Bg.Position = Vector2.new(sx, ay - 58); DRAW.slot2Bar.Position = Vector2.new(sx + sw - 3, ay - 58); DRAW.slot2Lbl.Position = Vector2.new(sx + 12, ay - 53)
DRAW.slot3Bg.Position = Vector2.new(sx, ay - 86); DRAW.slot3Bar.Position = Vector2.new(sx + sw - 3, ay - 86); DRAW.slot3Lbl.Position = Vector2.new(sx + 12, ay - 81)
end
DRAW.ammoProg.Visible = (progFrac > 0.01)
DRAW.ammoProg.Size = Vector2.new(math.floor(aw * progFrac), 3)
DRAW.ammoProg.Color = CTRL.reloading and Color3.fromRGB(242, 196, 78) or th.glow
else
DRAW.ammoProg.Visible = false
if isMobile then
local sy = ay
DRAW.slot1Bg.Position = Vector2.new(sx, sy); DRAW.slot1Bar.Position = Vector2.new(sx + sw - 3, sy); DRAW.slot1Lbl.Position = Vector2.new(sx + 12, sy + 5)
DRAW.slot2Bg.Position = Vector2.new(sx, sy + 28); DRAW.slot2Bar.Position = Vector2.new(sx + sw - 3, sy + 28); DRAW.slot2Lbl.Position = Vector2.new(sx + 12, sy + 33)
DRAW.slot3Bg.Position = Vector2.new(sx, sy + 56); DRAW.slot3Bar.Position = Vector2.new(sx + sw - 3, sy + 56); DRAW.slot3Lbl.Position = Vector2.new(sx + 12, sy + 61)
DRAW.hintLbl.Visible = false
else
local hy = vp.Y - 24
DRAW.slot1Bg.Position = Vector2.new(sx, hy - 30); DRAW.slot1Bar.Position = Vector2.new(sx + sw - 3, hy - 30); DRAW.slot1Lbl.Position = Vector2.new(sx + 12, hy - 25)
DRAW.slot2Bg.Position = Vector2.new(sx, hy - 58); DRAW.slot2Bar.Position = Vector2.new(sx + sw - 3, hy - 58); DRAW.slot2Lbl.Position = Vector2.new(sx + 12, hy - 53)
DRAW.slot3Bg.Position = Vector2.new(sx, hy - 86); DRAW.slot3Bar.Position = Vector2.new(sx + sw - 3, hy - 86); DRAW.slot3Lbl.Position = Vector2.new(sx + 12, hy - 81)
end
end
end
do
local now = os.clock()
local yCursor = DRAW.topInset + 14
for i = #DRAW.killfeed, 1, -1 do
if (now - DRAW.killfeed[i].at) > 5.5 then table.remove(DRAW.killfeed, i) end
end
for i = 1, 4 do
local r = DRAW.kfRows[i]
local entry = DRAW.killfeed[i]
if entry then
local age = now - entry.at
local alpha = 1 - math.clamp((age - 4.7) / 0.8, 0, 1)
r.killer.Text = entry.killer
r.victim.Text = entry.victim
local kW = measureTextW(r.killer, #entry.killer)
local vW = measureTextW(r.victim, #entry.victim)
local hsSpace = entry.headshot and 20 or 0
local iconW = 36 + hsSpace
local boxW = math.floor(kW + iconW + vW + 26)
local boxH = 24
local isMobile = UIS.TouchEnabled or _G.WuzSniperMobile
local bx = isMobile and (vp.X - boxW - 290) or (vp.X - boxW - 20)
local by = yCursor
r.bg.Visible = true; r.bg.Position, r.bg.Size = Vector2.new(bx, by), Vector2.new(boxW, boxH)
r.bg.Transparency = dAlpha(0.76 * alpha)
r.border.Visible = true; r.border.Position, r.border.Size = Vector2.new(bx, by), Vector2.new(boxW, boxH)
r.border.Transparency = dAlpha(0.95 * alpha)
r.killer.Visible = true; r.killer.Position = Vector2.new(bx + 9, by + 4); r.killer.Transparency = dAlpha(alpha)
local ix = bx + 15 + kW
r.awpBody.Visible = true; r.awpBody.Position = Vector2.new(ix, by + 11); r.awpBody.Transparency = dAlpha(alpha)
r.awpScope.Visible = true; r.awpScope.Position = Vector2.new(ix + 5, by + 8); r.awpScope.Transparency = dAlpha(alpha)
r.awpBarl.Visible = true; r.awpBarl.From, r.awpBarl.To = Vector2.new(ix + 16, by + 12), Vector2.new(ix + 28, by + 12)
r.awpBarl.Transparency = dAlpha(alpha)
if entry.headshot then
r.hsRing.Visible = true; r.hsRing.Position = Vector2.new(ix + 37, by + 12); r.hsRing.Transparency = dAlpha(alpha)
r.hsDot.Visible = true; r.hsDot.Position = Vector2.new(ix + 37, by + 12); r.hsDot.Transparency = dAlpha(alpha)
else
r.hsRing.Visible = false; r.hsDot.Visible = false
end
r.victim.Visible = true; r.victim.Position = Vector2.new(ix + 34 + hsSpace, by + 4); r.victim.Transparency = dAlpha(alpha)
yCursor += boxH + 5
else
r.bg.Visible = false; r.border.Visible = false; r.killer.Visible = false
r.awpBody.Visible = false; r.awpScope.Visible = false; r.awpBarl.Visible = false
r.hsRing.Visible = false; r.hsDot.Visible = false; r.victim.Visible = false
end
end
end
do
for i = 1, 4 do
DRAW.scopeSquares[i].Visible = scoped
DRAW.scopePosts[i].Visible = scoped
end
for _, tr in ipairs(DRAW.scopeTris) do tr.Visible = scoped end
if DRAW.scopeFallback then DRAW.scopeFallback.Visible = scoped end
DRAW.scopeShadow.Visible = scoped
DRAW.scopeRing.Visible = scoped
DRAW.scopeLineH.Visible = scoped
DRAW.scopeLineV.Visible = scoped
for i = 1, 16 do DRAW.scopeTicks[i].Visible = scoped end
local blur = scoped and (_G.WuzSniperScopeBlur ~= false) and math.clamp(spd / CFG.runSpeed, 0, 1) * 4.2 or 0
local showBlur = blur > 0.25
DRAW.scopeBlurH1.Visible = showBlur; DRAW.scopeBlurH2.Visible = showBlur
DRAW.scopeBlurV1.Visible = showBlur; DRAW.scopeBlurV2.Visible = showBlur
if showBlur then
local left, right, top, bot = cx - R, cx + R, cy - R, cy + R
DRAW.scopeBlurH1.From, DRAW.scopeBlurH1.To = Vector2.new(left, cy - blur), Vector2.new(right, cy - blur)
DRAW.scopeBlurH2.From, DRAW.scopeBlurH2.To = Vector2.new(left, cy + blur), Vector2.new(right, cy + blur)
DRAW.scopeBlurV1.From, DRAW.scopeBlurV1.To = Vector2.new(cx - blur, top), Vector2.new(cx - blur, bot)
DRAW.scopeBlurV2.From, DRAW.scopeBlurV2.To = Vector2.new(cx + blur, top), Vector2.new(cx + blur, bot)
end
DRAW.scopeZoomLbl.Visible = scoped
DRAW.scopeDistLbl.Visible = scoped
DRAW.scopeTargetLbl.Visible = scoped and (CTRL.currentTargetText ~= "")
if scoped then
DRAW.scopeZoomLbl.Text = string.format("%.1fx [%d]", CFG.baseFOV / math.max(1, CFG.scopeFOV), CFG.scopeFOV)
DRAW.scopeDistLbl.Text = CTRL.currentTargetDist and (tostring(CTRL.currentTargetDist) .. "m") or "---m"
DRAW.scopeTargetLbl.Text = CTRL.currentTargetText
end
end
do
local showCH = active and not scoped and (_G.WuzSniperCrosshair ~= false) and not wep.hasScope
if showCH then
local gap = math.floor(4 + (spd / CFG.runSpeed) * 9 + CTRL.recoilPos.Z * 26)
local len = 7
local dirs = { { -1, 0 }, { 1, 0 }, { 0, -1 }, { 0, 1 } }
for i = 1, 4 do
local dx, dy = dirs[i][1], dirs[i][2]
local p0 = Vector2.new(cx + dx * gap, cy + dy * gap)
local p1 = Vector2.new(cx + dx * (gap + len), cy + dy * (gap + len))
DRAW.chOut[i].Visible = true; DRAW.chOut[i].From, DRAW.chOut[i].To = p0, p1
DRAW.chFg[i].Visible = true; DRAW.chFg[i].From, DRAW.chFg[i].To = p0, p1
DRAW.chFg[i].Color = CTRL.currentTargetHostile and Color3.fromRGB(255, 68, 68) or Color3.fromRGB(76, 255, 104)
end
DRAW.chDotOut.Visible = true; DRAW.chDotOut.Position = Vector2.new(cx - 2, cy - 2)
DRAW.chDot.Visible = true; DRAW.chDot.Position = Vector2.new(cx - 1, cy - 1)
DRAW.chDot.Color = CTRL.currentTargetHostile and Color3.fromRGB(255, 68, 68) or Color3.fromRGB(76, 255, 104)
else
for i = 1, 4 do DRAW.chOut[i].Visible = false; DRAW.chFg[i].Visible = false end
DRAW.chDotOut.Visible = false; DRAW.chDot.Visible = false
end
end
do
local showHM = (CTRL.hitMarkerTimer > 0)
local hmCol = CTRL.hitMarkerHostile and Color3.fromRGB(255, 58, 66) or Color3.fromRGB(246, 248, 252)
local d0, d1 = 6, 13
local diag = { { -1, -1 }, { 1, -1 }, { -1, 1 }, { 1, 1 } }
for i = 1, 4 do
local ln = DRAW.hitLines[i]
ln.Visible = showHM
if showHM then
ln.Color = hmCol
ln.From = Vector2.new(cx + diag[i][1] * d0, cy + diag[i][2] * d0)
ln.To = Vector2.new(cx + diag[i][1] * d1, cy + diag[i][2] * d1)
end
end
end
end
-------------------------------------------------------------------
-- MOBILE TOUCH UI (AUTO-ENABLED ON TOUCH DEVICES OR _G.WuzSniperMobile)
-------------------------------------------------------------------
local MOBILE_GUI = nil
local function buildMobileUI()
if MOBILE_GUI and MOBILE_GUI.Parent then MOBILE_GUI:Destroy() end
if not (UIS.TouchEnabled or _G.WuzSniperMobile) then return end
local pg = plr:FindFirstChildOfClass("PlayerGui")
if not pg then return end
local sg = Instance.new("ScreenGui")
sg.Name = "WuzSniper_MobileUI"
sg.ResetOnSpawn = false
sg.IgnoreGuiInset = true
sg.Parent = pg
MOBILE_GUI = sg
local function makeBtn(text, pos, size, bgCol, onDown, onUp)
local b = Instance.new("TextButton")
b.Text = text
b.Font = Enum.Font.GothamBold
b.TextSize = 14
b.TextColor3 = Color3.fromRGB(244, 246, 250)
b.BackgroundColor3 = bgCol or Color3.fromRGB(20, 24, 32)
b.BackgroundTransparency = 0.30
b.Position = pos
b.Size = size
b.AutoButtonColor = true
b.Parent = sg
local c = Instance.new("UICorner")
c.CornerRadius = UDim.new(0, 8)
c.Parent = b
local s = Instance.new("UIStroke")
s.Color = Color3.fromRGB(90, 100, 120)
s.Thickness = 1.2
s.Parent = b
if onDown then b.MouseButton1Down:Connect(onDown) end
if onUp then b.MouseButton1Up:Connect(onUp) end
return b
end
makeBtn("FIRE", UDim2.new(1, -110, 1, -145), UDim2.new(0, 86, 0, 86), Color3.fromRGB(190, 44, 52),
function() CTRL.fireHeld = true; fireWeapon() end,
function() CTRL.fireHeld = false end)
makeBtn("AIM", UDim2.new(1, -206, 1, -135), UDim2.new(0, 74, 0, 62), Color3.fromRGB(34, 42, 58),
function() if CTRL.equipped then CTRL.aimToggle = not CTRL.aimToggle end end)
makeBtn("RLD", UDim2.new(1, -196, 1, -210), UDim2.new(0, 64, 0, 48), Color3.fromRGB(34, 42, 58),
function() startReload() end)
makeBtn("EQP", UDim2.new(1, -110, 1, -220), UDim2.new(0, 68, 0, 48), Color3.fromRGB(34, 42, 58),
function() toggleEquip() end)
makeBtn("SWP", UDim2.new(1, -110, 1, -278), UDim2.new(0, 68, 0, 44), Color3.fromRGB(34, 42, 58),
function()
local nextPrim = (CTRL.primaryId == "awp") and "ak47" or "awp"
switchWeapon(nextPrim)
end)
makeBtn("CRCH", UDim2.new(0, 24, 1, -140), UDim2.new(0, 68, 0, 48), Color3.fromRGB(34, 42, 58),
function() CTRL.crouchToggle = not CTRL.crouchToggle end)
end
-------------------------------------------------------------------
-- CLEANUP, RENDER LOOP, INPUTS & GLOBAL CONTROLS
-------------------------------------------------------------------
local function cleanup()
if not STATE.alive then return end
STATE.alive = false
STATE.epoch += 1
pcall(function() RunService:UnbindFromRenderStep(RENDER_STEP_NAME) end)
for _, conn in ipairs(STATE.connections) do
pcall(function() conn:Disconnect() end)
end
STATE.connections = {}
for _, proj in ipairs(CTRL.projectiles) do destroyLocalBulletVisual(proj) end
CTRL.projectiles = {}
for _, o in ipairs(DRAW.objs) do
pcall(function() if o.Remove then o:Remove() else o:Destroy() end end)
end
DRAW.objs = {}
if MOBILE_GUI and MOBILE_GUI.Parent then pcall(function() MOBILE_GUI:Destroy() end) end
MOBILE_GUI = nil
if SFX.folder and SFX.folder.Parent then pcall(function() SFX.folder:Destroy() end) end
SFX.folder = nil
restoreCameraAndMouse()
restoreMovement()
hideLocalRealBody(getCharParts(getChar()), false)
syncRealBodyVisibility(false)
end
env.WuzSniperCleanup = cleanup
initSounds()
buildHUD()
buildMobileUI()
local okScan, scanRes = pcall(buildOrScan)
if not okScan then
warn("[WuzSniper] Init failed: " .. tostring(scanRes))
cleanup()
return
end
local function bindInput()
STATE.connections[#STATE.connections + 1] = UIS.InputBegan:Connect(function(inp, gp)
if gp or UIS:GetFocusedTextBox() or GuiService.MenuIsOpen then return end
local kc = inp.KeyCode
if kc == Enum.KeyCode.F6 then
_G.WuzSniperStop = true
cleanup()
elseif kc == Enum.KeyCode.One or kc == Enum.KeyCode.F then
if CTRL.equipped and WEAPONS[CTRL.weaponId].slot == 1 then
toggleEquip()
else
switchWeapon(CTRL.primaryId)
end
elseif kc == Enum.KeyCode.Two then
switchWeapon("deagle")
elseif kc == Enum.KeyCode.Three then
if CTRL.equipped or CTRL.transition == "equip" then toggleEquip() end
elseif kc == Enum.KeyCode.Four or kc == Enum.KeyCode.G then
local nextPrim = (CTRL.primaryId == "awp") and "ak47" or "awp"
switchWeapon(nextPrim)
elseif kc == Enum.KeyCode.R then
startReload()
elseif kc == Enum.KeyCode.V then
if CTRL.equipped and CTRL.transition == nil and not CTRL.reloading and CTRL.boltTimer <= 0 then
CTRL.inspecting = true
CTRL.inspectTimer = CFG.inspectTime
CTRL.inspectVariant = ((CTRL.inspectVariant or 0) % 3) + 1
end
elseif kc == Enum.KeyCode.T then
paintAll(CFG.themeIdx + 1)
elseif kc == Enum.KeyCode.B then
task.spawn(function() pcall(buildOrScan) end)
elseif kc == Enum.KeyCode.Q then
if CTRL.equipped then CTRL.aimToggle = not CTRL.aimToggle end
elseif kc == Enum.KeyCode.LeftControl or kc == Enum.KeyCode.C then
CTRL.crouchHold = true
elseif kc == Enum.KeyCode.Space then
CTRL.jumpBuffer = 0.14
elseif inp.UserInputType == Enum.UserInputType.MouseButton1 then
CTRL.fireHeld = true
fireWeapon()
elseif inp.UserInputType == Enum.UserInputType.MouseButton2 then
CTRL.aimHold = true
end
end)
STATE.connections[#STATE.connections + 1] = UIS.InputEnded:Connect(function(inp)
local kc = inp.KeyCode
if kc == Enum.KeyCode.LeftControl or kc == Enum.KeyCode.C then
CTRL.crouchHold = false
elseif inp.UserInputType == Enum.UserInputType.MouseButton1 then
CTRL.fireHeld = false
elseif inp.UserInputType == Enum.UserInputType.MouseButton2 then
CTRL.aimHold = false
end
end)
STATE.connections[#STATE.connections + 1] = UIS.InputChanged:Connect(function(inp, gp)
if gp then return end
if inp.UserInputType == Enum.UserInputType.MouseWheel and CTRL.equipped and CTRL.weaponId == "awp" and CTRL.aimAlpha > 0.5 then
CFG.scopeFOV = math.clamp(CFG.scopeFOV - inp.Position.Z * 3, 7, 36)
playSFX("scope_zoom", 0.55)
end
end)
STATE.connections[#STATE.connections + 1] = plr.CharacterAdded:Connect(function()
CTRL.rayDirty = true
CTRL.serverBodyHidden = nil
task.delay(0.6, function()
if STATE.alive then pcall(buildOrScan) end
end)
end)
end
bindInput()
-------------------------------------------------------------------
-- SCOPE AIM ASSIST TARGET FINDER
-------------------------------------------------------------------
local function getScopeAimTarget(cam, maxDeg)
local camPos = cam.CFrame.Position
local camLook = cam.CFrame.LookVector
local minDot = math.cos(math.rad(maxDeg or 3.5))
local bestDot, bestPos = minDot, nil
for _, p in ipairs(Players:GetPlayers()) do
if p ~= plr and p.Character then
local hum = p.Character:FindFirstChildOfClass("Humanoid")
local aimPart = p.Character:FindFirstChild("Head") or p.Character:FindFirstChild("HumanoidRootPart")
if hum and hum.Health > 0 and aimPart then
local dir = aimPart.Position - camPos
local dist = dir.Magnitude
if dist > 2 and dist < 1500 then
local dot = camLook:Dot(dir / dist)
if dot > bestDot then
bestDot = dot
bestPos = aimPart.Position
end
end
end
end
end
return bestPos
end
RunService:BindToRenderStep(RENDER_STEP_NAME, Enum.RenderPriority.Camera.Value + 2, function(dt)
if not STATE.alive or _G.WuzSniperStop then cleanup(); return end
dt = math.min(dt, 0.05)
CTRL.timeAcc += dt
local cam = workspace.CurrentCamera
local parts = getCharParts(getChar())
if not cam or not parts or not parts.hrp or not parts.hum then return end
if CTRL.fireCooldown > 0 then CTRL.fireCooldown = math.max(0, CTRL.fireCooldown - dt) end
if CTRL.hitMarkerTimer > 0 then CTRL.hitMarkerTimer = math.max(0, CTRL.hitMarkerTimer - dt) end
if CTRL.fxTimer > 0 then CTRL.fxTimer = math.max(0, CTRL.fxTimer - dt) end
local wep = WEAPONS[CTRL.weaponId] or WEAPONS.awp
if CTRL.fireHeld and wep.auto and CTRL.equipped and CTRL.transition == nil and not CTRL.reloading and CTRL.fireCooldown <= 0 then
fireWeapon()
end
if CTRL.transition == "equip" then
CTRL.transAlpha = math.min(1, CTRL.transAlpha + dt / math.max(0.1, wep.equipTime))
if CTRL.transAlpha >= 1 then
CTRL.transition = nil; CTRL.equipped = true; CTRL.equipSettle = 1
if CTRL.dolly.active then stopDolly() end
enterFirstPerson()
end
elseif CTRL.transition == "holster" then
CTRL.transAlpha = math.max(0, CTRL.transAlpha - dt / CFG.holsterTime)
if CTRL.transAlpha <= 0 then
CTRL.transition = nil; CTRL.equipped = false
end
end
stepDolly(dt, cam)
if CTRL.postShotHold > 0 then
CTRL.postShotHold = math.max(0, CTRL.postShotHold - dt)
if CTRL.postShotHold <= 0 and CTRL.weaponId == "awp" and CTRL.ammo > 0 then
CTRL.boltTimer = CFG.boltTime
end
end
if CTRL.boltTimer > 0 then
CTRL.boltTimer = math.max(0, CTRL.boltTimer - dt)
end
if CTRL.reloading then
CTRL.reloadTimer -= dt
if CTRL.reloadTimer <= 0 then
CTRL.reloading = false
CTRL.ammo = wep.maxAmmo
CTRL.ammoByWep[CTRL.weaponId] = CTRL.ammo
if _G.WuzSniperAutoRescope and CTRL.aimHold then CTRL.aimToggle = false end
end
end
if CTRL.inspecting then
CTRL.inspectTimer -= dt
if CTRL.inspectTimer <= 0 then CTRL.inspecting = false end
end
local wantAim = CTRL.equipped and CTRL.transition == nil and not CTRL.reloading and (CTRL.aimHold or CTRL.aimToggle)
CTRL.aimAlpha += ((wantAim and 1 or 0) - CTRL.aimAlpha) * (1 - math.exp(-16 * dt))
local nowScoped = CTRL.equipped and wep.hasScope and CTRL.aimAlpha >= 0.82
if nowScoped ~= CTRL.prevScoped then
CTRL.prevScoped = nowScoped
playSFX(nowScoped and "scope_in" or "scope_out")
end
if CTRL.equipped then
enterFirstPerson()
local adsFOV = (CTRL.weaponId == "awp") and CFG.scopeFOV or wep.fovADS
local targetFOV = CFG.baseFOV + (adsFOV - CFG.baseFOV) * CTRL.aimAlpha + CTRL.fovKick
local fovSpeed = (CTRL.aimAlpha > 0.1) and 11 or 16
cam.FieldOfView += (targetFOV - cam.FieldOfView) * (1 - math.exp(-fovSpeed * dt))
CTRL.fovKick *= math.exp(-12 * dt)
-- Sensitivity scales down with zoom so the scope stays controllable
local baseSens = CTRL.savedSens or UIS.MouseDeltaSensitivity
local zoomScale = math.clamp(cam.FieldOfView / CFG.baseFOV, 0.15, 1)
UIS.MouseDeltaSensitivity = baseSens * (1 - (1 - zoomScale) * 0.75 * CTRL.aimAlpha)
-- Scoped aim assist (cone + strength are globals)
if _G.WuzSniperAimAssist ~= false and CTRL.aimAlpha > 0.85 then
local lockPos = getScopeAimTarget(cam, _G.WuzSniperAimAssistCone or 3.5)
if lockPos then
local targetCF = CFrame.lookAt(cam.CFrame.Position, lockPos)
local k = 1 - math.exp(-(_G.WuzSniperAimAssistStrength or 5.5) * dt)
cam.CFrame = cam.CFrame:Lerp(targetCF, k)
end
end
if CTRL.camKickPitch and math.abs(CTRL.camKickPitch) > 1e-4 then
cam.CFrame = cam.CFrame * CFrame.Angles(CTRL.camKickPitch, CTRL.camKickYaw or 0, CTRL.camKickRoll or 0)
local kd = math.exp(-14 * dt)
CTRL.camKickPitch *= kd
CTRL.camKickYaw = (CTRL.camKickYaw or 0) * kd
CTRL.camKickRoll = (CTRL.camKickRoll or 0) * kd
end
end
stepCustomMovement(dt, cam, parts)
stepShell(dt)
stepProjectiles(dt)
local boneCFs = evaluateRig(dt, cam, parts)
applyLocalVisuals(boneCFs)
hideLocalRealBody(parts, true)
syncRealBodyVisibility(true)
updateHUD(cam)
-- Batch F3X server sync
local ep = getF3XEndpoint(true)
if ep and STATE.inFlightBatches < CFG.maxInflightBatches and (os.clock() - STATE.lastSendAt) >= CFG.sendTick then
local moveItems, matItems = {}, {}
for i = 1, TOTAL do
local b = STATE.blocks[i]
if b and b.part and b.part.Parent and not b.inTransit then
if (b.targetCF.Position - b.serverCF.Position).Magnitude > 0.04 or not b.targetCF.Rotation:FuzzyEq(b.serverCF.Rotation, 0.02) then
moveItems[#moveItems + 1] = { block = b, item = { Part = b.part, CFrame = b.targetCF } }
end
local wantT = desiredBlockTransparency(b)
if math.abs(wantT - (b.serverTrans or 0)) > 0.05 and not b.matInTransit then
matItems[#matItems + 1] = { block = b, item = { Part = b.part, Material = resolveBlockMaterial(b), Transparency = wantT } }
end
end
if #moveItems >= CFG.batchSize then break end
end
if #moveItems > 0 then
STATE.lastSendAt = os.clock()
STATE.inFlightBatches += 1
local lot = {}
for _, e in ipairs(moveItems) do e.block.inTransit = true; lot[#lot + 1] = e.item end
task.spawn(function()
local ok, res = pcall(function() return ep:InvokeServer("SyncMove", lot) end)
STATE.inFlightBatches = math.max(0, STATE.inFlightBatches - 1)
for _, e in ipairs(moveItems) do
e.block.inTransit = false
if ok and res ~= false then e.block.serverCF = e.item.CFrame end
end
end)
end
if #matItems > 0 then
local lot = {}
for _, e in ipairs(matItems) do e.block.matInTransit = true; lot[#lot + 1] = e.item end
task.spawn(function()
local ok, res = pcall(function() return ep:InvokeServer("SyncMaterial", lot) end)
for _, e in ipairs(matItems) do
e.block.matInTransit = false
if ok and res ~= false then e.block.serverTrans = e.item.Transparency end
end
end)
end
end
end)Go find out :)

Universal