0% found this document useful (0 votes)
10 views

Message (14)

The document is a Lua script for a game that implements various features such as a silent aim, player targeting, and camera rotation. It includes settings for toggling features, checking player states (like being dead or grabbed), and calculating the closest player or part to aim at. The script also handles user input for activating these features and updates the camera position based on the target's predicted position.

Uploaded by

thelettahz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Message (14)

The document is a Lua script for a game that implements various features such as a silent aim, player targeting, and camera rotation. It includes settings for toggling features, checking player states (like being dead or grabbed), and calculating the closest player or part to aim at. The script also handles user input for activating these features and updates the camera position based on the target's predicted position.

Uploaded by

thelettahz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 8

-- // horrid lock

getgenv().Rave = {
['Global'] = {
['Dead'] = true, -- Both lp and target
['Grabbed'] = true,
['Reload'] = true,
['Wall'] = true,
},
['Main'] = {
['Toggled'] = true,
['Threading'] = "RenderStepped",
['UpdateTarget'] = false,
['Prediction'] = 0.166,
['Bind'] = {
['Key'] = "C",
['Mode'] = "Toggle", -- Hold or Toggle
},
['Selected Part'] = {
['HitPart'] = "HumanoidRootPart",
['GetClosestPart'] = true,
},
['Properties'] = {
['Smoothness'] = {
['Factor'] = 1,
['Smoothness'] = 0.02,
},
},
},
['SilentAim'] = {
['Toggled'] = true,
['Prediction'] = 0.166,
['AntiFloorHit'] = true,
['Selected Part'] = {
['HitPart'] = "Head",
['GetClosestPart'] = true,
},
},
['Spin'] = {
['Enabled'] = true,
['Key'] = "V",
['Speed'] = 4900,
},
['Fov'] = {
['Threading'] = "Heartbeat",
['Shown'] = false,
['Color'] = Color3.new(255, 255, 255),
['Radius'] = 160,
},
}

if getgenv().Rave then
if getgenv().Rave.Fov.Connection then
getgenv().Rave.Fov.Connection:Disconnect()
end
if getgenv().Rave.LockConnection then
getgenv().Rave.LockConnection:Disconnect()
end
if getgenv().Rave.Circle then
getgenv().Rave.Circle:Remove()
end
end

-- // Services // --
local Players = game.Players;
local Local_Player = Players.LocalPlayer;
local Get_Mouse_Pos = Local_Player:GetMouse()
local rs = game:GetService"RunService";
local UserInputService = game:GetService"UserInputService";
local Current_Camera = workspace.CurrentCamera;

-- // Variables // --
local Rave = getgenv().Rave;
local Target = nil;
local SilTarget = nil;
local Toggle = false;
local arg = nil

if game.PlaceId == 2788229376 or game.PlaceId == 7213786345 or game.PlaceId ==


16033173781 then
arg = "UpdateMousePosI"
else
arg = "UpdateMousePos"
end

local Circle = Drawing.new("Circle")


Rave.Circle = Circle
do
Rave.Fov.Connection = rs[Rave.Fov.Threading]:Connect(function()
Circle.Visible = Rave.Fov.Shown
Circle.Color = Rave.Fov.Color
Circle.Radius = Rave.Fov.Radius
Circle.Transparency = 0.5

Circle.Position = Vector2.new(Get_Mouse_Pos.X, Get_Mouse_Pos.Y +


(game:GetService("GuiService"):GetGuiInset().Y))
end)
end

-- // KO Check // --
local Death; Death = function(Plr)
local Dead = nil;
if (Plr and Plr.Character and Plr.Character:FindFirstChild("BodyEffects")) then
if (Plr.Character.BodyEffects:FindFirstChild("K.O")) then
Dead = Plr.Character.BodyEffects["K.O"].Value
elseif (Plr.Character.BodyEffects:FindFirstChild("KO")) then
Dead = Plr.Character.BodyEffects.KO.Value
end
end
return (Dead)
end

-- // KO Check // --
local SelfDeath; SelfDeath = function()
local Dead = nil;
if (Local_Player and Local_Player.Character and
Local_Player.Character:FindFirstChild("BodyEffects")) then
if (Local_Player.Character.BodyEffects:FindFirstChild("K.O")) then
Dead = Local_Player.Character.BodyEffects["K.O"].Value
elseif (Local_Player.Character.BodyEffects:FindFirstChild("KO")) then
Dead = Local_Player.Character.BodyEffects.KO.Value
end
end
return (Dead)
end

-- // Grabbed Check // --
local Grabbed; Grabbed = function(Plr)
local Grabbed = nil
if (Plr and Plr.Character) then
Grabbed = Plr.Character:FindFirstChild("GRABBING_CONSTRAINT") ~= nil
end
return (Grabbed)
end

-- // Reload Check // --
local Reloading; Reloading = function()
local Active = nil;
if (Local_Player and Local_Player.Character and
Local_Player.Character:FindFirstChild("BodyEffects")) then
if Local_Player.Character.BodyEffects:FindFirstChild("Reload") then
Active = Local_Player.Character.BodyEffects.Reload.Value
elseif Local_Player.Character.BodyEffects:FindFirstChild("Reloading") then
Active = Local_Player.Character.BodyEffects.Reloading.Value
end
end
return (Active)
end

local Wall = nil; Wall = function(Plr)


local Part = nil
if (Plr and Plr.Character and Plr.Character:FindFirstChild("HumanoidRootPart"))
then
local ray = Ray.new(Current_Camera.CFrame.Position,
Plr.Character.HumanoidRootPart.Position - Current_Camera.CFrame.Position)
local ignoreList = {Local_Player.Character, Plr.Character.Parent}
Part = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(ray,
ignoreList)
end
return (Part)
end

-- // Checks // --
local Checks; Checks = function(Plr)
-- // KO Self Check // --
if (Rave.Global.Dead and SelfDeath()) then
return (false)
end

-- // KO Target Check // --
if (Rave.Global.Dead and Death(Plr)) then
return (false)
end

-- // Grabbed Check // --
if (Rave.Global.Grabbed and Grabbed(Plr)) then
return (false)
end

-- // Reloading Check // --
if (Rave.Global.Reload and Reloading()) then
return (false)
end

-- // Team Check // --
if (Rave.Global.Wall and Wall(Plr)) then
return (false)
end

-- // Returns true if none of these things are happening to the target // --


return (true)
end

print("Test 1")

-- // Get Closest Player // --


local function GetClosestPlr()
local ClosestTarget = nil;
local MaxDistance = math.huge;
-- // Loops through the player list // --
for value, index in pairs(Players:GetPlayers()) do
-- // Excludes the local player from the for loop // --
if (index.Character and index.Name ~= Local_Player.Name and
index.Character:FindFirstChild("HumanoidRootPart")) then
-- // Gets distance // --
local Position, OnScreen =
Current_Camera:WorldToScreenPoint(index.Character.HumanoidRootPart.Position)
local Distance = (Vector2.new(Position.X, Position.Y) -
Vector2.new(Get_Mouse_Pos.X, Get_Mouse_Pos.Y)).Magnitude
-- // Stops if the player is not OnScreen ( Checks if the pivot is not
available ) // --
if (OnScreen ~= true) then
continue;
end
-- // If the distance is less than math.huge // --
if (Circle.Radius > Distance and Distance < MaxDistance) then
MaxDistance = Distance
ClosestTarget = index
end
end
end
-- // Returns value // --
return (ClosestTarget)
end

-- // Get Closest Player // --


local function GetClosestPlr2()
local ClosestTarget = nil;
local MaxDistance = math.huge;
-- // Loops through the player list // --
for value, index in pairs(Players:GetPlayers()) do
-- // Excludes the local player from the for loop // --
if (index.Character and index.Name ~= Local_Player.Name and
index.Character:FindFirstChild("HumanoidRootPart")) then
-- // Gets distance // --
local Position, OnScreen =
Current_Camera:WorldToScreenPoint(index.Character.HumanoidRootPart.Position)
local Distance = (Vector2.new(Position.X, Position.Y) -
Vector2.new(Get_Mouse_Pos.X, Get_Mouse_Pos.Y)).Magnitude
-- // Stops if the player is not OnScreen ( Checks if the pivot is not
available ) // --
if (OnScreen ~= true) then
continue;
end
-- // If the distance is less than math.huge // --
if (Circle.Radius > Distance and Distance < MaxDistance) then
MaxDistance = Distance
ClosestTarget = index
end
end
end
-- // Returns value // --
return (ClosestTarget)
end

-- // Keybind // --
UserInputService.InputBegan:Connect(function(input, Processed)
-- // Returns nil if it is currently processed // --
if (Processed) then
return (nil)
end

-- // Checks if the key is held or pressed //


if (input.KeyCode == Enum.KeyCode[Rave.Main.Bind.Key] and Rave.Main.Toggled)
then
if (Rave.Main.Bind.Mode == "Hold") then
Toggle = true
elseif (Rave.Main.Bind.Mode == "Toggle") then
Toggle = not Toggle
end
if Rave.Main.UpdateTarget == false then
if Toggle then
Target = GetClosestPlr();
SilTarget = GetClosestPlr2();
else
Target = nil
SilTarget = nil
end
end
end
end)

-- // Hold // --
UserInputService.InputEnded:Connect(function(input, Processed)
-- // Returns nil if it is currently processed // --
if (Processed) then
return (nil)
end

-- // Held down // --
if (input.KeyCode == Enum.KeyCode[Rave.Main.Bind.Key] and Rave.Main.Toggled and
Rave.Main.Bind.Mode == "Hold") then
Toggle = false
end
end)
local function GetClosestPart(Plr)
local MaxDistance = math.huge
local ClosestPart = nil

for value, index in pairs(Plr.Character:GetChildren()) do


if table.find({"Part", "MeshPart", "BasePart"}, index.ClassName) then
local Position = Current_Camera:WorldToScreenPoint(index.Position)
local Distance = (Vector2.new(Position.X, Position.Y) -
Vector2.new(Get_Mouse_Pos.X, Get_Mouse_Pos.Y)).Magnitude
if Distance < MaxDistance then
ClosestPart = index
MaxDistance = Distance
end
end
end
return ClosestPart
end

local function SilentAim(index, connection)


if index:IsA("Tool") then
-- // If theres an ongoing connection it will disconnect it // --
if connection then
connection:Disconnect()
end

index.Activated:Connect(function()
if SilTarget and SilTarget.Character and Checks(SilTarget) then
local PredictedPos = nil

if Rave.SilentAim['Selected Part'].GetClosestPart then


Rave.SilentAim['Selected Part'].HitPart =
GetClosestPart(SilTarget)
end

if Rave.SilentAim.AntiFloorHit then
PredictedPos = SilTarget.Character[Rave.SilentAim['Selected
Part'].HitPart].Position + SilTarget.Character[Rave.SilentAim['Selected
Part'].HitPart].Velocity * Vector3.new(Rave.SilentAim.Prediction,
Rave.SilentAim.Prediction / 2, Rave.SilentAim.Prediction)
else
PredictedPos = SilTarget.Character[Rave.SilentAim['Selected
Part'].HitPart].Position + SilTarget.Character[Rave.SilentAim['Selected
Part'].HitPart].Velocity * Rave.SilentAim.Prediction
end

game.ReplicatedStorage.MainEvent:FireServer(arg, PredictedPos)
end
end)
end
end

local function onCharacterAdded(character)


character.ChildAdded:Connect(SilentAim)
for _, tool in pairs(character:GetChildren()) do
SilentAim(tool)
end
end
Local_Player.CharacterAdded:Connect(onCharacterAdded)
if Local_Player.Character then
onCharacterAdded(Local_Player.Character)
end

-- he told me to skid this ( i dont skid )


if Rave['Spin']['Enabled'] == true then

local Players = game:GetService("Players")


local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Camera = workspace.CurrentCamera
local Toggle = false
local RotationSpeed = Rave['Spin']['Speed']
local Keybind = Rave['Spin']['Key']

local function OnKeyPress(Input, GameProcessedEvent)


if Input.KeyCode == Enum.KeyCode[Rave['Spin']['Key']] and not
GameProcessedEvent then
Toggle = not Toggle
end
end

UserInputService.InputBegan:Connect(OnKeyPress)

local LastRenderTime = 0
local TotalRotation = 0

local function RotateCamera()


if Toggle then
local CurrentTime = tick()
local TimeDelta = math.min(CurrentTime - LastRenderTime, 0.01)
LastRenderTime = CurrentTime

local RotationAngle = RotationSpeed * TimeDelta


local Rotation = CFrame.fromAxisAngle(Vector3.new(0, 1, 0),
math.rad(RotationAngle))
Camera.CFrame = Camera.CFrame * Rotation

TotalRotation = TotalRotation + RotationAngle


if TotalRotation >= 360 then
Toggle = false
TotalRotation = 0
end
end
end

RunService.RenderStepped:Connect(RotateCamera)
end

print("Test 2")

-- // shit
local function Lock()
if Rave.Main.UpdateTarget then
if Toggle then
Target = GetClosestPlr();
SilTarget = GetClosestPlr2();
else
SilTarget = nil
Target = nil
end
end
if Target and Target.Character and Rave.Main.Toggled and Checks(Target) then
local PredictedPos = nil

if Rave.Main['Selected Part'].GetClosestPart then


Rave.Main['Selected Part'].HitPart = GetClosestPart(Target)
end

if Rave.Main.AntiFloorHit then
PredictedPos = CFrame.new(Current_Camera.CFrame.Position,
Target.Character[Rave.Main['Selected Part'].HitPart].Position +
Target.Character[Rave.Main['Selected Part'].HitPart].Velocity *
Vector3.new(Rave.Main.Prediction, Rave.Main.Prediction / 2, Rave.Main.Prediction))
else
PredictedPos = CFrame.new(Current_Camera.CFrame.Position,
Target.Character[Rave.Main['Selected Part'].HitPart].Position +
Target.Character[Rave.Main['Selected Part'].HitPart].Velocity *
Rave.Main.Prediction)
end

Current_Camera.CFrame = Current_Camera.CFrame:Lerp(PredictedPos,
Rave.Main.Properties.Smoothness.Smoothness *
Rave.Main.Properties.Smoothness.Factor)
end
end

Rave.LockConnection = rs[Rave.Main.Threading]:Connect(Lock)

print("Test 3")

You might also like