prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-----------------------------------PATHER--------------------------------------
|
local function CreateDestinationIndicator(pos)
local destinationGlobe = Create'Part'
{
Name = 'PathGlobe';
TopSurface = 'Smooth';
BottomSurface = 'Smooth';
Shape = 'Ball';
CanCollide = false;
Size = Vector3_new(2,2,2);
BrickColor = BrickColor.new('Institutional white');
Transparency = 0;
Anchored = true;
CFrame = CFrame.new(pos);
}
return destinationGlobe
end
local function Pather(character, point)
local this = {}
this.Cancelled = false
this.Started = false
this.Finished = Signal.Create()
this.PathFailed = Signal.Create()
this.PathStarted = Signal.Create()
this.PathComputed = false
function this:YieldUntilPointReached(character, point, timeout)
timeout = timeout or 10000000
local humanoid = findPlayerHumanoid(Player)
local torso = humanoid and humanoid.Torso
local start = tick()
local lastMoveTo = start
while torso and tick() - start < timeout and this.Cancelled == false do
local diffVector = (point - torso.CFrame.p)
local xzMagnitude = (diffVector * XZ_VECTOR3).magnitude
if xzMagnitude < 6 then
-- Jump if the path is telling is to go upwards
if diffVector.Y >= 2.2 then
humanoid.Jump = true
end
end
-- The hard-coded number 2 here is from the engine's MoveTo implementation
if xzMagnitude < 2 then
return true
end
-- Keep on issuing the move command because it will automatically quit every so often.
if tick() - lastMoveTo > 1.5 then
humanoid:MoveTo(point)
lastMoveTo = tick()
end
CharacterControl:UpdateTorso(point)
wait()
end
return false
end
function this:Cancel()
this.Cancelled = true
local humanoid = findPlayerHumanoid(Player)
local torso = humanoid and humanoid.Torso
if humanoid and torso then
humanoid:MoveTo(torso.CFrame.p)
end
end
function this:CheckOcclusion(point1, point2, character, torsoRadius)
local humanoid = findPlayerHumanoid(Player)
local torso = humanoid and humanoid.Torso
if torsoRadius == nil then
torsoRadius = torso and Vector3_new(torso.Size.X/2,0,torso.Size.Z/2) or XZ_VECTOR3
end
local diffVector = point2 - point1
local directionVector = diffVector.unit
local rightVector = Y_VECTOR3:Cross(directionVector) * torsoRadius
local rightPart, _ = Utility.Raycast(Ray.new(point1 + rightVector, diffVector + rightVector), true, {character})
local hitPart, _ = Utility.Raycast(Ray.new(point1, diffVector), true, {character})
local leftPart, _ = Utility.Raycast(Ray.new(point1 - rightVector, diffVector - rightVector), true, {character})
if rightPart or hitPart or leftPart then
return false
end
-- Make sure we have somewhere to stand on
local midPt = (point2 + point1) / 2
local studsBetweenSamples = 2
for i = 1, math_floor(diffVector.magnitude/studsBetweenSamples) do
local downPart, _ = Utility.Raycast(Ray.new(point1 + directionVector * i * studsBetweenSamples, Vector3_new(0,-7,0)), true, {character})
if not downPart then
return false
end
end
return true
end
function this:SmoothPoints(pathToSmooth)
local result = {}
local humanoid = findPlayerHumanoid(Player)
local torso = humanoid and humanoid.Torso
for i = 1, #pathToSmooth do
table.insert(result, pathToSmooth[i])
end
-- Backwards for safe-deletion
for i = #result - 1, 1, -1 do
if i + 1 <= #result then
local nextPoint = result[i+1]
local thisPoint = result[i]
local lastPoint = result[i-1]
if lastPoint == nil then
lastPoint = torso and Vector3_new(torso.CFrame.p.X, thisPoint.Y, torso.CFrame.p.Z)
end
if lastPoint and Utility.FuzzyEquals(thisPoint.Y, lastPoint.Y) and Utility.FuzzyEquals(thisPoint.Y, nextPoint.Y) then
if this:CheckOcclusion(lastPoint, nextPoint, character) then
table.remove(result, i)
-- Move i back one to recursively-smooth
i = i + 1
end
end
end
end
return result
end
function this:CheckNeighboringCells(character)
local pathablePoints = {}
local humanoid = findPlayerHumanoid(Player)
local torso = character and humanoid and humanoid.Torso
if torso then
local torsoCFrame = torso.CFrame
local torsoPos = torsoCFrame.p
-- Minus and plus 2 is so we can get it into the cell-corner space and then translate it back into cell-center space
local roundedPos = Vector3_new(Utility.Round(torsoPos.X-2,4)+2, Utility.Round(torsoPos.Y-2,4)+2, Utility.Round(torsoPos.Z-2,4)+2)
local neighboringCells = {}
for x = -4, 4, 8 do
for z = -4, 4, 8 do
table.insert(neighboringCells, roundedPos + Vector3_new(x,0,z))
end
end
for _, testPoint in pairs(neighboringCells) do
local pathable = this:CheckOcclusion(roundedPos, testPoint, character, ZERO_VECTOR3)
if pathable then
table.insert(pathablePoints, testPoint)
end
end
end
return pathablePoints
end
function this:ComputeDirectPath()
local humanoid = findPlayerHumanoid(Player)
local torso = humanoid and humanoid.Torso
if torso then
local startPt = torso.CFrame.p
local finishPt = point
if (finishPt - startPt).magnitude < 150 then
-- move back the destination by 2 studs or otherwise the pather will collide with the object we are trying to reach
finishPt = finishPt - (finishPt - startPt).unit * 2
if this:CheckOcclusion(startPt, finishPt, character, ZERO_VECTOR3) then
local pathResult = {}
pathResult.Status = Enum.PathStatus.Success
function pathResult:GetPointCoordinates()
return {finishPt}
end
return pathResult
end
end
end
end
local function AllAxisInThreshhold(targetPt, otherPt, threshold)
return math_abs(targetPt.X - otherPt.X) <= threshold and
math_abs(targetPt.Y - otherPt.Y) <= threshold and
math_abs(targetPt.Z - otherPt.Z) <= threshold
end
function this:ComputePath()
local smoothed = false
local humanoid = findPlayerHumanoid(Player)
local torso = humanoid and humanoid.Torso
if torso then
if this.PathComputed then return end
this.PathComputed = true
-- Will yield the script since it is an Async script (start, finish, maxDistance)
-- Try to use the smooth function, but it may not exist yet :(
local success = pcall(function()
-- 3 is height from torso cframe to ground
this.pathResult = PathfindingService:ComputeSmoothPathAsync(torso.CFrame.p - Vector3_new(0,3,0), point, 400)
smoothed = true
end)
if not success then
-- 3 is height from torso cframe to ground
this.pathResult = PathfindingService:ComputeRawPathAsync(torso.CFrame.p - Vector3_new(0,3,0), point, 400)
smoothed = false
end
this.pointList = this.pathResult and this.pathResult:GetPointCoordinates()
local pathFound = false
if this.pathResult.Status == Enum.PathStatus.FailFinishNotEmpty then
-- Lets try again with a slightly set back start point; it is ok to do this again so the FailFinishNotEmpty uses little computation
local diffVector = point - workspace.CurrentCamera.CoordinateFrame.p
if diffVector.magnitude > 2 then
local setBackPoint = point - (diffVector).unit * 2.1
local success = pcall(function()
this.pathResult = PathfindingService:ComputeSmoothPathAsync(torso.CFrame.p, setBackPoint, 400)
smoothed = true
end)
if not success then
this.pathResult = PathfindingService:ComputeRawPathAsync(torso.CFrame.p, setBackPoint, 400)
smoothed = false
end
this.pointList = this.pathResult and this.pathResult:GetPointCoordinates()
pathFound = true
end
end
if this.pathResult.Status == Enum.PathStatus.ClosestNoPath and #this.pointList >= 1 and pathFound == false then
local otherPt = this.pointList[#this.pointList]
if AllAxisInThreshhold(point, otherPt, 4) and (torso.CFrame.p - point).magnitude > (otherPt - point).magnitude then
local pathResult = {}
pathResult.Status = Enum.PathStatus.Success
function pathResult:GetPointCoordinates()
return {this.pointList}
end
this.pathResult = pathResult
pathFound = true
end
end
if (this.pathResult.Status == Enum.PathStatus.FailStartNotEmpty or this.pathResult.Status == Enum.PathStatus.ClosestNoPath) and pathFound == false then
local pathablePoints = this:CheckNeighboringCells(character)
for _, otherStart in pairs(pathablePoints) do
local pathResult;
local success = pcall(function()
pathResult = PathfindingService:ComputeSmoothPathAsync(otherStart, point, 400)
smoothed = true
end)
if not success then
pathResult = PathfindingService:ComputeRawPathAsync(otherStart, point, 400)
smoothed = false
end
if pathResult and pathResult.Status == Enum.PathStatus.Success then
this.pathResult = pathResult
if this.pathResult then
this.pointList = this.pathResult:GetPointCoordinates()
table.insert(this.pointList, 1, otherStart)
end
break
end
end
end
if DirectPathEnabled then
if this.pathResult.Status ~= Enum.PathStatus.Success then
local directPathResult = this:ComputeDirectPath()
if directPathResult and directPathResult.Status == Enum.PathStatus.Success then
this.pathResult = directPathResult
this.pointList = directPathResult:GetPointCoordinates()
end
end
end
end
return smoothed
end
function this:IsValidPath()
this:ComputePath()
local pathStatus = this.pathResult.Status
return pathStatus == Enum.PathStatus.Success
end
function this:GetPathStatus()
this:ComputePath()
return this.pathResult.Status
end
function this:Start()
if CurrentSeatPart then
return
end
spawn(function()
local humanoid = findPlayerHumanoid(Player)
--humanoid.AutoRotate = false
local torso = humanoid and humanoid.Torso
if torso then
if this.Started then return end
this.Started = true
-- Will yield the script since it is an Async function script (start, finish, maxDistance)
local smoothed = this:ComputePath()
if this:IsValidPath() then
this.PathStarted:fire()
-- smooth out zig-zaggy paths
local smoothPath = smoothed and this.pointList or this:SmoothPoints(this.pointList)
for i, point in pairs(smoothPath) do
if humanoid then
if this.Cancelled then
return
end
local wayPoint = nil
if SHOW_PATH then
wayPoint = CreateDestinationIndicator(point)
wayPoint.BrickColor = BrickColor.new("New Yeller")
wayPoint.Parent = workspace
print(wayPoint.CFrame.p)
end
humanoid:MoveTo(point)
local distance = ((torso.CFrame.p - point) * XZ_VECTOR3).magnitude
local approxTime = 10
if math_abs(humanoid.WalkSpeed) > 0 then
approxTime = distance / math_abs(humanoid.WalkSpeed)
end
local yielding = true
if i == 1 then
--local rotatedCFrame = CameraModule:LookAtPreserveHeight(point)
if CameraModule then
local rotatedCFrame = CameraModule:LookAtPreserveHeight(smoothPath[#smoothPath])
local finishedSignal, duration = CameraModule:TweenCameraLook(rotatedCFrame)
end
--CharacterControl:SetTorsoLookPoint(point)
end
---[[
if (humanoid.Torso.CFrame.p - point).magnitude > 9 then
spawn(function()
while yielding and this.Cancelled == false do
if CameraModule then
local look = CameraModule:GetCameraLook()
local squashedLook = (look * XZ_VECTOR3).unit
local direction = ((point - CameraModule.cframe.p) * XZ_VECTOR3).unit
local theta = math_deg(math_acos(squashedLook:Dot(direction)))
if tick() - Utility.GetLastInput() > 2 and theta > (workspace.CurrentCamera.FieldOfView / 2) then
local rotatedCFrame = CameraModule:LookAtPreserveHeight(point)
local finishedSignal, duration = CameraModule:TweenCameraLook(rotatedCFrame)
--return
end
end
wait(0.1)
end
end)
end
--]]
local didReach = this:YieldUntilPointReached(character, point, approxTime * 3 + 1)
yielding = false
if SHOW_PATH then
wayPoint:Destroy()
end
if not didReach then
this.PathFailed:fire()
return
end
end
end
this.Finished:fire()
return
end
end
this.PathFailed:fire()
end)
end
return this
end
|
--
|
local Point = {}
Point.__index = Point
function Point.new(p)
local self = setmetatable({}, Point)
self.Position = p
self.PreviousPosition = p
self.Velocity = ZERO
self.Acceleration = ZERO
self.PreviousDt = nil
self.Anchored = false
return self
end
function Point:Step(dt, damping)
self.PreviousDt = self.PreviousDt or dt
if (not self.Anchored) then
self.Acceleration = Vector3.new(0, -game.Workspace.Gravity, 0)
self.Velocity = self.Position - self.PreviousPosition
self.PreviousPosition = self.Position
self.Position = self.Position + self.Velocity*(dt/self.PreviousDt)*damping + self.Acceleration*dt*dt
else
self.Acceleration = ZERO
self.Velocity = ZERO
self.PreviousPosition = self.Position
end
self.PreviousDt = dt
end
|
-- Here be dragons
-- luacheck: ignore 212
|
local GuiService = game:GetService("GuiService")
local UserInputService = game:GetService("UserInputService")
local TextService = game:GetService("TextService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local LINE_HEIGHT = 20
local WINDOW_MAX_HEIGHT = 300
local MOUSE_TOUCH_ENUM = {Enum.UserInputType.MouseButton1, Enum.UserInputType.MouseButton2, Enum.UserInputType.Touch}
|
------------------
------------------
|
while true do
local p = game.Players:GetChildren()
for i = 1,#p do
if p[i].Character~=nil then
if p[i].Character:findFirstChild("Torso")~=nil then
if (p[i].Character.Torso.Position - script.Parent.Torso.Position).magnitude < 5 then
local anim = Instance.new("StringValue")
anim.Value = possibleAnims[math.random(1, #possibleAnims)]
anim.Name = "toolanim"
anim.Parent = script.Parent.Sword
end
end
end
end
wait(3)
end
|
--Driver Remove
|
bike.DriveSeat.ChildRemoved:connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") then
bike.Body.bal.LeanGyro.D = 0
bike.Body.bal.LeanGyro.MaxTorque = Vector3.new(0,0,0)
bike.Body.bal.LeanGyro.P = 0
bike.RearSection.Axle.HingeConstraint.MotorMaxTorque = 0
local p=game.Players:GetPlayerFromCharacter(child.Part1.Parent)
if p and p.PlayerGui:FindFirstChild("Interface") then
p.PlayerGui:FindFirstChild("Interface"):Destroy()
end
end
end)
|
------------------------
|
function Key(key)
if key then
key = string.lower(key)
if (key=="x") then
if on == 1 then
Tool.Parent.Humanoid.WalkSpeed = CurrentWalkSpeed
Tool.Accuracy.Value = Tool.Accuracy.Value + 4
Tool.Pose.Value = 1
on = 0
elseif on == 0 then
Tool.Parent.Humanoid.WalkSpeed = WalkSpeedWhileCrouching
Tool.Accuracy.Value = Tool.Accuracy.Value - 4
Tool.Pose.Value = 3
on = 1
end
Crouch(on)
end
end
end
function Equip(mouse)
mouse.KeyDown:connect(Key)
end
script.Parent.Equipped:connect(Equip)
|
--------------------------------------------------------------------------------
-- CREATING OPTIMIZED INNER LOOP
--------------------------------------------------------------------------------
-- Arrays of SHA2 "magic numbers" (in "INT64" and "FFI" branches "*_lo" arrays contain 64-bit values)
|
local sha2_K_lo, sha2_K_hi, sha2_H_lo, sha2_H_hi, sha3_RC_lo, sha3_RC_hi = {}, {}, {}, {}, {}, {}
local sha2_H_ext256 = {
[224] = {};
[256] = sha2_H_hi;
}
local sha2_H_ext512_lo, sha2_H_ext512_hi = {
[384] = {};
[512] = sha2_H_lo;
}, {
[384] = {};
[512] = sha2_H_hi;
}
local md5_K, md5_sha1_H = {}, {0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0}
local md5_next_shift = {0, 0, 0, 0, 0, 0, 0, 0, 28, 25, 26, 27, 0, 0, 10, 9, 11, 12, 0, 15, 16, 17, 18, 0, 20, 22, 23, 21}
local HEX64, XOR64A5, lanes_index_base -- defined only for branches that internally use 64-bit integers: "INT64" and "FFI"
local common_W = {} -- temporary table shared between all calculations (to avoid creating new temporary table every time)
local K_lo_modulo, hi_factor, hi_factor_keccak = 4294967296, 0, 0
local TWO_POW_NEG_56 = 2 ^ -56
local TWO_POW_NEG_17 = 2 ^ -17
local TWO_POW_2 = 2 ^ 2
local TWO_POW_3 = 2 ^ 3
local TWO_POW_4 = 2 ^ 4
local TWO_POW_5 = 2 ^ 5
local TWO_POW_6 = 2 ^ 6
local TWO_POW_7 = 2 ^ 7
local TWO_POW_8 = 2 ^ 8
local TWO_POW_9 = 2 ^ 9
local TWO_POW_10 = 2 ^ 10
local TWO_POW_11 = 2 ^ 11
local TWO_POW_12 = 2 ^ 12
local TWO_POW_13 = 2 ^ 13
local TWO_POW_14 = 2 ^ 14
local TWO_POW_15 = 2 ^ 15
local TWO_POW_16 = 2 ^ 16
local TWO_POW_17 = 2 ^ 17
local TWO_POW_18 = 2 ^ 18
local TWO_POW_19 = 2 ^ 19
local TWO_POW_20 = 2 ^ 20
local TWO_POW_21 = 2 ^ 21
local TWO_POW_22 = 2 ^ 22
local TWO_POW_23 = 2 ^ 23
local TWO_POW_24 = 2 ^ 24
local TWO_POW_25 = 2 ^ 25
local TWO_POW_26 = 2 ^ 26
local TWO_POW_27 = 2 ^ 27
local TWO_POW_28 = 2 ^ 28
local TWO_POW_29 = 2 ^ 29
local TWO_POW_30 = 2 ^ 30
local TWO_POW_31 = 2 ^ 31
local TWO_POW_32 = 2 ^ 32
local TWO_POW_40 = 2 ^ 40
local TWO56_POW_7 = 256 ^ 7
|
--[[Drivetrain]]
|
Tune.Config = "AWD" --"FWD" , "RWD" , "AWD"
--Differential Settings
Tune.FDiffSlipThres = 50 -- 1 - 100% (Max threshold of applying full lock determined by deviation from avg speed)
Tune.FDiffLockThres = 50 -- 0 - 100% (0 - Bias toward slower wheel, 100 - Bias toward faster wheel)
Tune.RDiffSlipThres = 50 -- 1 - 100%
Tune.RDiffLockThres = 50 -- 0 - 100%
Tune.CDiffSlipThres = 50 -- 1 - 100% [AWD Only]
Tune.CDiffLockThres = 50 -- 0 - 100% [AWD Only]
--Traction Control Settings
Tune.TCSEnabled = false -- Implements TCS
Tune.TCSThreshold = 20 -- Slip speed allowed before TCS starts working (in SPS)
Tune.TCSGradient = 20 -- Slip speed gradient between 0 to max reduction (in SPS)
Tune.TCSLimit = 10 -- Minimum amount of torque at max reduction (in percent)
|
--The button
|
script.Parent.Button.ClickDetector.MouseClick:connect(function(click)
if on == false then
on = true
|
--[[Transmission]]
|
Tune.TransModes = {"Auto", "Semi","Manual"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "RPM" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 4 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.15 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 5.25 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 3.03 ,
--[[ 3 ]] 1.95 ,
--[[ 4 ]] 1.46 ,
--[[ 5 ]] 1.17 ,
}
Tune.FDMult = 1 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
-----------------
--| Functions |--
-----------------
|
local function OnEquipped()
local myModel = Tool.Parent
local humanoid = myModel:FindFirstChild('Humanoid')
if humanoid then -- Preload animations
FireAndReloadTrack = humanoid:LoadAnimation(FireAndReloadAnimation)
end
end
local function OnChanged(property)
if property == 'Enabled' and Tool.Enabled == false then
-- Play fire and reload animation
if FireAndReloadTrack then
FireAndReloadTrack:Play()
end
end
end
local function OnUnequipped()
-- Stop animations
if FireAndReloadTrack then FireAndReloadTrack:Stop() end
end
|
--Main function
|
local function AttachAuraControl(source_part, eff_cont) --(source_part, effect_container)
local AnimObj
local function Start()
AnimObj = {}
AnimObj["LastUpdate"] = tick()
AnimObj["Parts"] = {}
AnimObj["Fire"] = {}
for i = 1, 4 do
local np = EFFECT_LIB.NewInvisiblePart()
local fire = Instance.new("Fire")
fire.SecondaryColor = Color3.new(0,0,0)
fire.Parent = np
AnimObj["Parts"][i] = np
table.insert(AnimObj["Fire"], fire)
np.Parent = eff_cont
end
end
local function Update()
local loop = EFFECT_LIB.Loop(3)
for i = 1, #AnimObj["Parts"] do
AnimObj["Parts"][i].CFrame = source_part:GetRenderCFrame() * CFrame.Angles(0, math.rad(loop * 360 + (360 / #AnimObj["Parts"] * (i - 1))), 0) * CFrame.new(0, -3, -1.5) * CFrame.Angles(math.rad(-55), 0, 0) * CFrame.Angles(0, 0, 0)
end
local get_col = GenColor(tick(), 10)
for _, fr in pairs(AnimObj["Fire"]) do
fr.Color = get_col
end
end
local function Stop()
eff_cont:ClearAllChildren()
AnimObj = nil
end
return {Start = Start, Update = Update, Stop = Stop}
end
return AttachAuraControl
|
--[[
Creates a new list that has no occurrences of the given value.
]]
|
function Immutable.RemoveValueFromList(list, removeValue)
local new = {}
for i = 1, #list do
if list[i] ~= removeValue then
table.insert(new, list[i])
end
end
return new
end
return Immutable
|
--[[
Copy of TextReporter that doesn't output successful tests.
This should be temporary, it's just a workaround to make CI environments
happy in the short-term.
]]
|
local TestService = game:GetService("TestService")
local TestEnum = require(script.Parent.Parent.TestEnum)
local INDENT = (" "):rep(3)
local STATUS_SYMBOLS = {
[TestEnum.TestStatus.Success] = "+",
[TestEnum.TestStatus.Failure] = "-",
[TestEnum.TestStatus.Skipped] = "~"
}
local UNKNOWN_STATUS_SYMBOL = "?"
local TextReporterQuiet = {}
local function reportNode(node, buffer, level)
buffer = buffer or {}
level = level or 0
if node.status == TestEnum.TestStatus.Skipped then
return buffer
end
local line
if node.status ~= TestEnum.TestStatus.Success then
local symbol = STATUS_SYMBOLS[node.status] or UNKNOWN_STATUS_SYMBOL
line = ("%s[%s] %s"):format(
INDENT:rep(level),
symbol,
node.planNode.phrase
)
end
table.insert(buffer, line)
for _, child in ipairs(node.children) do
reportNode(child, buffer, level + 1)
end
return buffer
end
local function reportRoot(node)
local buffer = {}
for _, child in ipairs(node.children) do
reportNode(child, buffer, 0)
end
return buffer
end
local function report(root)
local buffer = reportRoot(root)
return table.concat(buffer, "\n")
end
function TextReporterQuiet.report(results)
local resultBuffer = {
"Test results:",
report(results),
("%d passed, %d failed, %d skipped"):format(
results.successCount,
results.failureCount,
results.skippedCount
)
}
print(table.concat(resultBuffer, "\n"))
if results.failureCount > 0 then
print(("%d test nodes reported failures."):format(results.failureCount))
end
if #results.errors > 0 then
print("Errors reported by tests:")
print("")
for _, message in ipairs(results.errors) do
TestService:Error(message)
-- Insert a blank line after each error
print("")
end
end
end
return TextReporterQuiet
|
--[[**
ensures value is an array and all values of the array match check
@param check The check to compare all values with
@returns A function that will return true iff the condition is passed
**--]]
|
function t.array(check)
assert(t.callback(check))
local valuesCheck = t.values(check)
return function(value)
local keySuccess = arrayKeysCheck(value)
if keySuccess == false then
return false
end
-- # is unreliable for sparse arrays
-- Count upwards using ipairs to avoid false positives from the behavior of #
local arraySize = 0
for _ in ipairs(value) do
arraySize = arraySize + 1
end
for key in pairs(value) do
if key < 1 or key > arraySize then
return false
end
end
local valueSuccess = valuesCheck(value)
if not valueSuccess then
return false
end
return true
end
end
|
--Change this section to grant immunity to bans.
|
_G.immuneToBan = {game.CreatorId, 12345, 67890}
|
--[[Transmission]]
|
Tune.TransModes = {"Auto", "Semi", "Manual"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 4.06 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.04 ,
--[[ 3 ]] 1.38 ,
--[[ 4 ]] 1.03 ,
--[[ 5 ]] 0.81 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--------------------------------------------------------------------------------------
--------------------[ TOOL SELECTION AND DESELECTION ]--------------------------------
--------------------------------------------------------------------------------------
|
function OnEquipped(M_Icon)
wait(math.random(10, 40) / 100)
if Humanoid.Health ~= 0 and (not Selected) and Gun.Parent == Character then
Selected = true
BreakReload = false
--------------------[ FAILSAFE RESETING ]-------------------------------------
for _, GM in pairs(Ignore_Model:GetChildren()) do
if GM.Name == "Gun_Ignore_"..Player.Name then
GM:Destroy()
end
end
for _,c in pairs(Connections) do
c:disconnect()
end
Connections = {}
--------------------[ CREATING IGNORE MODELS ]--------------------------------
Gun_Ignore = Instance.new("Model")
Gun_Ignore.Name = "Gun_Ignore_"..Player.Name
Gun_Ignore.Parent = Ignore_Model
--------------------[ MODIFYING THE PLAYER ]----------------------------------
M_Icon.Icon = "rbxasset://textures\\Blank.png"
Gui_Clone = Main_Gui:Clone()
Gui_Clone.Parent = Player.PlayerGui
SetUpGui()
Shoulders.Right.Part1 = nil
Shoulders.Left.Part1 = nil
PrevNeckCF.C0 = Neck.C0
PrevNeckCF.C1 = Neck.C1
BG = Instance.new("BodyGyro", HRP)
BG.maxTorque = VEC3(HUGE, HUGE, HUGE)
BG.Name = "BG"
BG.P = 1e5
BG.cframe = CF(Torso.CFrame.p, Torso.CFrame.p + Torso.CFrame.lookVector)
local PlayerFolder = Instance.new("Model")
PlayerFolder.Name = "PlayerFolder"
PlayerFolder.Parent = Gun_Ignore
local AnimBase = Instance.new("Part")
AnimBase.Transparency = 1
AnimBase.Name = "AnimBase"
AnimBase.CanCollide = false
AnimBase.FormFactor = Enum.FormFactor.Custom
AnimBase.Size = VEC3(0.2, 0.2, 0.2)
AnimBase.BottomSurface = Enum.SurfaceType.Smooth
AnimBase.TopSurface = Enum.SurfaceType.Smooth
AnimBase.Parent = PlayerFolder
AnimWeld = Instance.new("Weld")
AnimWeld.Part0 = AnimBase
AnimWeld.Part1 = Head
AnimWeld.C0 = CF(0, 1, 0)
AnimWeld.Parent = AnimBase
local ArmBase = Instance.new("Part")
ArmBase.Transparency = 1
ArmBase.Name = "ArmBase"
ArmBase.CanCollide = false
ArmBase.FormFactor = Enum.FormFactor.Custom
ArmBase.Size = VEC3(0.2, 0.2, 0.2)
ArmBase.BottomSurface = Enum.SurfaceType.Smooth
ArmBase.TopSurface = Enum.SurfaceType.Smooth
ArmBase.Parent = PlayerFolder
ABWeld = Instance.new("Weld")
ABWeld.Part0 = ArmBase
ABWeld.Part1 = AnimBase
ABWeld.Parent = ArmBase
local LArmBase = Instance.new("Part")
LArmBase.Transparency = 1
LArmBase.Name = "LArmBase"
LArmBase.CanCollide = false
LArmBase.FormFactor = Enum.FormFactor.Custom
LArmBase.Size = VEC3(0.2, 0.2, 0.2)
LArmBase.BottomSurface = Enum.SurfaceType.Smooth
LArmBase.TopSurface = Enum.SurfaceType.Smooth
LArmBase.Parent = PlayerFolder
local RArmBase = Instance.new("Part")
RArmBase.Transparency = 1
RArmBase.Name = "RArmBase"
RArmBase.CanCollide = false
RArmBase.FormFactor = Enum.FormFactor.Custom
RArmBase.Size = VEC3(0.2, 0.2, 0.2)
RArmBase.BottomSurface = Enum.SurfaceType.Smooth
RArmBase.TopSurface = Enum.SurfaceType.Smooth
RArmBase.Parent = PlayerFolder
LWeld = Instance.new("Weld")
LWeld.Name = "LWeld"
LWeld.Part0 = ArmBase
LWeld.Part1 = LArmBase
LWeld.C0 = ArmC0[1]
LWeld.C1 = S.ArmC1_UnAimed.Left
LWeld.Parent = ArmBase
RWeld = Instance.new("Weld")
RWeld.Name = "RWeld"
RWeld.Part0 = ArmBase
RWeld.Part1 = RArmBase
RWeld.C0 = ArmC0[2]
RWeld.C1 = S.ArmC1_UnAimed.Right
RWeld.Parent = ArmBase
LWeld2 = Instance.new("Weld")
LWeld2.Name = "LWeld"
LWeld2.Part0 = LArmBase
LWeld2.Part1 = LArm
LWeld2.Parent = LArmBase
RWeld2 = Instance.new("Weld")
RWeld2.Name = "RWeld"
RWeld2.Part0 = RArmBase
RWeld2.Part1 = RArm
RWeld2.Parent = RArmBase
if S.PlayerArms then
FakeLArm = LArm:Clone()
FakeLArm.Parent = PlayerFolder
FakeLArm.Transparency = S.FakeArmTransparency
FakeLArm:BreakJoints()
LArm.Transparency = 1
local FakeLWeld = Instance.new("Weld")
FakeLWeld.Part0 = FakeLArm
FakeLWeld.Part1 = LArm
FakeLWeld.Parent = FakeLArm
FakeRArm = RArm:Clone()
FakeRArm.Parent = PlayerFolder
FakeRArm.Transparency = S.FakeArmTransparency
FakeRArm:BreakJoints()
RArm.Transparency = 1
local FakeRWeld = Instance.new("Weld")
FakeRWeld.Part0 = FakeRArm
FakeRWeld.Part1 = RArm
FakeRWeld.Parent = FakeRArm
Instance.new("Humanoid", PlayerFolder)
for _,Obj in pairs(Character:GetChildren()) do
if Obj:IsA("CharacterMesh") or Obj:IsA("Shirt") then
Obj:Clone().Parent = PlayerFolder
end
end
else
local ArmTable = CreateArms()
ArmTable[1].Model.Parent = PlayerFolder
ArmTable[2].Model.Parent = PlayerFolder
FakeLArm = ArmTable[1].ArmPart
LArm.Transparency = 1
local FakeLWeld = Instance.new("Weld")
FakeLWeld.Part0 = FakeLArm
FakeLWeld.Part1 = LArm
FakeLWeld.Parent = FakeLArm
FakeRArm = ArmTable[2].ArmPart
RArm.Transparency = 1
local FakeRWeld = Instance.new("Weld")
FakeRWeld.Part0 = FakeRArm
FakeRWeld.Part1 = RArm
FakeRWeld.Parent = FakeRArm
end
--------------------[ MODIFYING THE GUN ]-------------------------------------
for _, Tab in pairs(Parts) do
local Weld = Instance.new("Weld")
Weld.Name = "MainWeld"
Weld.Part0 = Handle
Weld.Part1 = Tab.Obj
Weld.C0 = Tab.Obj.WeldCF.Value
Weld.Parent = Handle
Tab.Weld = Weld
end
Grip = RArm:WaitForChild("RightGrip")
local HandleCF = ArmBase.CFrame * ArmC0[2] * S.ArmC1_Aimed.Right:inverse() * CF(0, -1, 0, 1, 0, 0, 0, 0, 1, 0, -1, 0)
local HandleOffset = AimPart.CFrame:toObjectSpace(Handle.CFrame)
Aimed_GripCF = (Head.CFrame * HandleOffset):toObjectSpace(HandleCF)
--------------------[ CONNECTIONS ]-------------------------------------------
INSERT(Connections, Humanoid.Died:connect(function()
OnUnequipped(true)
end))
INSERT(Connections, M2.Button1Down:connect(function()
MB1_Down = true
if S.GunType.Auto and (not S.GunType.Semi) and (not S.GunType.Burst) then
if (not CanFire) then return end
CanFire = false
if (not Running) and (not Knifing) and (not ThrowingGrenade) then
CurrentSpread = (
Aimed and S.Spread.Aimed or
((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
)
while MB1_Down and (not Reloading) do
if Knifing and (not ThrowingGrenade) then break end
if Running then break end
if Ammo.Value > 0 then
Ammo.Value = Ammo.Value - 1
if Humanoid.Health ~= 0 then
if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
Run_Key_Pressed = false
CurrentSteadyTime = 0
end
Fire_Gun()
end
end
if Ammo.Value == 0 and S.AutoReload then
wait(0.2)
Reload()
end
wait(60 / S.FireRate)
end
end
CanFire = true
elseif (not S.GunType.Auto) and S.GunType.Burst then
if (not CanFire) then return end
CanFire = false
if (not Running) and (not Knifing) and (not ThrowingGrenade) then
CurrentSpread = (
Aimed and S.Spread.Aimed or
((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
)
for i = 1, S.BurstAmount do
if Ammo.Value > 0 then
Ammo.Value = Ammo.Value - 1
if Humanoid.Health ~= 0 then
if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
Run_Key_Pressed = false
CurrentSteadyTime = 0
end
Fire_Gun()
end
end
if Ammo.Value == 0 and S.AutoReload then
wait(0.2)
Reload()
break
end
wait(S.BurstTime / S.BurstAmount)
end
end
wait(S.BurstWait)
CanFire = true
elseif (not S.GunType.Auto) and S.GunType.Semi then
if (not CanFire) then return end
CanFire = false
if (not Running) and (not Knifing) and (not ThrowingGrenade) then
CurrentSpread = (
Aimed and S.Spread.Aimed or
((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
)
if Ammo.Value > 0 then
Ammo.Value = Ammo.Value - 1
if Humanoid.Health ~= 0 then
if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
Run_Key_Pressed = false
CurrentSteadyTime = 0
end
Fire_Gun()
end
end
if Ammo.Value == 0 and S.AutoReload then
wait(0.2)
Reload()
end
wait(60 / S.FireRate)
end
CanFire = true
elseif (not S.GunType.Auto) and (not S.GunType.Semi) and (not S.GunType.Burst) and S.GunType.Shot then
if (not CanFire) then return end
CanFire = false
if (not Running) and (not Knifing) and (not ThrowingGrenade) then
CurrentSpread = (
Aimed and S.Spread.Aimed or
((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
)
if Ammo.Value > 0 then
Ammo.Value = Ammo.Value - 1
if Humanoid.Health ~= 0 then
if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
Run_Key_Pressed = false
CurrentSteadyTime = 0
end
Fire_Gun()
end
end
if Ammo.Value == 0 and S.AutoReload then
wait(0.2)
Reload()
end
wait(60 / S.FireRate)
end
CanFire = true
elseif (not S.GunType.Auto) and (not S.GunType.Semi) and S.GunType.Burst and (not S.GunType.Shot) then
if (not CanFire) then return end
CanFire = false
if (not Running) and (not Knifing) and (not ThrowingGrenade) then
CurrentSpread = (
Aimed and S.Spread.Aimed or
((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
)
for i = 1, S.BurstAmount do
if Ammo.Value > 0 then
Ammo.Value = Ammo.Value - 1
if Humanoid.Health ~= 0 then
if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
Run_Key_Pressed = false
CurrentSteadyTime = 0
end
Fire_Gun()
end
end
if Ammo.Value == 0 and S.AutoReload then
wait(0.2)
Reload()
break
end
wait(S.BurstTime / S.BurstAmount)
end
end
wait(S.BurstWait)
CanFire = true
elseif (not S.GunType.Auto) and (not S.GunType.Burst) and (not S.GunType.Shot) and S.GunType.Explosive then
if (not CanFire) then return end
CanFire = false
if (not Running) and (not Knifing) and (not ThrowingGrenade) then
CurrentSpread = (
Aimed and S.Spread.Aimed or
((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
)
if Ammo.Value > 0 then
Ammo.Value = Ammo.Value - 1
if Humanoid.Health ~= 0 then
if Aimed and Run_Key_Pressed and S.UnSteadyOnFire then
Run_Key_Pressed = false
CurrentSteadyTime = 0
end
Fire_Gun()
end
end
if Ammo.Value == 0 and S.AutoReload then
wait(0.2)
Reload()
end
wait(60 / S.FireRate)
end
CanFire = true
end
end))
INSERT(Connections, M2.Button1Up:connect(function()
MB1_Down = false
CurrentSpread = (
Aimed and S.Spread.Aimed or
((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
)
end))
INSERT(Connections, M2.Button2Down:connect(function()
if S.HoldMouseOrKeyToADS then
if (not AimingIn) and (not Aimed) then
AimingIn = true
AimGun()
AimingIn = false
end
else
if Aimed then
UnAimGun()
else
AimGun()
end
end
end))
INSERT(Connections, M2.Button2Up:connect(function()
if S.HoldMouseOrKeyToADS then
if (not AimingOut) and Aimed then
AimingOut = true
UnAimGun()
AimingOut = false
end
end
end))
INSERT(Connections, M2.KeyDown:connect(KeyDown))
INSERT(Connections, M2.KeyUp:connect(KeyUp))
INSERT(Connections, RS:connect(function()
local CrossHair = Gui_Clone:WaitForChild("CrossHair")
local HitMarker = Gui_Clone:WaitForChild("HitMarker")
local HUD = Gui_Clone:WaitForChild("HUD")
CrossHair.Position = UDim2.new(0, M2.X, 0, M2.Y)
HitMarker.Position = UDim2.new(0, M2.X - 13, 0, M2.Y - 13)
local Clip_Ammo_L = HUD:WaitForChild("Ammo"):WaitForChild("Clip")
local Stored_Ammo_L = HUD:WaitForChild("Ammo"):WaitForChild("Stored")
Clip_Ammo_L.Text = Ammo.Value
Clip_Ammo_L.TextColor3 = (Ammo.Value <= (ClipSize.Value / 4) and Color3.new(1, 1, 0) or Color3.new(1, 1, 1))
Stored_Ammo_L.Text = StoredAmmo.Value
Stored_Ammo_L.TextColor3 = (StoredAmmo.Value <= (ClipSize.Value * 0.5) and Color3.new(1, 0.5, 0.5) or Color3.new(1, 1, 1))
local Lethal_Grenade_Num_L = HUD:WaitForChild("Grenades"):WaitForChild("Lethals"):WaitForChild("Num")
Lethal_Grenade_Num_L.Text = LethalGrenades.Value
Lethal_Grenade_Num_L.TextColor3 = (LethalGrenades.Value < 2 and Color3.new(1, 0.5, 0.5) or Color3.new(1, 1, 1))
local Tactical_Grenade_Num_L = HUD:WaitForChild("Grenades"):WaitForChild("Tacticals"):WaitForChild("Num")
Tactical_Grenade_Num_L.Text = TacticalGrenades.Value
Tactical_Grenade_Num_L.TextColor3 = (TacticalGrenades.Value < 2 and Color3.new(1, 0.5, 0.5) or Color3.new(1, 1, 1))
local Mode = HUD:WaitForChild("Mode"):WaitForChild("Main")
if S.GunType.Auto
and (not S.GunType.Semi)
and (not S.GunType.Burst)
and (not S.GunType.Explosive) then
Mode.Text = "Auto"
elseif (not S.GunType.Auto)
and S.GunType.Burst
and (not S.GunType.Explosive) then
Mode.Text = "Burst"
elseif (not S.GunType.Auto)
and S.GunType.Semi
and (not S.GunType.Explosive) then
Mode.Text = "Semi"
elseif (not S.GunType.Auto)
and (not S.GunType.Semi)
and (not S.GunType.Burst)
and S.GunType.Shot
and (not S.GunType.Explosive) then
Mode.Text = "Shotgun"
elseif (not S.GunType.Auto)
and (not S.GunType.Semi)
and S.GunType.Burst
and (not S.GunType.Shot)
and (not S.GunType.Explosive) then
Mode.Text = "Burst"
elseif S.GunType.Explosive then
Mode.Text = "Explosive"
end
if tick() - LastBeat > (Humanoid.Health / 75) then
LastBeat = tick()
HUD.Health.Tray.Beat:TweenPosition(
UDim2.new(0, -21, 0, 0),
Enum.EasingDirection.Out,
Enum.EasingStyle.Linear,
0.7 - ((100 - Humanoid.Health) / 400),
false,
function()
HUD.Health.Tray.Beat.Position = UDim2.new(1, 0, 0, 0)
end
)
end
HUD.Health.Num.Text = CEIL(Humanoid.Health).."%"
HUD.Health.Num.TextColor3 = (
(Humanoid.Health > 200 / 3) and Color3.new(1, 1, 1) or
(Humanoid.Health <= 200 / 3 and Humanoid.Health > 100 / 3) and Color3.new(1, 1, 0) or
(Humanoid.Health <= 100 / 3) and Color3.new(1, 0, 0)
)
end))
INSERT(Connections, RS:connect(function()
local MDir = M2.UnitRay.Direction.unit
local HRPCF = HRP.CFrame * CF(0, 1.5, 0) * CF(Humanoid.CameraOffset)
Neck.C0 = Torso.CFrame:toObjectSpace(HRPCF)
if MDir.y == MDir.y then
HeadRot = -math.asin(MDir.y)
Neck.C1 = CFANG(HeadRot,0,0)
local RotTarget = VEC3(MDir.x,0,MDir.z)
local Rotation = CF(Torso.Position,Torso.Position + RotTarget)
BG.cframe = Rotation
local MouseX = FLOOR((M2.X - M2.ViewSizeX / 2) + 0.5)
local MouseY = FLOOR((M2.Y - M2.ViewSizeY / 2) + 0.5)
local AppliedMaxTorque = nil
if (Camera.CoordinateFrame.p - Head.Position).magnitude < 0.6 then
if (MouseX >= 50 or MouseX <= -50)
or (MouseY >= 50 or MouseY <= -50) then
AppliedMaxTorque = VEC3()
else
AppliedMaxTorque = VEC3(HUGE,HUGE,HUGE)
end
else
AppliedMaxTorque = VEC3(HUGE,HUGE,HUGE)
end
if (not S.RotateWhileSitting) and Humanoid.Sit then
AppliedMaxTorque = VEC3()
end
BG.maxTorque = AppliedMaxTorque
end
end))
INSERT(Connections, RS:connect(function()
local Forward = (Keys["w"] or Keys[string.char(17)])
local Backward = (Keys["s"] or Keys[string.char(18)])
local Right = (Keys["d"] or Keys[string.char(19)])
local Left = (Keys["a"] or Keys[string.char(20)])
local WalkingForward = (Forward and (not Backward))
local WalkingBackward = ((not Forward) and Backward)
local WalkingRight = (Right and (not Left))
local WalkingLeft = ((not Right) and Left)
ArmTilt = (
((WalkingForward or WalkingBackward) and WalkingRight) and 5 or
((WalkingForward or WalkingBackward) and WalkingLeft) and -5 or
((not (WalkingForward and WalkingBackward)) and WalkingRight) and 10 or
((not (WalkingForward and WalkingBackward)) and WalkingLeft) and -10 or 0
)
end))
INSERT(Connections, RS:connect(function()
if (not Idleing) and Walking then
if Running then
Humanoid.WalkSpeed = S.SprintSpeed
else
local SpeedRatio = (S.AimedWalkSpeed / S.BaseWalkSpeed)
if Stance == 0 then
Humanoid.WalkSpeed = (Aimed and S.AimedWalkSpeed or S.BaseWalkSpeed)
elseif Stance == 1 then
Humanoid.WalkSpeed = (Aimed and S.CrouchWalkSpeed * SpeedRatio or S.CrouchWalkSpeed)
elseif Stance == 2 then
Humanoid.WalkSpeed = (Aimed and S.ProneWalkSpeed * SpeedRatio or S.ProneWalkSpeed)
end
end
else
Humanoid.WalkSpeed = 16
end
StanceSway = 1 - (0.25 * Stance)
end))
--------------------[ ANIMATE GUN ]-------------------------------------------
Animate()
end
end
function OnUnequipped(DeleteTool)
if Selected then
Selected = false
BreakReload = true
--------------------[ MODIFYING THE PLAYER ]----------------------------------
Camera.FieldOfView = 70
game:GetService("UserInputService").MouseIconEnabled = true
Gui_Clone:Destroy()
BG:Destroy()
RArm.Transparency = 0
LArm.Transparency = 0
Shoulders.Right.Part1 = RArm
Shoulders.Left.Part1 = LArm
Neck.C0 = PrevNeckCF.C0
Neck.C1 = PrevNeckCF.C1
Humanoid.WalkSpeed = 16
--------------------[ RESETING THE TOOL ]-------------------------------------
Gun_Ignore:Destroy()
Aimed = false
for _, Tab in pairs(Parts) do
Tab.Weld:Destroy()
Tab.Weld = nil
end
for _,c in pairs(Connections) do
c:disconnect()
end
Connections = {}
if DeleteTool then
Camera:ClearAllChildren()
Gun:Destroy()
end
if S.StandOnDeselect and Stance ~= 0 then Stand(true) end
end
end
Gun.Equipped:connect(OnEquipped)
Gun.Unequipped:connect(function() OnUnequipped(false) end)
|
--[[ NOTE: You don't need to do anything to this script
DO NOT DO ANYTHING TO THIS SCRIPT IF YOU DON'T KNOW WHAT YOUR DOING!
You only need to do things in the String Value named 'TheCharacter'
READ INSTRUCTIONS ]]
|
--
door = script.Parent
function onChatted(msg, recipient, speaker)
source = string.lower(speaker.Name)
msg = string.lower(msg)
thecharacter = script.Parent.TheCharacter
if (msg == string.lower(thecharacter.Value)) then
door.CanCollide = false
door.Transparency = 0.7
wait(4)
door.CanCollide = true
door.Transparency = 0
end
end
game.Players.ChildAdded:connect(function(plr)
plr.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, plr) end)
end)
|
-- NOTE: This is only works ingame! this will not work in Roblox Studio
| |
--[[ Roblox Services ]]
|
--
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local StarterGui = game:GetService("StarterGui")
local VRService = game:GetService("VRService")
local UserGameSettings = UserSettings():GetService("UserGameSettings")
local player = Players.LocalPlayer
local FFlagUserFlagEnableNewVRSystem do
local success, result = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserFlagEnableNewVRSystem")
end)
FFlagUserFlagEnableNewVRSystem = success and result
end
|
--[[Weld Functions]]
|
--
local JS = game:GetService("JointsService")
function MakeWeld(x,y,type,s)
if type==nil then type="Weld" end
local W=Instance.new(type,JS)
W.Part0=x W.Part1=y
W.C0=x.CFrame:inverse()*x.CFrame
W.C1=y.CFrame:inverse()*x.CFrame
if type=="Motor" and s~=nil then W.MaxVelocity=s end
return W
end
function ModelWeld(a,b)
if a:IsA("BasePart") then
MakeWeld(b,a,"Weld")
elseif a:IsA("Model") then
for i,v in pairs(a:GetChildren()) do ModelWeld(v,b) end
end
end
function UnAnchor(a)
if a:IsA("BasePart") then a.Anchored=false end
for i,v in pairs(a:GetChildren()) do UnAnchor(v) end
end
|
--stunSound.Volume = 1/(script.Parent.Dist.Value*script.Parent.Dist.Value)
|
stunSound:Play()
local tweenInfo = TweenInfo.new(
script.Parent.Time.Value, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.InOut, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
local tween0 = TweenService:Create(stunSound, TweenInfo.new(script.Parent.Time.Value), {Volume = stunSound.Volume*2})
tween0:Play()
local tween = TweenService:Create(guiMain, tweenInfo, {Brightness = 0})
tween:Play()
spawn(function()
wait(script.Parent.Time.Value)
local tween = TweenService:Create(stunSound, TweenInfo.new(0.5), {Volume = 0})
tween:Play()
end)
wait(script.Parent.Time.Value + .5)
|
-- same as jump for now
|
function moveFreeFall()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 3.14
LeftShoulder.DesiredAngle = -3.14
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function moveSit()
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
RightShoulder.DesiredAngle = 3.14 /2
LeftShoulder.DesiredAngle = -3.14 /2
RightHip.DesiredAngle = 3.14 /2
LeftHip.DesiredAngle = -3.14 /2
end
function getTool()
for _, kid in ipairs(Figure:GetChildren()) do
if kid.className == "Tool" then return kid end
end
return nil
end
function getToolAnim(tool)
for _, c in ipairs(tool:GetChildren()) do
if c.Name == "toolanim" and c.className == "StringValue" then
return c
end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
RightShoulder.DesiredAngle = 1.57
return
end
if (toolAnim == "Slash") then
RightShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 0
return
end
if (toolAnim == "Lunge") then
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightHip.MaxVelocity = 0.5
LeftHip.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 1.57
LeftShoulder.DesiredAngle = 1.0
RightHip.DesiredAngle = 1.57
LeftHip.DesiredAngle = 1.0
return
end
end
function move(time)
local amplitude
local frequency
if (pose == "Jumping") then
moveJump()
return
end
if (pose == "FreeFall") then
moveFreeFall()
return
end
if (pose == "Seated") then
moveSit()
return
end
local climbFudge = 0
if (pose == "Running") then
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
amplitude = 1
frequency = 9
elseif (pose == "Climbing") then
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
amplitude = 1
frequency = 9
climbFudge = 3.14
else
amplitude = 0.1
frequency = 1
end
desiredAngle = amplitude * math.sin(time*frequency)
RightShoulder.DesiredAngle = desiredAngle + climbFudge
LeftShoulder.DesiredAngle = desiredAngle - climbFudge
RightHip.DesiredAngle = -desiredAngle
LeftHip.DesiredAngle = -desiredAngle
local tool = getTool()
if tool then
animStringValueObject = getToolAnim(tool)
if animStringValueObject then
toolAnim = animStringValueObject.Value
-- message recieved, delete StringValue
animStringValueObject.Parent = nil
toolAnimTime = time + .3
end
if time > toolAnimTime then
toolAnimTime = 0
toolAnim = "None"
end
animateTool()
else
toolAnim = "None"
toolAnimTime = 0
end
end
|
-- Basic Settings
|
AdminCredit=true; -- Enables the credit GUI for that appears in the bottom right
AutoClean=false; -- Enables automatic cleaning of hats & tools in the Workspace
AutoCleanDelay=60; -- The delay between each AutoClean routine
CommandBar=true; -- Enables the Command Bar | GLOBAL KEYBIND: \
FunCommands=true; -- Enables fun yet unnecessary commands
FreeAdmin=false; -- Set to 1-5 to grant admin powers to all, otherwise set to false
PublicLogs=false; -- Allows all users to see the command & chat logs
Prefix='/'; -- Character to begin a command
--[[
Admin Powers
0 Player
1 VIP Can use nonabusive commands only on self
2 Moderator Can kick, mute, & use most commands
3 Administrator Can ban, crash, & set Moderators/VIP
4 SuperAdmin Can grant permanent powers, & shutdown the game
5 Owner Can set SuperAdmins, & use all the commands
6 Game Creator Can set owners & use all the commands
Group & VIP Admin
You can set multiple Groups & Ranks to grant users admin powers:
GroupAdmin={
[12345]={[254]=4,[253]=3};
[GROUPID]={[RANK]=ADMINPOWER}
};
You can set multiple Assets to grant users admin powers:
VIPAdmin={
[12345]=3;
[54321]=4;
[ITEMID]=ADMINPOWER;
}; ]]
GroupAdmin={
};
VIPAdmin={
};
|
--[[
Find all the ModuleScripts in this tree that are tests.
]]
|
function TestBootstrap:getModules(root)
local modules = {}
self:getModulesImpl(root, modules)
for _, child in ipairs(root:GetDescendants()) do
self:getModulesImpl(root, modules, child)
end
return modules
end
|
--[[local RunService = game:GetService("RunService")
local camera = workspace.CurrentCamera
RunService:BindToRenderStep("UpdateLoop", Enum.RenderPriority.Camera.Value, function()
local rX, rY, rZ = camera.CFrame:ToOrientation()
local limY = math.clamp(math.deg(rY), -45, 45)
camera.CFrame = CFrame.new(camera.CFrame.p) * CFrame.fromOrientation(rX, limY, rZ)
end)]]
| |
--[[Susupension]]
|
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 500 -- Spring Dampening
Tune.FSusStiffness = 3500 -- Spring Force
Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 2 -- Suspension length (in studs)
Tune.FPreCompress = .3 -- Pre-compression adds resting length force
Tune.FExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.FCompressLim = .1 -- Max Compression Travel (in studs)
Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 5 -- Wishbone Length
Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Rear Suspension
Tune.RSusDamping = 500 -- Spring Dampening
Tune.RSusStiffness = 14500 -- Spring Force
Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2 -- Suspension length (in studs)
Tune.RPreCompress = .3 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = .1 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics
Tune.SusVisible = false -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Bright red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
--- Handles user input when the box is focused
|
function Window:BeginInput(input, gameProcessed)
if GuiService.MenuIsOpen then
self:Hide()
end
if gameProcessed and self:IsVisible() == false then
return
end
if self.Cmdr.ActivationKeys[input.KeyCode] then -- Activate the command bar
if self.Cmdr.MashToEnable and not self.Cmdr.Enabled then
if tick() - lastPressTime < 1 then
if pressCount >= 5 then
return self.Cmdr:SetEnabled(true)
else
pressCount = pressCount + 1
end
else
pressCount = 1
end
lastPressTime = tick()
elseif self.Cmdr.Enabled then
self:SetVisible(not self:IsVisible())
wait()
self:SetEntryText("")
if GuiService.MenuIsOpen then -- Special case for menu getting stuck open (roblox bug)
self:Hide()
end
end
return
end
if self.Cmdr.Enabled == false or not self:IsVisible() then
if self:IsVisible() then
self:Hide()
end
return
end
if input.KeyCode == Enum.KeyCode.Down then -- Auto Complete Down
self:SelectVertical(1)
elseif input.KeyCode == Enum.KeyCode.Up then -- Auto Complete Up
self:SelectVertical(-1)
elseif input.KeyCode == Enum.KeyCode.Return then -- Eat new lines
wait()
self:SetEntryText(self:GetEntryText():gsub("\n", ""):gsub("\r", ""))
elseif input.KeyCode == Enum.KeyCode.Tab then -- Auto complete
local item = self.AutoComplete:GetSelectedItem()
local text = self:GetEntryText()
if item and not (text:sub(#text, #text):match("%s") and self.AutoComplete.LastItem) then
local replace = item[2]
local newText
local insertSpace = true
local command = self.AutoComplete.Command
if command then
local lastArg = self.AutoComplete.Arg
newText = command.Alias
insertSpace = self.AutoComplete.NumArgs ~= #command.ArgumentDefinitions
local args = command.Arguments
for i = 1, #args do
local arg = args[i]
local segments = arg.RawSegments
if arg == lastArg then
segments[#segments] = replace
end
local argText = arg.Prefix .. table.concat(segments, ",")
-- Put auto completion options in quotation marks if they have a space
if argText:find(" ") then
argText = ("%q"):format(argText)
end
newText = ("%s %s"):format(newText, argText)
if arg == lastArg then
break
end
end
else
newText = replace
end
-- need to wait a frame so we can eat the \t
wait()
-- Update the text box
self:SetEntryText(newText .. (insertSpace and " " or ""))
else
-- Still need to eat the \t even if there is no auto-complete to show
wait()
self:SetEntryText(self:GetEntryText())
end
else
self:ClearHistoryState()
end
end
|
-- You really had to make me do this exploiters? ;_;
|
workspace.FilteringEnabled = true
workspace.Changed:connect(function ()
workspace.FilteringEnabled = true
end)
|
-- returns the ascendant ScreenGui of an object
|
function GetScreen(screen)
if screen == nil then return nil end
while not screen:IsA("ScreenGui") do
screen = screen.Parent
if screen == nil then return nil end
end
return screen
end
|
-- Properties
|
local OptimalEffects = false -- Adjust details of effects by client quality level
local RenderDistance = 400 -- Maximum camera distance to render visual effects
local ScreenCullingEnabled = true -- Show visual effects when their positions are on screen
local MaxDebrisCounts = 100 -- Maximum number of debris objects (mostly decayed projectiles) to exist
local RayExit = true -- Only for Wall Penetration
FastCast.DebugLogging = false
FastCast.VisualizeCasts = false
local Beam = Instance.new("Beam")
Beam.TextureSpeed = 0
Beam.LightEmission = 0
Beam.LightInfluence = 1
Beam.Transparency = NumberSequence.new(0)
local BlockSegContainer = Instance.new("Folder")
BlockSegContainer.Name = "BlockSegContainer"
BlockSegContainer.Parent = Camera
local CylinderSegContainer = Instance.new("Folder")
CylinderSegContainer.Name = "CylinderSegContainer"
CylinderSegContainer.Parent = Camera
local ConeSegContainer = Instance.new("Folder")
ConeSegContainer.Name = "ConeSegContainer"
ConeSegContainer.Parent = Camera
local Caster = FastCast.new()
local BlockSegCache = PartCache.new(Miscs.BlockSegment, 500)
BlockSegCache:SetCacheParent(BlockSegContainer)
local CylinderSegCache = PartCache.new(Miscs.CylinderSegment, 500)
CylinderSegCache:SetCacheParent(CylinderSegContainer)
local ConeSegCache = PartCache.new(Miscs.ConeSegment, 500)
ConeSegCache:SetCacheParent(ConeSegContainer)
local ShootId = 0
local DebrisCounts = 0
local PartCacheStorage = {}
local function CastWithBlacklist(Cast, Origin, Direction, Blacklist, IgnoreWater)
local CastRay = Ray.new(Origin, Direction)
local HitPart, HitPoint, HitNormal, HitMaterial = nil, Origin + Direction, Vector3.new(0, 1, 0), Enum.Material.Air
local Success = false
repeat
HitPart, HitPoint, HitNormal, HitMaterial = Workspace:FindPartOnRayWithIgnoreList(CastRay, Blacklist, false, IgnoreWater)
if HitPart then
--if Cast.UserData.ClientModule.IgnoreBlacklistedParts and Cast.UserData.ClientModule.BlacklistParts[HitPart.Name] then
-- table.insert(Blacklist, HitPart)
-- Success = false
--else
local Target = HitPart:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
local TargetTool = HitPart:FindFirstAncestorOfClass("Tool")
if (HitPart.Transparency > 0.75
or HitPart.Name == "Missile"
or HitPart.Name == "Handle"
or HitPart.Name == "Effect"
or HitPart.Name == "Bullet"
or HitPart.Name == "Laser"
or string.lower(HitPart.Name) == "water"
or HitPart.Name == "Rail"
or HitPart.Name == "Arrow"
or (TargetHumanoid and (TargetHumanoid.Health <= 0 or not DamageModule.CanDamage(Target, Cast.UserData.Character, Cast.UserData.ClientModule.FriendlyFire) or (Cast.UserData.BounceData and table.find(Cast.UserData.BounceData.BouncedHumanoids, TargetHumanoid))))
or TargetTool) then
table.insert(Blacklist, HitPart)
Success = false
else
Success = true
end
--end
else
Success = true
end
until Success
return HitPart, HitPoint, HitNormal, HitMaterial
end
local function AddressTableValue(Enabled, Level, V1, V2)
if V1 ~= nil and Enabled and Level then
return ((Level == 1 and V1.Level1) or (Level == 2 and V1.Level2) or (Level == 3 and V1.Level3) or V2)
else
return V2
end
end
local function CanShowEffects(Position)
if ScreenCullingEnabled then
local _, OnScreen = Camera:WorldToScreenPoint(Position)
return OnScreen and (Position - Camera.CFrame.p).Magnitude <= RenderDistance
end
return (Position - Camera.CFrame.p).Magnitude <= RenderDistance
end
local function PopulateHumanoids(Cast, Model)
if Model.ClassName == "Humanoid" then
if DamageModule.CanDamage(Model.Parent, Cast.UserData.Character, Cast.UserData.ClientModule.FriendlyFire) then
table.insert(Humanoids, Model)
end
end
for i, mdl in ipairs(Model:GetChildren()) do
PopulateHumanoids(Cast, mdl)
end
end
local function FindNearestEntity(Cast, Position)
Humanoids = {}
PopulateHumanoids(Cast, Workspace)
local Dist = Cast.UserData.HomeData.HomingDistance
local TargetModel = nil
local TargetHumanoid = nil
local TargetTorso = nil
for i, v in ipairs(Humanoids) do
local torso = v.Parent:FindFirstChild("HumanoidRootPart") or v.Parent:FindFirstChild("Torso") or v.Parent:FindFirstChild("UpperTorso")
if v and torso then
if (torso.Position - Position).Magnitude < (Dist + (torso.Size.Magnitude / 2.5)) and v.Health > 0 then
if not Cast.UserData.HomeData.HomeThroughWall then
local hit, pos, normal, material = CastWithBlacklist(Cast, Position, (torso.CFrame.p - Position).Unit * 999, Cast.UserData.IgnoreList, true)
if hit then
if hit:IsDescendantOf(v.Parent) then
if DamageModule.CanDamage(v.Parent, Cast.UserData.Character, Cast.UserData.ClientModule.FriendlyFire) then
TargetModel = v.Parent
TargetHumanoid = v
TargetTorso = torso
Dist = (Position - torso.Position).Magnitude
end
end
end
else
if DamageModule.CanDamage(v.Parent, Cast.UserData.Character, Cast.UserData.ClientModule.FriendlyFire) then
TargetModel = v.Parent
TargetHumanoid = v
TargetTorso = torso
Dist = (Position - torso.Position).Magnitude
end
end
end
end
end
return TargetModel, TargetHumanoid, TargetTorso
end
local function EmitParticle(Particle, Count)
if OptimalEffects then
local QualityLevel = UserSettings().GameSettings.SavedQualityLevel
if QualityLevel == Enum.SavedQualitySetting.Automatic then
local Compressor = 1 / 2
Particle:Emit(Count * Compressor)
else
local Compressor = QualityLevel.Value / 21
Particle:Emit(Count * Compressor)
end
else
Particle:Emit(Count)
end
end
local function FadeBeam(A0, A1, Beam, Hole, FadeTime, Replicate)
if FadeTime > 0 then
if OptimalEffects then
if Replicate then
local t0 = os.clock()
while Hole ~= nil do
local Alpha = math.min((os.clock() - t0) / FadeTime, 1)
if Beam then Beam.Transparency = NumberSequence.new(Math.Lerp(0, 1, Alpha)) end
if Alpha == 1 then break end
Thread:Wait()
end
if A0 then A0:Destroy() end
if A1 then A1:Destroy() end
if Beam then Beam:Destroy() end
if Hole then Hole:Destroy() end
else
if A0 then A0:Destroy() end
if A1 then A1:Destroy() end
if Beam then Beam:Destroy() end
if Hole then Hole:Destroy() end
end
else
local t0 = os.clock()
while Hole ~= nil do
local Alpha = math.min((os.clock() - t0) / FadeTime, 1)
if Beam then Beam.Transparency = NumberSequence.new(Math.Lerp(0, 1, Alpha)) end
if Alpha == 1 then break end
Thread:Wait()
end
if A0 then A0:Destroy() end
if A1 then A1:Destroy() end
if Beam then Beam:Destroy() end
if Hole then Hole:Destroy() end
end
else
if A0 then A0:Destroy() end
if A1 then A1:Destroy() end
if Beam then Beam:Destroy() end
if Hole then Hole:Destroy() end
end
end
local function MakeImpactFX(Hit, Position, Normal, Material, ParentToPart, ClientModule, Misc, Replicate, IsMelee)
local SurfaceCF = CFrame.new(Position, Position + Normal)
local HitEffectEnabled = ClientModule.HitEffectEnabled
local HitSoundIDs = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitSoundIDs, ClientModule.HitSoundIDs)
local HitSoundPitchMin = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitSoundPitchMin, ClientModule.HitSoundPitchMin)
local HitSoundPitchMax = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitSoundPitchMax, ClientModule.HitSoundPitchMax)
local HitSoundVolume = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitSoundVolume, ClientModule.HitSoundVolume)
local CustomHitEffect = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.CustomHitEffect, ClientModule.CustomHitEffect)
local BulletHoleEnabled = ClientModule.BulletHoleEnabled
local BulletHoleSize = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BulletHoleSize, ClientModule.BulletHoleSize)
local BulletHoleTexture = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BulletHoleTexture, ClientModule.BulletHoleTexture)
local PartColor = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.PartColor, ClientModule.PartColor)
local BulletHoleVisibleTime = ClientModule.BulletHoleVisibleTime
local BulletHoleFadeTime = ClientModule.BulletHoleFadeTime
if IsMelee then
HitEffectEnabled = ClientModule.MeleeHitEffectEnabled
HitSoundIDs = ClientModule.MeleeHitSoundIDs
HitSoundPitchMin = ClientModule.MeleeHitSoundPitchMin
HitSoundPitchMax = ClientModule.MeleeHitSoundPitchMax
HitSoundVolume = ClientModule.MeleeHitSoundVolume
CustomHitEffect = ClientModule.CustomMeleeHitEffect
BulletHoleEnabled = ClientModule.MarkerEffectEnabled
BulletHoleSize = ClientModule.MarkerEffectSize
BulletHoleTexture = ClientModule.MarkerEffectTexture
BulletHoleVisibleTime = ClientModule.MarkerEffectVisibleTime
BulletHoleFadeTime = ClientModule.MarkerEffectFadeTime
PartColor = ClientModule.MarkerPartColor
end
if HitEffectEnabled then
local Attachment = Instance.new("Attachment")
Attachment.CFrame = SurfaceCF
Attachment.Parent = Workspace.Terrain
local Sound
local function Spawner(material)
if Misc.HitEffectFolder[material.Name]:FindFirstChild("MaterialSounds") then
local tracks = Misc.HitEffectFolder[material.Name].MaterialSounds:GetChildren()
local rn = math.random(1, #tracks)
local track = tracks[rn]
if track ~= nil then
Sound = track:Clone()
if track:FindFirstChild("Pitch") then
Sound.PlaybackSpeed = Random.new():NextNumber(track.Pitch.Min.Value, track.Pitch.Max.Value)
else
Sound.PlaybackSpeed = Random.new():NextNumber(HitSoundPitchMin, HitSoundPitchMax)
end
if track:FindFirstChild("Volume") then
Sound.Volume = Random.new():NextNumber(track.Volume.Min.Value, track.Volume.Max.Value)
else
Sound.Volume = HitSoundVolume
end
Sound.Parent = Attachment
end
else
Sound = Instance.new("Sound")
Sound.SoundId = "rbxassetid://"..HitSoundIDs[math.random(1, #HitSoundIDs)]
Sound.PlaybackSpeed = Random.new():NextNumber(HitSoundPitchMin, HitSoundPitchMax)
Sound.Volume = HitSoundVolume
Sound.Parent = Attachment
end
for i, v in pairs(Misc.HitEffectFolder[material.Name]:GetChildren()) do
if v.ClassName == "ParticleEmitter" then
local Count = 1
local Particle = v:Clone()
Particle.Parent = Attachment
if Particle:FindFirstChild("EmitCount") then
Count = Particle.EmitCount.Value
end
if Particle.PartColor.Value then
local HitPartColor = Hit and Hit.Color or Color3.fromRGB(255, 255, 255)
if Hit and Hit:IsA("Terrain") then
HitPartColor = Workspace.Terrain:GetMaterialColor(Material or Enum.Material.Sand)
end
Particle.Color = ColorSequence.new(HitPartColor, HitPartColor)
end
Thread:Delay(0.01, function()
EmitParticle(Particle, Count)
Debris:AddItem(Particle, Particle.Lifetime.Max)
end)
end
end
Sound:Play()
if BulletHoleEnabled then
local Hole = Instance.new("Attachment")
Hole.Parent = ParentToPart and Hit or Workspace.Terrain
Hole.WorldCFrame = SurfaceCF * CFrame.Angles(math.rad(90), math.rad(180), 0)
if ParentToPart then
local Scale = BulletHoleSize
if Misc.HitEffectFolder[material.Name]:FindFirstChild("MaterialHoleSize") then
Scale = Misc.HitEffectFolder[material.Name].MaterialHoleSize.Value
end
local A0 = Instance.new("Attachment")
local A1 = Instance.new("Attachment")
local BeamClone = Beam:Clone()
BeamClone.Width0 = Scale
BeamClone.Width1 = Scale
if Misc.HitEffectFolder[material.Name]:FindFirstChild("MaterialDecals") then
local Decals = Misc.HitEffectFolder[material.Name].MaterialDecals:GetChildren()
local Chosen = math.random(1, #Decals)
local Decal = Decals[Chosen]
if Decal ~= nil then
BeamClone.Texture = "rbxassetid://"..Decal.Value
if Decal.PartColor.Value then
local HitPartColor = Hit and Hit.Color or Color3.fromRGB(255, 255, 255)
if Hit and Hit:IsA("Terrain") then
HitPartColor = Workspace.Terrain:GetMaterialColor(Material or Enum.Material.Sand)
end
BeamClone.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, HitPartColor), ColorSequenceKeypoint.new(1, HitPartColor)})
end
end
else
BeamClone.Texture = "rbxassetid://"..BulletHoleTexture[math.random(1, #BulletHoleTexture)]
if PartColor then
local HitPartColor = Hit and Hit.Color or Color3.fromRGB(255, 255, 255)
if Hit and Hit:IsA("Terrain") then
HitPartColor = Workspace.Terrain:GetMaterialColor(Material or Enum.Material.Sand)
end
BeamClone.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, HitPartColor), ColorSequenceKeypoint.new(1, HitPartColor)})
end
end
BeamClone.Attachment0 = A0
BeamClone.Attachment1 = A1
A0.Parent = Hit
A1.Parent = Hit
A0.WorldCFrame = Hole.WorldCFrame * CFrame.new(Scale / 2, -0.01, 0) * CFrame.Angles(math.rad(90), 0, 0)
A1.WorldCFrame = Hole.WorldCFrame * CFrame.new(-Scale / 2, -0.01, 0) * CFrame.Angles(math.rad(90), math.rad(180), 0)
BeamClone.Parent = Workspace.Terrain
Thread:Delay(BulletHoleVisibleTime, function()
FadeBeam(A0, A1, BeamClone, Hole, BulletHoleFadeTime, Replicate)
end)
else
Debris:AddItem(Hole, 5)
end
end
end
if not CustomHitEffect then
if Misc.HitEffectFolder:FindFirstChild(Hit.Material) then
Spawner(Hit.Material)
else
Spawner(Misc.HitEffectFolder.Custom)
end
else
Spawner(Misc.HitEffectFolder.Custom)
end
Debris:AddItem(Attachment, 10)
end
end
local function MakeBloodFX(Hit, Position, Normal, Material, ParentToPart, ClientModule, Misc, Replicate, IsMelee)
local SurfaceCF = CFrame.new(Position, Position + Normal)
local BloodEnabled = ClientModule.BloodEnabled
local HitCharSndIDs = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitCharSndIDs, ClientModule.HitCharSndIDs)
local HitCharSndPitchMin = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitCharSndPitchMin, ClientModule.HitCharSndPitchMin)
local HitCharSndPitchMax = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitCharSndPitchMax, ClientModule.HitCharSndPitchMax)
local HitCharSndVolume = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitCharSndVolume, ClientModule.HitCharSndVolume)
local BloodWoundEnabled = ClientModule.BloodWoundEnabled
local BloodWoundTexture = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BloodWoundTexture, ClientModule.BloodWoundTexture)
local BloodWoundSize = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BloodWoundSize, ClientModule.BloodWoundSize)
local BloodWoundTextureColor = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BloodWoundTextureColor, ClientModule.BloodWoundTextureColor)
local BloodWoundPartColor = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BloodWoundPartColor, ClientModule.BloodWoundPartColor)
local BloodWoundVisibleTime = ClientModule.BloodWoundVisibleTime
local BloodWoundFadeTime = ClientModule.BloodWoundFadeTime
if IsMelee then
BloodEnabled = ClientModule.MeleeBloodEnabled
HitCharSndIDs = ClientModule.MeleeHitCharSndIDs
HitCharSndPitchMin = ClientModule.MeleeHitCharSndPitchMin
HitCharSndPitchMax = ClientModule.MeleeHitCharSndPitchMax
HitCharSndVolume = ClientModule.MeleeHitCharSndVolume
BloodWoundEnabled = ClientModule.MeleeBloodWoundEnabled
BloodWoundTexture = ClientModule.MeleeBloodWoundTexture
BloodWoundSize = ClientModule.MeleeBloodWoundSize
BloodWoundTextureColor = ClientModule.MeleeBloodWoundTextureColor
BloodWoundPartColor = ClientModule.MeleeBloodWoundVisibleTime
BloodWoundVisibleTime = ClientModule.MeleeBloodWoundFadeTime
BloodWoundFadeTime = ClientModule.MeleeBloodWoundPartColor
end
if BloodEnabled then
local Attachment = Instance.new("Attachment")
Attachment.CFrame = SurfaceCF
Attachment.Parent = Workspace.Terrain
local Sound = Instance.new("Sound")
Sound.SoundId = "rbxassetid://"..HitCharSndIDs[math.random(1, #HitCharSndIDs)]
Sound.PlaybackSpeed = Random.new():NextNumber(HitCharSndPitchMin, HitCharSndPitchMax)
Sound.Volume = HitCharSndVolume
Sound.Parent = Attachment
for i, v in pairs(Misc.BloodEffectFolder:GetChildren()) do
if v.ClassName == "ParticleEmitter" then
local Count = 1
local Particle = v:Clone()
Particle.Parent = Attachment
if Particle:FindFirstChild("EmitCount") then
Count = Particle.EmitCount.Value
end
Thread:Delay(0.01, function()
EmitParticle(Particle, Count)
Debris:AddItem(Particle, Particle.Lifetime.Max)
end)
end
end
Sound:Play()
Debris:AddItem(Attachment, 10)
if BloodWoundEnabled then
local Hole = Instance.new("Attachment")
Hole.Parent = ParentToPart and Hit or Workspace.Terrain
Hole.WorldCFrame = SurfaceCF * CFrame.Angles(math.rad(90), math.rad(180), 0)
if ParentToPart then
local A0 = Instance.new("Attachment")
local A1 = Instance.new("Attachment")
local BeamClone = Beam:Clone()
BeamClone.Width0 = BloodWoundSize
BeamClone.Width1 = BloodWoundSize
BeamClone.Texture = "rbxassetid://"..BloodWoundTexture[math.random(1, #BloodWoundTexture)]
BeamClone.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, BloodWoundTextureColor), ColorSequenceKeypoint.new(1, BloodWoundTextureColor)})
if BloodWoundPartColor then
local HitPartColor = Hit and Hit.Color or Color3.fromRGB(255, 255, 255)
if Hit and Hit:IsA("Terrain") then
HitPartColor = Workspace.Terrain:GetMaterialColor(Material or Enum.Material.Sand)
end
BeamClone.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, HitPartColor), ColorSequenceKeypoint.new(1, HitPartColor)})
end
BeamClone.Attachment0 = A0
BeamClone.Attachment1 = A1
A0.Parent = Hit
A1.Parent = Hit
A0.WorldCFrame = Hole.WorldCFrame * CFrame.new(BloodWoundSize / 2, -0.01, 0) * CFrame.Angles(math.rad(90), 0, 0)
A1.WorldCFrame = Hole.WorldCFrame * CFrame.new(-BloodWoundSize / 2, -0.01, 0) * CFrame.Angles(math.rad(90), math.rad(180), 0)
BeamClone.Parent = Workspace.Terrain
Thread:Delay(BloodWoundVisibleTime, function()
FadeBeam(A0, A1, BeamClone, Hole, BloodWoundFadeTime, Replicate)
end)
else
Debris:AddItem(Hole, 5)
end
end
end
end
local function OnRayFinalHit(Cast, Origin, Direction, RaycastResult, SegmentVelocity, CosmeticBulletObject)
local EndPos = RaycastResult and RaycastResult.Position or Cast.UserData.SegmentOrigin
local ShowEffects = CanShowEffects(EndPos)
if not AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosiveEnabled, Cast.UserData.ClientModule.ExplosiveEnabled) then
if not RaycastResult then
return
end
if RaycastResult.Instance and RaycastResult.Instance.Parent then
if RaycastResult.Instance.Name == "_glass" and AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.CanBreakGlass, Cast.UserData.ClientModule.CanBreakGlass) then
if Cast.UserData.Replicate then
ShatterGlass:FireServer(RaycastResult.Instance, RaycastResult.Position, Direction)
end
else
if Cast.UserData.ClientModule.BlacklistParts[RaycastResult.Instance.Name] then
if ShowEffects then
MakeImpactFX(RaycastResult.Instance, RaycastResult.Position, RaycastResult.Normal, RaycastResult.Material, true, Cast.UserData.ClientModule, Cast.UserData.Misc, Cast.UserData.Replicate)
end
else
local Distance = (RaycastResult.Position - Origin).Magnitude
local Target = RaycastResult.Instance:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
local TargetTorso = Target and (Target:FindFirstChild("HumanoidRootPart") or Target:FindFirstChild("Head"))
if TargetHumanoid and TargetHumanoid.Health > 0 and TargetTorso then
if ShowEffects then
MakeBloodFX(RaycastResult.Instance, RaycastResult.Position, RaycastResult.Normal, RaycastResult.Material, true, Cast.UserData.ClientModule, Cast.UserData.Misc, Cast.UserData.Replicate)
end
if Cast.UserData.Replicate then
if TargetHumanoid.Health > 0 then
Thread:Spawn(function()
InflictTarget:InvokeServer("Gun", Cast.UserData.Tool, Cast.UserData.ClientModule, TargetHumanoid, TargetTorso, RaycastResult.Instance, RaycastResult.Instance.Size, Cast.UserData.Misc, Distance)
end)
if Cast.UserData.Tool and Cast.UserData.Tool.GunClient:FindFirstChild("MarkerEvent") then
Cast.UserData.Tool.GunClient.MarkerEvent:Fire(Cast.UserData.ClientModule, RaycastResult.Instance.Name == "Head" and Cast.UserData.ClientModule.HeadshotHitmarker)
end
end
end
else
if ShowEffects then
MakeImpactFX(RaycastResult.Instance, RaycastResult.Position, RaycastResult.Normal, RaycastResult.Material, true, Cast.UserData.ClientModule, Cast.UserData.Misc, Cast.UserData.Replicate)
end
end
end
end
end
else
if Cast.UserData.ClientModule.ExplosionSoundEnabled then
local SoundTable = AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosionSoundIDs, Cast.UserData.ClientModule.ExplosionSoundIDs)
local Attachment = Instance.new("Attachment")
Attachment.CFrame = CFrame.new(EndPos)
Attachment.Parent = Workspace.Terrain
local Sound = Instance.new("Sound")
Sound.SoundId = "rbxassetid://"..SoundTable[math.random(1, #SoundTable)]
Sound.PlaybackSpeed = Random.new():NextNumber(AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosionSoundPitchMin, Cast.UserData.ClientModule.ExplosionSoundPitchMin), AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosionSoundPitchMax, Cast.UserData.ClientModule.ExplosionSoundPitchMax))
Sound.Volume = AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosionSoundVolume, Cast.UserData.ClientModule.ExplosionSoundVolume)
Sound.Parent = Attachment
Sound:Play()
Debris:AddItem(Attachment, 10)
end
local Explosion = Instance.new("Explosion")
Explosion.BlastRadius = AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosionRadius, Cast.UserData.ClientModule.ExplosionRadius)
Explosion.BlastPressure = 0
Explosion.ExplosionType = Enum.ExplosionType.NoCraters
Explosion.Position = EndPos
Explosion.Parent = Camera
local SurfaceCF = RaycastResult and CFrame.new(RaycastResult.Position, RaycastResult.Position + RaycastResult.Normal) or CFrame.new(Cast.UserData.SegmentOrigin, Cast.UserData.SegmentOrigin + Cast.UserData.SegmentDirection)
if ShowEffects and RaycastResult then
if AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosionCraterEnabled, Cast.UserData.ClientModule.ExplosionCraterEnabled) then
if RaycastResult.Instance and RaycastResult.Instance.Parent then
local Target = RaycastResult.Instance:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
if not TargetHumanoid then
local ParentToPart = true
local Hole = Instance.new("Attachment")
Hole.Parent = ParentToPart and RaycastResult.Instance or Workspace.Terrain
Hole.WorldCFrame = SurfaceCF * CFrame.Angles(math.rad(90), math.rad(180), 0)
if ParentToPart then
local Scale = AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosionCraterSize, Cast.UserData.ClientModule.ExplosionCraterSize)
local Texture = AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosionCraterTexture, Cast.UserData.ClientModule.ExplosionCraterTexture)
local A0 = Instance.new("Attachment")
local A1 = Instance.new("Attachment")
local BeamClone = Beam:Clone()
BeamClone.Width0 = Scale
BeamClone.Width1 = Scale
BeamClone.Texture = "rbxassetid://"..Texture[math.random(1,#Texture)]
if AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosionCraterPartColor, Cast.UserData.ClientModule.ExplosionCraterPartColor) then
local HitPartColor = RaycastResult.Instance and RaycastResult.Instance.Color or Color3.fromRGB(255, 255, 255)
if RaycastResult.Instance and RaycastResult.Instance:IsA("Terrain") then
HitPartColor = Workspace.Terrain:GetMaterialColor(RaycastResult.Material or Enum.Material.Sand)
end
BeamClone.Color = ColorSequence.new({ColorSequenceKeypoint.new(0, HitPartColor), ColorSequenceKeypoint.new(1, HitPartColor)})
end
BeamClone.Attachment0 = A0
BeamClone.Attachment1 = A1
A0.Parent = RaycastResult.Instance
A1.Parent = RaycastResult.Instance
A0.WorldCFrame = Hole.WorldCFrame * CFrame.new(Scale / 2, -0.01, 0) * CFrame.Angles(math.rad(90), 0, 0)
A1.WorldCFrame = Hole.WorldCFrame * CFrame.new(-Scale / 2, -0.01, 0) * CFrame.Angles(math.rad(90), math.rad(180), 0)
BeamClone.Parent = Workspace.Terrain
local VisibleTime = AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosionCraterVisibleTime, Cast.UserData.ClientModule.ExplosionCraterVisibleTime)
local FadeTime = AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosionCraterFadeTime, Cast.UserData.ClientModule.ExplosionCraterFadeTime)
Thread:Delay(VisibleTime, function()
FadeBeam(A0, A1, BeamClone, Hole, FadeTime, Cast.UserData.Replicate)
end)
else
Debris:AddItem(Hole, 5)
end
end
end
end
end
if Cast.UserData.ClientModule.CustomExplosion then
Explosion.Visible = false
if ShowEffects then
local Attachment = Instance.new("Attachment")
Attachment.CFrame = SurfaceCF
Attachment.Parent = Workspace.Terrain
for i, v in pairs(Cast.UserData.Misc.ExplosionEffectFolder:GetChildren()) do
if v.ClassName == "ParticleEmitter" then
local Count = 1
local Particle = v:Clone()
Particle.Parent = Attachment
if Particle:FindFirstChild("EmitCount") then
Count = Particle.EmitCount.Value
end
Thread:Delay(0.01, function()
EmitParticle(Particle, Count)
Debris:AddItem(Particle, Particle.Lifetime.Max)
end)
end
end
Debris:AddItem(Attachment, 10)
end
end
local HitHumanoids = {}
Explosion.Hit:Connect(function(HitPart, HitDist)
if HitPart and Cast.UserData.Replicate then
if HitPart.Parent and HitPart.Name == "HumanoidRootPart" or HitPart.Name == "Head" then
local Target = HitPart:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
local TargetTorso = Target and (Target:FindFirstChild("HumanoidRootPart") or Target:FindFirstChild("Head"))
if TargetHumanoid and TargetTorso then
if TargetHumanoid.Health > 0 then
if not HitHumanoids[TargetHumanoid] then
if Cast.UserData.ClientModule.ExplosionKnockback then
local Multipler = AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosionKnockbackMultiplierOnTarget, Cast.UserData.ClientModule.ExplosionKnockbackMultiplierOnTarget)
local DistanceFactor = HitDist / AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosionRadius, Cast.UserData.ClientModule.ExplosionRadius)
DistanceFactor = 1 - DistanceFactor
local VelocityMod = (TargetTorso.Position - Explosion.Position).Unit * AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosionKnockbackPower, Cast.UserData.ClientModule.ExplosionKnockbackPower) --* DistanceFactor
local AirVelocity = TargetTorso.Velocity - Vector3.new(0, TargetTorso.Velocity.y, 0) + Vector3.new(VelocityMod.X, 0, VelocityMod.Z)
if DamageModule.CanDamage(Target, Cast.UserData.Character, Cast.UserData.ClientModule.FriendlyFire) then
local TorsoFly = Instance.new("BodyVelocity")
TorsoFly.MaxForce = Vector3.new(math.huge, 0, math.huge)
TorsoFly.Velocity = AirVelocity
TorsoFly.Parent = TargetTorso
TargetTorso.Velocity = TargetTorso.Velocity + Vector3.new(0, VelocityMod.Y * Multipler, 0)
Debris:AddItem(TorsoFly, 0.25)
else
if TargetHumanoid.Parent.Name == Player.Name then
Multipler = AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.ExplosionKnockbackMultiplierOnPlayer, Cast.UserData.ClientModule.ExplosionKnockbackMultiplierOnPlayer)
local TorsoFly = Instance.new("BodyVelocity")
TorsoFly.MaxForce = Vector3.new(math.huge, 0, math.huge)
TorsoFly.Velocity = AirVelocity
TorsoFly.Parent = TargetTorso
TargetTorso.Velocity = TargetTorso.Velocity + Vector3.new(0, VelocityMod.Y * Multipler, 0)
Debris:AddItem(TorsoFly, 0.25)
end
end
end
local Part = RaycastResult and RaycastResult.Instance or HitPart
Thread:Spawn(function()
InflictTarget:InvokeServer("Gun", Cast.UserData.Tool, Cast.UserData.ClientModule, TargetHumanoid, TargetTorso, Part, Part.Size, Cast.UserData.Misc, HitDist)
end)
if Cast.UserData.Tool and Cast.UserData.Tool.GunClient:FindFirstChild("MarkerEvent") then
Cast.UserData.Tool.GunClient.MarkerEvent:Fire(Cast.UserData.ClientModule, Part.Name == "Head" and Cast.UserData.ClientModule.HeadshotHitmarker)
end
HitHumanoids[TargetHumanoid] = true
end
end
end
elseif HitPart.Name == "_glass" and AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.CanBreakGlass, Cast.UserData.ClientModule.CanBreakGlass) then
ShatterGlass:FireServer(HitPart, HitPart.Position, Direction)
end
end
end)
end
end
local function OnRayHit(Cast, Origin, Direction, RaycastResult, SegmentVelocity, CosmeticBulletObject)
local CanBounce = Cast.UserData.CastBehavior.Hitscan and true or false
local CurrentPosition = Cast:GetPosition()
local CurrentVelocity = Cast:GetVelocity()
local Acceleration = Cast.UserData.CastBehavior.Acceleration
if not Cast.UserData.CastBehavior.Hitscan then
Cast.UserData.SpinData.InitalTick = os.clock()
Cast.UserData.SpinData.InitalAngularVelocity = RaycastResult.Normal:Cross(CurrentVelocity) / 0.2
Cast.UserData.SpinData.InitalRotation = (Cast.RayInfo.CurrentCFrame - Cast.RayInfo.CurrentCFrame.p)
Cast.UserData.SpinData.ProjectileOffset = 0.2 * RaycastResult.Normal
if CurrentVelocity.Magnitude > 0 then
local NormalizeBounce = false
local Position = Cast.RayInfo.RaycastHitbox and CurrentPosition or RaycastResult.Position
if Cast.UserData.BounceData.BounceBetweenHumanoids then
local Target = RaycastResult.Instance:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
local TargetTorso = Target and (Target:FindFirstChild("HumanoidRootPart") or Target:FindFirstChild("Head"))
if TargetHumanoid and TargetHumanoid.Health > 0 and TargetTorso then
if not table.find(Cast.UserData.BounceData.BouncedHumanoids, TargetHumanoid) then
table.insert(Cast.UserData.BounceData.BouncedHumanoids, TargetHumanoid)
end
end
local TrackedEntity, TrackedHumanoid, TrackedTorso = FindNearestEntity(Cast, Position)
if TrackedEntity and TrackedHumanoid and TrackedTorso and TrackedHumanoid.Health > 0 then
local DesiredVector = (TrackedTorso.Position - Position).Unit
if Cast.UserData.BounceData.PredictDirection then
local Pos, Vel = DirectionPredictor(Position, TrackedTorso.Position, Vector3.new(), TrackedTorso.Velocity, Acceleration, (2 * TrackedTorso.Velocity) / 3, SegmentVelocity.Magnitude)
if Pos and Vel then
DesiredVector = Vel.Unit
end
end
Cast:SetVelocity(DesiredVector * SegmentVelocity.Magnitude)
Cast:SetPosition(Position)
else
NormalizeBounce = true
end
else
NormalizeBounce = true
end
if NormalizeBounce then
local Delta = Position - CurrentPosition
local Fix = 1 - 0.001 / Delta.Magnitude
Fix = Fix < 0 and 0 or Fix
Cast:AddPosition(Fix * Delta + 0.05 * RaycastResult.Normal)
local NewNormal = RaycastResult.Normal
local NewVelocity = CurrentVelocity
if Cast.UserData.BounceData.IgnoreSlope and (Acceleration ~= Vector3.new(0, 0, 0) and Acceleration.Y < 0) then
local NewPosition = Cast:GetPosition()
NewVelocity = Vector3.new(CurrentVelocity.X, -Cast.UserData.BounceData.BounceHeight, CurrentVelocity.Z)
local Instance2, Position2, Normal2, Material2 = CastWithBlacklist(Cast, NewPosition, Vector3.new(0, 1, 0), Cast.UserData.IgnoreList, true)
if Instance2 then
NewVelocity = Vector3.new(CurrentVelocity.X, Cast.UserData.BounceData.BounceHeight, CurrentVelocity.Z)
end
local X = math.deg(math.asin(RaycastResult.Normal.X))
local Z = math.deg(math.asin(RaycastResult.Normal.Z))
local FloorAngle = math.floor(math.max(X == 0 and Z or X, X == 0 and -Z or -X))
NewNormal = FloorAngle > 0 and (FloorAngle >= Cast.UserData.BounceData.SlopeAngle and RaycastResult.Normal or Vector3.new(0, RaycastResult.Normal.Y, 0)) or RaycastResult.Normal
end
local NormalVelocity = Vector3.new().Dot(NewNormal, NewVelocity) * NewNormal
local TanVelocity = NewVelocity - NormalVelocity
local GeometricDeceleration
local D1 = -Vector3.new().Dot(NewNormal, Acceleration)
local D2 = -(1 + Cast.UserData.BounceData.BounceElasticity) * Vector3.new().Dot(NewNormal, NewVelocity)
GeometricDeceleration = 1 - Cast.UserData.BounceData.FrictionConstant * (10 * (D1 < 0 and 0 or D1) * Cast.StateInfo.Delta + (D2 < 0 and 0 or D2)) / TanVelocity.Magnitude
Cast:SetVelocity((GeometricDeceleration < 0 and 0 or GeometricDeceleration) * TanVelocity - Cast.UserData.BounceData.BounceElasticity * NormalVelocity)
end
CanBounce = true
end
else
local NormalizeBounce = false
if Cast.UserData.BounceData.BounceBetweenHumanoids then
local Target = RaycastResult.Instance:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
local TargetTorso = Target and (Target:FindFirstChild("HumanoidRootPart") or Target:FindFirstChild("Head"))
if TargetHumanoid and TargetHumanoid.Health > 0 and TargetTorso then
if not table.find(Cast.UserData.BounceData.BouncedHumanoids, TargetHumanoid) then
table.insert(Cast.UserData.BounceData.BouncedHumanoids, TargetHumanoid)
end
end
local TrackedEntity, TrackedHumanoid, TrackedTorso = FindNearestEntity(Cast, RaycastResult.Position)
if TrackedEntity and TrackedHumanoid and TrackedTorso and TrackedHumanoid.Health > 0 then
local DesiredVector = (TrackedTorso.Position - RaycastResult.Position).Unit
Cast.RayInfo.ModifiedDirection = DesiredVector
else
NormalizeBounce = true
end
else
NormalizeBounce = true
end
if NormalizeBounce then
local CurrentDirection = Cast.RayInfo.ModifiedDirection
local NewDirection = CurrentDirection - (2 * CurrentDirection:Dot(RaycastResult.Normal) * RaycastResult.Normal)
Cast.RayInfo.ModifiedDirection = NewDirection
end
end
if CanBounce then
if Cast.UserData.BounceData.CurrentBounces > 0 then
Cast.UserData.BounceData.CurrentBounces -= 1
local ShowEffects = CanShowEffects(RaycastResult.Position)
if Cast.UserData.BounceData.NoExplosionWhileBouncing then
if RaycastResult.Instance.Name == "_glass" and AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.CanBreakGlass, Cast.UserData.ClientModule.CanBreakGlass) then
if Cast.UserData.Replicate then
ShatterGlass:FireServer(RaycastResult.Instance, RaycastResult.Position, SegmentVelocity.Unit)
end
else
if Cast.UserData.ClientModule.BlacklistParts[RaycastResult.Instance.Name] then
if ShowEffects then
MakeImpactFX(RaycastResult.Instance, RaycastResult.Position, RaycastResult.Normal, RaycastResult.Material, true, Cast.UserData.ClientModule, Cast.UserData.Misc, Cast.UserData.Replicate)
end
else
local Target = RaycastResult.Instance:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
local Distance = (RaycastResult.Position - Origin).Magnitude
local TargetTorso = Target and (Target:FindFirstChild("HumanoidRootPart") or Target:FindFirstChild("Head"))
if TargetHumanoid and TargetHumanoid.Health > 0 and TargetTorso then
if ShowEffects then
MakeBloodFX(RaycastResult.Instance, RaycastResult.Position, RaycastResult.Normal, RaycastResult.Material, true, Cast.UserData.ClientModule, Cast.UserData.Misc, Cast.UserData.Replicate)
end
if Cast.UserData.Replicate then
if TargetHumanoid.Health > 0 then
Thread:Spawn(function()
InflictTarget:InvokeServer("Gun", Cast.UserData.Tool, Cast.UserData.ClientModule, TargetHumanoid, TargetTorso, RaycastResult.Instance, RaycastResult.Instance.Size, Cast.UserData.Misc, Distance)
end)
if Cast.UserData.Tool and Cast.UserData.Tool.GunClient:FindFirstChild("MarkerEvent") then
Cast.UserData.Tool.GunClient.MarkerEvent:Fire(Cast.UserData.ClientModule, RaycastResult.Instance.Name == "Head" and Cast.UserData.ClientModule.HeadshotHitmarker)
end
end
end
else
if ShowEffects then
MakeImpactFX(RaycastResult.Instance, RaycastResult.Position, RaycastResult.Normal, RaycastResult.Material, true, Cast.UserData.ClientModule, Cast.UserData.Misc, Cast.UserData.Replicate)
end
end
end
end
else
OnRayFinalHit(Cast, Origin, Direction, RaycastResult, SegmentVelocity, CosmeticBulletObject)
end
end
end
end
local function CanRayHit(Cast, Origin, Direction, RaycastResult, SegmentVelocity, CosmeticBulletObject)
if Cast.UserData.ClientModule.BlacklistParts[RaycastResult.Instance.Name] then
if Cast.UserData.BounceData.StopBouncingOn == "Object" then
return false
end
else
local Target = RaycastResult.Instance:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
local TargetTorso = Target and (Target:FindFirstChild("HumanoidRootPart") or Target:FindFirstChild("Head"))
if TargetHumanoid and TargetHumanoid.Health > 0 and TargetTorso then
if Cast.UserData.BounceData.StopBouncingOn == "Humanoid" then
return false
end
else
if Cast.UserData.BounceData.StopBouncingOn == "Object" then
return false
end
end
end
if not Cast.UserData.CastBehavior.Hitscan and Cast.UserData.BounceData.SuperRicochet then
return true
else
if Cast.UserData.BounceData.CurrentBounces > 0 then
return true
end
end
return false
end
local function OnRayExited(Cast, Origin, Direction, RaycastResult, SegmentVelocity, CosmeticBulletObject)
if not RayExit then
return
end
if Cast.UserData.PenetrationData then
if Cast.UserData.ClientModule.PenetrationType == "WallPenetration" then
local ShowEffects = CanShowEffects(RaycastResult.Position)
if RaycastResult.Instance and RaycastResult.Instance.Parent then
if RaycastResult.Instance.Name == "_glass" and AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.CanBreakGlass, Cast.UserData.ClientModule.CanBreakGlass) then
return
else
if Cast.UserData.ClientModule.BlacklistParts[RaycastResult.Instance.Name] then
if ShowEffects then
MakeImpactFX(RaycastResult.Instance, RaycastResult.Position, RaycastResult.Normal, RaycastResult.Material, true, Cast.UserData.ClientModule, Cast.UserData.Misc, Cast.UserData.Replicate)
end
else
local Target = RaycastResult.Instance:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
local TargetTorso = Target and (Target:FindFirstChild("HumanoidRootPart") or Target:FindFirstChild("Head"))
if TargetHumanoid and TargetHumanoid.Health > 0 and TargetTorso then
if ShowEffects then
MakeBloodFX(RaycastResult.Instance, RaycastResult.Position, RaycastResult.Normal, RaycastResult.Material, true, Cast.UserData.ClientModule, Cast.UserData.Misc, Cast.UserData.Replicate)
end
else
if ShowEffects then
MakeImpactFX(RaycastResult.Instance, RaycastResult.Position, RaycastResult.Normal, RaycastResult.Material, true, Cast.UserData.ClientModule, Cast.UserData.Misc, Cast.UserData.Replicate)
end
end
end
end
end
end
end
if RaycastResult.Instance and RaycastResult.Instance.Parent then
local vis = Cast:DbgVisualizeHit(CFrame.new(RaycastResult.Position), true)
if (vis ~= nil) then vis.Color3 = Color3.fromRGB(13, 105, 172) end
end
end
local function CanRayPenetrate(Cast, Origin, Direction, RaycastResult, SegmentVelocity, CosmeticBulletObject)
local ShowEffects = CanShowEffects(RaycastResult.Position)
if RaycastResult.Instance and RaycastResult.Instance.Parent then
if Cast.UserData.ClientModule.IgnoreBlacklistedParts and Cast.UserData.ClientModule.BlacklistParts[RaycastResult.Instance.Name] then
return true
else
local Target = RaycastResult.Instance:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
local TargetTool = RaycastResult.Instance:FindFirstAncestorOfClass("Tool")
if (RaycastResult.Instance.Transparency > 0.75
or RaycastResult.Instance.Name == "Missile"
or RaycastResult.Instance.Name == "Handle"
or RaycastResult.Instance.Name == "Effect"
or RaycastResult.Instance.Name == "Bullet"
or RaycastResult.Instance.Name == "Laser"
or string.lower(RaycastResult.Instance.Name) == "water"
or RaycastResult.Instance.Name == "Rail"
or RaycastResult.Instance.Name == "Arrow"
or (TargetHumanoid and (TargetHumanoid.Health <= 0 or not DamageModule.CanDamage(Target, Cast.UserData.Character, Cast.UserData.ClientModule.FriendlyFire) or (Cast.UserData.PenetrationData and table.find(Cast.UserData.PenetrationData.HitHumanoids, TargetHumanoid)) or (Cast.UserData.BounceData and table.find(Cast.UserData.BounceData.BouncedHumanoids, TargetHumanoid))))
or TargetTool) then
return true
else
if Cast.UserData.PenetrationData then
if Cast.UserData.ClientModule.PenetrationType == "WallPenetration" then
if Cast.UserData.PenetrationData.PenetrationDepth <= 0 then
return false
end
elseif Cast.UserData.ClientModule.PenetrationType == "HumanoidPenetration" then
if Cast.UserData.PenetrationData.PenetrationAmount <= 0 then
return false
end
end
local MaxExtent = RaycastResult.Instance.Size.Magnitude * Direction
local ExitHit, ExitPoint, ExitNormal, ExitMaterial = Workspace:FindPartOnRayWithWhitelist(Ray.new(RaycastResult.Position + MaxExtent, -MaxExtent), {RaycastResult.Instance}, Cast.RayInfo.Parameters.IgnoreWater)
local Dist = (ExitPoint - RaycastResult.Position).Magnitude
if RaycastResult.Instance.Name == "_glass" and AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.CanBreakGlass, Cast.UserData.ClientModule.CanBreakGlass) then
if Cast.UserData.Replicate then
ShatterGlass:FireServer(RaycastResult.Instance, RaycastResult.Position, SegmentVelocity.Unit)
end
if Cast.UserData.ClientModule.PenetrationType == "WallPenetration" then
local ToReduce = 1 - ((Dist / Cast.UserData.PenetrationData.PenetrationDepth / 1.1))
Cast.UserData.PenetrationData.PenetrationDepth *= ToReduce
return true
end
else
if Cast.UserData.ClientModule.BlacklistParts[RaycastResult.Instance.Name] then
if Cast.UserData.ClientModule.PenetrationType == "WallPenetration" then
if ShowEffects then
MakeImpactFX(RaycastResult.Instance, RaycastResult.Position, RaycastResult.Normal, RaycastResult.Material, true, Cast.UserData.ClientModule, Cast.UserData.Misc, Cast.UserData.Replicate)
end
local ToReduce = 1 - ((Dist / Cast.UserData.PenetrationData.PenetrationDepth / 1.1))
Cast.UserData.PenetrationData.PenetrationDepth *= ToReduce
if ExitHit then
OnRayExited(Cast, RaycastResult.Position + MaxExtent, -MaxExtent, {Instance = ExitHit, Position = ExitPoint, Normal = ExitNormal, Material = ExitMaterial}, SegmentVelocity, CosmeticBulletObject)
end
return true
end
else
local Distance = (RaycastResult.Position - Origin).Magnitude
local TargetTorso = Target and (Target:FindFirstChild("HumanoidRootPart") or Target:FindFirstChild("Head"))
if TargetHumanoid and TargetHumanoid.Health > 0 and TargetTorso then
if not table.find( Cast.UserData.PenetrationData.HitHumanoids, TargetHumanoid) then
table.insert(Cast.UserData.PenetrationData.HitHumanoids, TargetHumanoid)
if ShowEffects then
MakeBloodFX(RaycastResult.Instance, RaycastResult.Position, RaycastResult.Normal, RaycastResult.Material, true, Cast.UserData.ClientModule, Cast.UserData.Misc, Cast.UserData.Replicate)
end
if Cast.UserData.Replicate then
if TargetHumanoid.Health > 0 then
Thread:Spawn(function()
InflictTarget:InvokeServer("Gun", Cast.UserData.Tool, Cast.UserData.ClientModule, TargetHumanoid, TargetTorso, RaycastResult.Instance, RaycastResult.Instance.Size, Cast.UserData.Misc, Distance)
end)
if Cast.UserData.Tool and Cast.UserData.Tool.GunClient:FindFirstChild("MarkerEvent") then
Cast.UserData.Tool.GunClient.MarkerEvent:Fire(Cast.UserData.ClientModule, RaycastResult.Instance.Name == "Head" and Cast.UserData.ClientModule.HeadshotHitmarker)
end
end
end
if Cast.UserData.ClientModule.PenetrationType == "WallPenetration" then
local ToReduce = 1 - ((Dist / Cast.UserData.PenetrationData.PenetrationDepth / 1.1))
Cast.UserData.PenetrationData.PenetrationDepth *= ToReduce
if ExitHit then
OnRayExited(Cast, RaycastResult.Position + MaxExtent, -MaxExtent, {Instance = ExitHit, Position = ExitPoint, Normal = ExitNormal, Material = ExitMaterial}, SegmentVelocity, CosmeticBulletObject)
end
elseif Cast.UserData.ClientModule.PenetrationType == "HumanoidPenetration" then
Cast.UserData.PenetrationData.PenetrationAmount -= 1
end
if Cast.UserData.PenetrationData.PenetrationIgnoreDelay ~= math.huge then
Thread:Delay(Cast.UserData.PenetrationData.PenetrationIgnoreDelay, function()
local Index = table.find( Cast.UserData.PenetrationData.HitHumanoids, TargetHumanoid)
if Index then
table.remove(Cast.UserData.PenetrationData.HitHumanoids, Index)
end
end)
end
return true
end
else
if Cast.UserData.ClientModule.PenetrationType == "WallPenetration" then
if ShowEffects then
MakeImpactFX(RaycastResult.Instance, RaycastResult.Position, RaycastResult.Normal, RaycastResult.Material, true, Cast.UserData.ClientModule, Cast.UserData.Misc, Cast.UserData.Replicate)
end
local ToReduce = 1 - ((Dist / Cast.UserData.PenetrationData.PenetrationDepth / 1.1))
Cast.UserData.PenetrationData.PenetrationDepth *= ToReduce
if ExitHit then
OnRayExited(Cast, RaycastResult.Position + MaxExtent, -MaxExtent, {Instance = ExitHit, Position = ExitPoint, Normal = ExitNormal, Material = ExitMaterial}, SegmentVelocity, CosmeticBulletObject)
end
return true
end
end
end
end
end
end
end
end
return false
end
local function UpdateParticle(Cast, Position, LastPosition, W2)
if Cast.UserData.BulletParticleData.MotionBlur then
local T2 = os.clock()
local P2 = CFrame.new().pointToObjectSpace(Camera.CFrame, W2)
local V2
if Cast.UserData.BulletParticleData.T0 then
V2 = 2 / (T2 - Cast.UserData.BulletParticleData.T1) * (P2 - Cast.UserData.BulletParticleData.P1) - (P2 - Cast.UserData.BulletParticleData.P0) / (T2 - Cast.UserData.BulletParticleData.T0)
else
V2 = (P2 - Cast.UserData.BulletParticleData.P1) / (T2 - Cast.UserData.BulletParticleData.T1)
Cast.UserData.BulletParticleData.V1 = V2
end
Cast.UserData.BulletParticleData.T0, Cast.UserData.BulletParticleData.V0, Cast.UserData.BulletParticleData.P0 = Cast.UserData.BulletParticleData.T1, Cast.UserData.BulletParticleData.V1, Cast.UserData.BulletParticleData.P1
Cast.UserData.BulletParticleData.T1, Cast.UserData.BulletParticleData.V1, Cast.UserData.BulletParticleData.P1 = T2, V2, P2
local Dt = Cast.UserData.BulletParticleData.T1 - Cast.UserData.BulletParticleData.T0
local M0 = Cast.UserData.BulletParticleData.V0.Magnitude
local M1 = Cast.UserData.BulletParticleData.V1.Magnitude
Cast.UserData.BulletParticleData.Attachment0.Position = Camera.CFrame * Cast.UserData.BulletParticleData.P0
Cast.UserData.BulletParticleData.Attachment1.Position = Camera.CFrame * Cast.UserData.BulletParticleData.P1
if M0 > 1.0E-8 then
Cast.UserData.BulletParticleData.Attachment0.Axis = CFrame.new().vectorToWorldSpace(Camera.CFrame, Cast.UserData.BulletParticleData.V0 / M0)
end
if M1 > 1.0E-8 then
Cast.UserData.BulletParticleData.Attachment1.Axis = CFrame.new().vectorToWorldSpace(Camera.CFrame, Cast.UserData.BulletParticleData.V1 / M1)
end
local Dist0 = -Cast.UserData.BulletParticleData.P0.Z
local Dist1 = -Cast.UserData.BulletParticleData.P1.Z
if Dist0 < 0 then
Dist0 = 0
end
if Dist1 < 0 then
Dist1 = 0
end
local W0 = Cast.UserData.BulletParticleData.BulletSize + Cast.UserData.BulletParticleData.BulletBloom * Dist0
local W1 = Cast.UserData.BulletParticleData.BulletSize + Cast.UserData.BulletParticleData.BulletBloom * Dist1
local L = ((Cast.UserData.BulletParticleData.P1 - Cast.UserData.BulletParticleData.P0) * Vector3.new(1, 1, 0)).Magnitude
local Tr = 1 - 4 * Cast.UserData.BulletParticleData.BulletSize * Cast.UserData.BulletParticleData.BulletSize / ((W0 + W1) * (2 * L + W0 + W1)) * Cast.UserData.BulletParticleData.BulletBrightness
for _, effect in next, Cast.UserData.BulletParticleData.Effects do
effect.CurveSize0 = Dt / 3 * M0
effect.CurveSize1 = Dt / 3 * M1
effect.Width0 = W0
effect.Width1 = W1
effect.Transparency = NumberSequence.new(Tr)
end
else
if (Position - LastPosition).Magnitude > 0 then
local Rotation = CFrame.new(LastPosition, Position) - LastPosition
local Offset = CFrame.Angles(0, math.pi / 2, 0)
Cast.UserData.BulletParticleData.Attachment0.CFrame = CFrame.new(Position) * Rotation * Offset
Cast.UserData.BulletParticleData.Attachment1.CFrame = CFrame.new(LastPosition, Position) * Offset
end
end
end
local function OnRayUpdated(Cast, LastSegmentOrigin, SegmentOrigin, SegmentDirection, Length, SegmentVelocity, CosmeticBulletObject)
Cast.UserData.LastSegmentOrigin = LastSegmentOrigin
Cast.UserData.SegmentOrigin = SegmentOrigin
Cast.UserData.SegmentDirection = SegmentDirection
Cast.UserData.SegmentVelocity = SegmentVelocity
local Tick = os.clock() - Cast.UserData.SpinData.InitalTick
if Cast.UserData.UpdateData.UpdateRayInExtra then
if Cast.UserData.UpdateData.ExtraRayUpdater then
Cast.UserData.UpdateData.ExtraRayUpdater(Cast, Cast.StateInfo.Delta)
end
end
if not Cast.UserData.CastBehavior.Hitscan and Cast.UserData.HomeData.Homing then
local CurrentPosition = Cast:GetPosition()
local CurrentVelocity = Cast:GetVelocity()
if Cast.UserData.HomeData.LockOnOnHovering then
if Cast.UserData.HomeData.LockedEntity then
local TargetHumanoid = Cast.UserData.HomeData.LockedEntity:FindFirstChildOfClass("Humanoid")
if TargetHumanoid and TargetHumanoid.Health > 0 then
local TargetTorso = Cast.UserData.HomeData.LockedEntity:FindFirstChild("HumanoidRootPart") or Cast.UserData.HomeData.LockedEntity:FindFirstChild("Torso") or Cast.UserData.HomeData.LockedEntity:FindFirstChild("UpperTorso")
local DesiredVector = (TargetTorso.Position - CurrentPosition).Unit
local CurrentVector = CurrentVelocity.Unit
local AngularDifference = math.acos(DesiredVector:Dot(CurrentVector))
if AngularDifference > 0 then
local OrthoVector = CurrentVector:Cross(DesiredVector).Unit
local AngularCorrection = math.min(AngularDifference, Cast.StateInfo.Delta * Cast.UserData.HomeData.TurnRatePerSecond)
Cast:SetVelocity(CFrame.fromAxisAngle(OrthoVector, AngularCorrection):vectorToWorldSpace(CurrentVelocity))
end
end
end
else
local TargetEntity, TargetHumanoid, TargetTorso = FindNearestEntity(Cast, CurrentPosition)
if TargetEntity and TargetHumanoid and TargetTorso and TargetHumanoid.Health > 0 then
local DesiredVector = (TargetTorso.Position - CurrentPosition).Unit
local CurrentVector = CurrentVelocity.Unit
local AngularDifference = math.acos(DesiredVector:Dot(CurrentVector))
if AngularDifference > 0 then
local OrthoVector = CurrentVector:Cross(DesiredVector).Unit
local AngularCorrection = math.min(AngularDifference, Cast.StateInfo.Delta * Cast.UserData.HomeData.TurnRatePerSecond)
Cast:SetVelocity(CFrame.fromAxisAngle(OrthoVector, AngularCorrection):vectorToWorldSpace(CurrentVelocity))
end
end
end
end
local TravelCFrame
if Cast.UserData.SpinData.CanSpinPart then
if not Cast.UserData.CastBehavior.Hitscan then
local Position = (SegmentOrigin + Cast.UserData.SpinData.ProjectileOffset)
if Cast.UserData.BounceData.SuperRicochet then
TravelCFrame = CFrame.new(Position, Position + SegmentVelocity) * Math.FromAxisAngle(Tick * Cast.UserData.SpinData.InitalAngularVelocity) * Cast.UserData.SpinData.InitalRotation
else
if Cast.UserData.BounceData.CurrentBounces > 0 then
TravelCFrame = CFrame.new(Position, Position + SegmentVelocity) * Math.FromAxisAngle(Tick * Cast.UserData.SpinData.InitalAngularVelocity) * Cast.UserData.SpinData.InitalRotation
else
TravelCFrame = CFrame.new(SegmentOrigin, SegmentOrigin + SegmentVelocity) * CFrame.Angles(math.rad(-360 * ((os.clock() - Cast.UserData.ShootId / 4) * Cast.UserData.SpinData.SpinX - math.floor((os.clock() - Cast.UserData.ShootId / 4) * Cast.UserData.SpinData.SpinX))), math.rad(-360 * ((os.clock() - Cast.UserData.ShootId / 4) * Cast.UserData.SpinData.SpinY - math.floor((os.clock() - Cast.UserData.ShootId / 4) * Cast.UserData.SpinData.SpinY))), math.rad(-360 * ((os.clock() - Cast.UserData.ShootId / 4) * Cast.UserData.SpinData.SpinZ - math.floor((os.clock() - Cast.UserData.ShootId / 4) * Cast.UserData.SpinData.SpinZ))))
end
end
else
TravelCFrame = CFrame.new(SegmentOrigin, SegmentOrigin + SegmentVelocity) * CFrame.Angles(math.rad(-360 * ((os.clock() - Cast.UserData.ShootId / 4) * Cast.UserData.SpinData.SpinX - math.floor((os.clock() - Cast.UserData.ShootId / 4) * Cast.UserData.SpinData.SpinX))), math.rad(-360 * ((os.clock() - Cast.UserData.ShootId / 4) * Cast.UserData.SpinData.SpinY - math.floor((os.clock() - Cast.UserData.ShootId / 4) * Cast.UserData.SpinData.SpinY))), math.rad(-360 * ((os.clock() - Cast.UserData.ShootId / 4) * Cast.UserData.SpinData.SpinZ - math.floor((os.clock() - Cast.UserData.ShootId / 4) * Cast.UserData.SpinData.SpinZ))))
end
else
TravelCFrame = CFrame.new(SegmentOrigin, SegmentOrigin + SegmentVelocity)
end
Cast.RayInfo.CurrentCFrame = TravelCFrame
if Cast.UserData.BulletParticleData then
UpdateParticle(Cast, SegmentOrigin, Cast.UserData.LastPosition, SegmentOrigin)
end
if Cast.UserData.LaserData.LaserTrailEnabled then
if Cast.StateInfo.Delta > 0 then
local Width = Cast.UserData.LaserData.LaserTrailWidth
local Height = Cast.UserData.LaserData.LaserTrailHeight
local TrailSegment = Miscs[Cast.UserData.LaserData.LaserTrailShape.."Segment"]:Clone()
if Cast.UserData.LaserData.RandomizeLaserColorIn ~= "None" then
if Cast.UserData.LaserData.RandomizeLaserColorIn == "Whole" then
TrailSegment.Color = Cast.UserData.LaserData.RandomLaserColor
elseif Cast.UserData.LaserData.RandomizeLaserColorIn == "Segment" then
TrailSegment.Color = Color3.new(math.random(), math.random(), math.random())
end
else
TrailSegment.Color = Cast.UserData.LaserData.LaserTrailColor
end
TrailSegment.Material = Cast.UserData.LaserData.LaserTrailMaterial
TrailSegment.Reflectance = Cast.UserData.LaserData.LaserTrailReflectance
TrailSegment.Transparency = Cast.UserData.LaserData.LaserTrailTransparency
TrailSegment.Size = Cast.UserData.LaserData.LaserTrailShape == "Cone" and Vector3.new(Width, (SegmentOrigin - LastSegmentOrigin).Magnitude, Height) or Vector3.new((SegmentOrigin - LastSegmentOrigin).Magnitude, Height, Width)
TrailSegment.CFrame = CFrame.new((LastSegmentOrigin + SegmentOrigin) * 0.5, SegmentOrigin) * (Cast.UserData.LaserData.LaserTrailShape == "Cone" and CFrame.Angles(math.pi / 2, 0, 0) or CFrame.Angles(0, math.pi / 2, 0))
TrailSegment.Parent = Camera
table.insert(Cast.UserData.LaserData.LaserTrailContainer, TrailSegment)
if Cast.UserData.LaserData.UpdateLaserTrail then
Cast.UserData.LaserData.UpdateLaserTrail:Fire(Cast.UserData.LaserData.LaserTrailId, Cast.UserData.LaserData.LaserTrailContainer)
end
Thread:Delay(Cast.UserData.LaserData.LaserTrailVisibleTime, function()
if Cast.UserData.LaserData.LaserTrailFadeTime > 0 then
local DesiredSize = TrailSegment.Size * (Cast.UserData.LaserData.ScaleLaserTrail and Vector3.new(1, Cast.UserData.LaserData.LaserTrailScaleMultiplier, Cast.UserData.LaserData.LaserTrailScaleMultiplier) or Vector3.new(1, 1, 1))
local Tween = TweenService:Create(TrailSegment, TweenInfo.new(Cast.UserData.LaserData.LaserTrailFadeTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Transparency = 1, Size = DesiredSize})
Tween:Play()
Tween.Completed:Wait()
if TrailSegment then
local Index = table.find(Cast.UserData.LaserData.LaserTrailContainer, TrailSegment)
if Index then
table.remove(Cast.UserData.LaserData.LaserTrailContainer, Index)
if Cast.UserData.LaserData.UpdateLaserTrail then
Cast.UserData.LaserData.UpdateLaserTrail:Fire(Cast.UserData.LaserData.LaserTrailId, Cast.UserData.LaserData.LaserTrailContainer)
end
end
TrailSegment:Destroy()
end
else
if TrailSegment then
local Index = table.find(Cast.UserData.LaserData.LaserTrailContainer, TrailSegment)
if Index then
table.remove(Cast.UserData.LaserData.LaserTrailContainer, Index)
if Cast.UserData.LaserData.UpdateLaserTrail then
Cast.UserData.LaserData.UpdateLaserTrail:Fire(Cast.UserData.LaserData.LaserTrailId, Cast.UserData.LaserData.LaserTrailContainer)
end
end
TrailSegment:Destroy()
end
end
end)
end
end
if Cast.UserData.LightningData.LightningBoltEnabled then
if Cast.StateInfo.Delta > 0 then
local Wideness = Cast.UserData.LightningData.BoltWideness
local Width = Cast.UserData.LightningData.BoltWidth
local Height = Cast.UserData.LightningData.BoltHeight
for _, v in ipairs(Cast.UserData.LightningData.BoltCFrameTable) do
local Cache
if Cast.UserData.LightningData.BoltShape == "Block" then
Cache = BlockSegCache
elseif Cast.UserData.LightningData.BoltShape == "Cylinder" then
Cache = CylinderSegCache
elseif Cast.UserData.LightningData.BoltShape == "Cone" then
Cache = ConeSegCache
end
if Cache then
local Start = (CFrame.new(SegmentOrigin, SegmentOrigin + SegmentDirection) * v).p
local End = (CFrame.new(LastSegmentOrigin, LastSegmentOrigin + SegmentDirection) * v).p
local Distance = (End - Start).Magnitude
local Pos = Start
for i = 0, Distance, 10 do
local FakeDistance = CFrame.new(Start, End) * CFrame.new(0, 0, -i - 10) * CFrame.new(-2 + (math.random() * Wideness), -2 + (math.random() * Wideness), -2 + (math.random() * Wideness))
local BoltSegment = Cache:GetPart()
if Cast.UserData.LightningData.RandomizeBoltColorIn ~= "None" then
if Cast.UserData.LightningData.RandomizeBoltColorIn == "Whole" then
BoltSegment.Color = Cast.UserData.LightningData.RandomBoltColor
elseif Cast.UserData.LightningData.RandomizeBoltColorIn == "Segment" then
BoltSegment.Color = Color3.new(math.random(), math.random(), math.random())
end
else
BoltSegment.Color = Cast.UserData.LightningData.BoltColor
end
BoltSegment.Material = Cast.UserData.LightningData.BoltMaterial
BoltSegment.Reflectance = Cast.UserData.LightningData.BoltReflectance
BoltSegment.Transparency = Cast.UserData.LightningData.BoltTransparency
if i + 10 > Distance then
BoltSegment.CFrame = CFrame.new(Pos, End) * CFrame.new(0, 0, -(Pos - End).Magnitude / 2) * (Cast.UserData.LightningData.BoltShape == "Cone" and CFrame.Angles(math.pi / 2, 0, 0) or CFrame.Angles(0, math.pi / 2, 0))
else
BoltSegment.CFrame = CFrame.new(Pos, FakeDistance.p) * CFrame.new(0, 0, -(Pos - FakeDistance.p).Magnitude / 2) * (Cast.UserData.LightningData.BoltShape == "Cone" and CFrame.Angles(math.pi / 2, 0, 0) or CFrame.Angles(0, math.pi / 2, 0))
end
if i + 10 > Distance then
BoltSegment.Size = Cast.UserData.LightningData.BoltShape == "Cone" and Vector3.new(Width, (Pos - End).Magnitude, Height) or Vector3.new((Pos - End).Magnitude, Height, Width)
else
BoltSegment.Size = Cast.UserData.LightningData.BoltShape == "Cone" and Vector3.new(Width, (Pos - FakeDistance.p).Magnitude, Height) or Vector3.new((Pos - FakeDistance.p).Magnitude, Height, Width)
end
Thread:Delay(Cast.UserData.LightningData.BoltVisibleTime, function()
if Cast.UserData.LightningData.BoltFadeTime > 0 then
local DesiredSize = BoltSegment.Size * (Cast.UserData.LightningData.ScaleBolt and Vector3.new(1, Cast.UserData.LightningData.BoltScaleMultiplier, Cast.UserData.LightningData.BoltScaleMultiplier) or Vector3.new(1, 1, 1))
local Tween = TweenService:Create(BoltSegment, TweenInfo.new(Cast.UserData.LightningData.BoltFadeTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Transparency = 1, Size = DesiredSize})
Tween:Play()
Tween.Completed:Wait()
if BoltSegment ~= nil then
Cache:ReturnPart(BoltSegment)
end
else
if BoltSegment ~= nil then
Cache:ReturnPart(BoltSegment)
end
end
end)
Pos = FakeDistance.p
end
end
end
end
end
if not Cast.UserData.Replicate and Cast.UserData.ClientModule.WhizSoundEnabled then
if not Cast.UserData.Whizzed then
local Mag = (Camera.CFrame.p - SegmentOrigin).Magnitude --(Camera.CFrame.p - CosmeticBulletObject.Position).Magnitude
if Mag < Cast.UserData.ClientModule.WhizDistance then
local WhizSound = Instance.new("Sound")
WhizSound.SoundId = "rbxassetid://"..Cast.UserData.ClientModule.WhizSoundIDs[math.random(1, #Cast.UserData.ClientModule.WhizSoundIDs)]
WhizSound.Volume = Cast.UserData.ClientModule.WhizSoundVolume
WhizSound.PlaybackSpeed = Random.new():NextNumber(Cast.UserData.ClientModule.WhizSoundPitchMin, Cast.UserData.ClientModule.WhizSoundPitchMax)
WhizSound.Name = "WhizSound"
WhizSound.Parent = SoundService
WhizSound:Play()
Debris:AddItem(WhizSound, WhizSound.TimeLength / WhizSound.PlaybackSpeed)
Cast.UserData.Whizzed = true
end
end
end
Cast.UserData.LastPosition = SegmentOrigin
if CosmeticBulletObject == nil then
return
end
CosmeticBulletObject.CFrame = TravelCFrame
end
local function OnRayTerminated(Cast, RaycastResult, IsDecayed)
if Cast.UserData.LaserData.UpdateLaserTrail then
Cast.UserData.LaserData.UpdateLaserTrail:Fire(Cast.UserData.LaserData.LaserTrailId, Cast.UserData.LaserData.LaserTrailContainer, true)
end
if Cast.UserData.BulletParticleData then
Cast.UserData.BulletParticleData.Attachment0:Destroy()
Cast.UserData.BulletParticleData.Attachment1:Destroy()
for _, effect in next, Cast.UserData.BulletParticleData.Effects do
effect:Destroy()
end
end
local CosmeticBulletObject = Cast.RayInfo.CosmeticBulletObject
if CosmeticBulletObject ~= nil then
local CurrentPosition = Cast:GetPosition()
local CurrentVelocity = Cast:GetVelocity()
if IsDecayed then
if Cast.UserData.DebrisData.DecayProjectile then
if DebrisCounts <= MaxDebrisCounts then
DebrisCounts += 1
local DecayProjectile = CosmeticBulletObject:Clone()
DecayProjectile.Name = "DecayProjectile"
DecayProjectile.CFrame = CosmeticBulletObject.CFrame
DecayProjectile.Anchored = Cast.UserData.DebrisData.AnchorDecay
DecayProjectile.CanCollide = Cast.UserData.DebrisData.CollideDecay
if not DecayProjectile.Anchored then
if Cast.UserData.DebrisData.VelocityInfluence then
DecayProjectile.Velocity = DecayProjectile.CFrame.LookVector * CurrentVelocity.Magnitude
else
DecayProjectile.Velocity = DecayProjectile.CFrame.LookVector * Cast.UserData.DebrisData.DecayVelocity
end
end
for _, v in pairs(DecayProjectile:GetDescendants()) do
if ((v:IsA("PointLight") or v:IsA("SurfaceLight") or v:IsA("SpotLight")) and Cast.UserData.DebrisData.DisableDebrisContents.DisableTrail) then
v.Enabled = false
elseif (v:IsA("ParticleEmitter") and Cast.UserData.DebrisData.DisableDebrisContents.Particle) then
v.Enabled = false
elseif (v:IsA("Trail") and Cast.UserData.DebrisData.DisableDebrisContents.Trail) then
v.Enabled = false
elseif (v:IsA("Beam") and Cast.UserData.DebrisData.DisableDebrisContents.Beam) then
v.Enabled = false
elseif (v:IsA("Sound") and Cast.UserData.DebrisData.DisableDebrisContents.Sound) then
v:Stop()
end
end
DecayProjectile.Parent = Camera
Thread:Delay(5, function() --10
if DecayProjectile then
DecayProjectile:Destroy()
end
DebrisCounts -= 1
end)
end
end
else
if RaycastResult then
local HitPointObjectSpace = RaycastResult.Instance.CFrame:pointToObjectSpace(RaycastResult.Position)
if Cast.UserData.DebrisData.DebrisProjectile then
if DebrisCounts <= MaxDebrisCounts then
DebrisCounts += 1
local DebrisProjectile = CosmeticBulletObject:Clone()
DebrisProjectile.Name = "DebrisProjectile"
DebrisProjectile.CFrame = Cast.UserData.DebrisData.NormalizeDebris and CFrame.new(RaycastResult.Position, RaycastResult.Position + RaycastResult.Normal) or (RaycastResult.Instance.CFrame * CFrame.new(HitPointObjectSpace, HitPointObjectSpace + RaycastResult.Instance.CFrame:vectorToObjectSpace(Cast.UserData.SegmentVelocity.Unit))) --CosmeticBulletObject.CFrame
DebrisProjectile.Anchored = Cast.UserData.DebrisData.AnchorDebris
DebrisProjectile.CanCollide = Cast.UserData.DebrisData.CollideDebris
if not DebrisProjectile.Anchored and Cast.UserData.DebrisData.BounceDebris then
local Direction = DebrisProjectile.CFrame.LookVector
local Reflect = Direction - (2 * Direction:Dot(RaycastResult.Normal) * RaycastResult.Normal)
DebrisProjectile.Velocity = Reflect * (Cast.UserData.DebrisData.BounceVelocity * (CurrentVelocity.Magnitude / AddressTableValue(Cast.UserData.ClientModule.ChargedShotAdvanceEnabled, Cast.UserData.Misc.ChargeLevel, Cast.UserData.ClientModule.ChargeAlterTable.BulletSpeed, Cast.UserData.ClientModule.BulletSpeed)))
DebrisProjectile.CFrame = CFrame.new(DebrisProjectile.Position, DebrisProjectile.Position + DebrisProjectile.Velocity)
end
for _, v in pairs(DebrisProjectile:GetDescendants()) do
if ((v:IsA("PointLight") or v:IsA("SurfaceLight") or v:IsA("SpotLight")) and Cast.UserData.DebrisData.DisableDebrisContents.DisableTrail) then
v.Enabled = false
elseif (v:IsA("ParticleEmitter") and Cast.UserData.DebrisData.DisableDebrisContents.Particle) then
v.Enabled = false
elseif (v:IsA("Trail") and Cast.UserData.DebrisData.DisableDebrisContents.Trail) then
v.Enabled = false
elseif (v:IsA("Beam") and Cast.UserData.DebrisData.DisableDebrisContents.Beam) then
v.Enabled = false
elseif (v:IsA("Sound") and Cast.UserData.DebrisData.DisableDebrisContents.Sound) then
v:Stop()
end
end
DebrisProjectile.Parent = Camera
Thread:Delay(5, function() --10
if DebrisProjectile then
DebrisProjectile:Destroy()
end
DebrisCounts -= 1
end)
end
end
end
end
CosmeticBulletObject.Transparency = 1
for _, v in pairs(CosmeticBulletObject:GetDescendants()) do
if v:IsA("ParticleEmitter") or v:IsA("PointLight") or v:IsA("SurfaceLight") or v:IsA("SpotLight") or v:IsA("Trail") or v:IsA("Beam") or v:IsA("BillboardGui") or v:IsA("SurfaceGui") then
v.Enabled = false
elseif v:IsA("Sound") then
v:Stop()
elseif v:IsA("Decal") or v:IsA("Texture") or v:IsA("BasePart") then
v.Transparency = 1
end
end
if Cast.UserData.CastBehavior.CosmeticBulletProvider ~= nil then
--Thread:Delay(5, function() -- 10
if CosmeticBulletObject ~= nil then
Cast.UserData.CastBehavior.CosmeticBulletProvider:ReturnPart(CosmeticBulletObject)
end
--end)
else
Debris:AddItem(CosmeticBulletObject, 5) -- 10
end
end
end
function ProjectileHandler:VisualizeHitEffect(Type, Hit, Position, Normal, Material, ClientModule, Misc, Replicate)
if Replicate then
VisualizeHitEffect:FireServer(Type, Hit, Position, Normal, Material, ClientModule, Misc, nil)
end
local ShowEffects = CanShowEffects(Position)
if ShowEffects then
if Type == "Normal" then
MakeImpactFX(Hit, Position, Normal, Material, true, ClientModule, Misc, Replicate, true)
elseif Type == "Blood" then
MakeBloodFX(Hit, Position, Normal, Material, true, ClientModule, Misc, Replicate, true)
end
end
end
function ProjectileHandler:SimulateProjectile(Tool, Handle, ClientModule, Directions, FirePointObject, MuzzlePointObject, Misc, Replicate)
if ClientModule and Tool and Handle then
if FirePointObject then
if not FirePointObject:IsDescendantOf(Workspace) and not FirePointObject:IsDescendantOf(Tool) then
return
end
else
return
end
if Replicate then
VisualizeBullet:FireServer(Tool, Handle, ClientModule, Directions, FirePointObject, MuzzlePointObject, Misc, nil)
end
if MuzzlePointObject then
if ClientModule.MuzzleFlashEnabled then
for i, v in pairs(Misc.MuzzleFolder:GetChildren()) do
if v.ClassName == "ParticleEmitter" then
local Count = 1
local Particle = v:Clone()
Particle.Parent = MuzzlePointObject
if Particle:FindFirstChild("EmitCount") then
Count = Particle.EmitCount.Value
end
Thread:Delay(0.01, function()
Particle:Emit(Count)
Debris:AddItem(Particle, Particle.Lifetime.Max)
end)
end
end
end
if ClientModule.MuzzleLightEnabled then
local Light = Instance.new("PointLight")
Light.Brightness = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LightBrightness, ClientModule.LightBrightness)
Light.Color = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LightColor, ClientModule.LightColor)
Light.Range = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LightRange, ClientModule.LightRange)
Light.Shadows = ClientModule.LightShadows
Light.Enabled = true
Light.Parent = MuzzlePointObject
Debris:AddItem(Light, ClientModule.VisibleTime)
end
end
local Character = Tool.Parent
local IgnoreList = {Camera, Tool, Character}
local CastParams = RaycastParams.new()
CastParams.IgnoreWater = true
CastParams.FilterType = Enum.RaycastFilterType.Blacklist
CastParams.FilterDescendantsInstances = IgnoreList
local RegionParams = OverlapParams.new()
RegionParams.FilterType = Enum.RaycastFilterType.Blacklist
RegionParams.FilterDescendantsInstances = IgnoreList
RegionParams.MaxParts = 0
RegionParams.CollisionGroup = "Default"
ShootId += 1
local LaserTrails = {}
local UpdateLaserTrail
local LaserTrailEnabled = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LaserTrailEnabled, ClientModule.LaserTrailEnabled)
local DamageableLaserTrail = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.DamageableLaserTrail, ClientModule.DamageableLaserTrail)
if Replicate then
if LaserTrailEnabled and DamageableLaserTrail then
UpdateLaserTrail = Instance.new("BindableEvent")
UpdateLaserTrail.Name = "UpdateLaserTrail_"..HttpService:GenerateGUID()
end
end
for _, Direction in pairs(Directions) do
if FirePointObject then
if not FirePointObject:IsDescendantOf(Workspace) and not FirePointObject:IsDescendantOf(Tool) then
return
end
else
return
end
local Origin, Dir = FirePointObject.WorldPosition, Direction
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart", 1)
local TipCFrame = FirePointObject.WorldCFrame
local TipPos = TipCFrame.Position
local TipDir = TipCFrame.LookVector
local AmountToCheatBack = math.abs((HumanoidRootPart.Position - TipPos):Dot(TipDir)) + 1
local GunRay = Ray.new(TipPos - TipDir.Unit * AmountToCheatBack, TipDir.Unit * AmountToCheatBack)
local HitPart, HitPoint = Workspace:FindPartOnRayWithIgnoreList(GunRay, IgnoreList, false, true)
if HitPart and math.abs((TipPos - HitPoint).Magnitude) > 0 then
Origin = HitPoint - TipDir.Unit * 0.1
--Dir = TipDir.Unit
end
local MyMovementSpeed = HumanoidRootPart.Velocity
local ModifiedBulletSpeed = (Dir * AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BulletSpeed, ClientModule.BulletSpeed)) -- + MyMovementSpeed
local CosmeticPartProvider
local ProjectileContainer
local ProjectileType = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ProjectileType, ClientModule.ProjectileType)
if ProjectileType ~= "None" then
local Projectile = Projectiles:FindFirstChild(ProjectileType)
if Projectile then
local Exist2 = false
for _, v in pairs(PartCacheStorage) do
if v.ProjectileName == Projectile.Name then
Exist2 = true
ProjectileContainer = Camera:FindFirstChild("ProjectileContainer_("..Projectile.Name..")")
CosmeticPartProvider = v.CosmeticPartProvider
break
end
end
if not Exist2 then
ProjectileContainer = Instance.new("Folder")
ProjectileContainer.Name = "ProjectileContainer_("..Projectile.Name..")"
ProjectileContainer.Parent = Camera
CosmeticPartProvider = PartCache.new(Projectile, 100, ProjectileContainer)
table.insert(PartCacheStorage, {
ProjectileName = Projectile.Name,
CosmeticPartProvider = CosmeticPartProvider
})
end
end
end
local PenetrationDepth = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.PenetrationDepth, ClientModule.PenetrationDepth)
local PenetrationAmount = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.PenetrationAmount, ClientModule.PenetrationAmount)
local PenetrationData
if (PenetrationDepth > 0 or PenetrationAmount > 0) then
PenetrationData = {
PenetrationDepth = PenetrationDepth,
PenetrationAmount = PenetrationAmount,
PenetrationIgnoreDelay = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.PenetrationIgnoreDelay, ClientModule.PenetrationIgnoreDelay),
HitHumanoids = {},
}
end
local SpinX = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.SpinX, ClientModule.SpinX)
local SpinY = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.SpinY, ClientModule.SpinY)
local SpinZ = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.SpinZ, ClientModule.SpinZ)
local BulletParticleData
if AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BulletParticle, ClientModule.BulletParticle) then
local BulletType = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BulletType, ClientModule.BulletType)
if BulletType ~= "None" then
local Attachment0 = Bullets[BulletType].Attachment0:Clone()
local Attachment1 = Bullets[BulletType].Attachment1:Clone()
local Effects = {}
Attachment0.Parent = Workspace.Terrain
Attachment1.Parent = Workspace.Terrain
for _, effect in next, Bullets[BulletType]:GetChildren() do
if effect:IsA("Beam") or effect:IsA("Trail") then
local eff = effect:Clone()
eff.Attachment0 = Attachment0 --Attachment1
eff.Attachment1 = Attachment1 --Attachment0
eff.Parent = Workspace.Terrain
table.insert(Effects, eff)
end
end
BulletParticleData = {
T0 = nil,
P0 = nil,
V0 = nil,
T1 = os.clock(),
P1 = CFrame.new().pointToObjectSpace(Camera.CFrame, Origin),
V1 = nil,
Attachment0 = Attachment0,
Attachment1 = Attachment1,
Effects = Effects,
MotionBlur = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.MotionBlur, ClientModule.MotionBlur),
BulletSize = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BulletSize, ClientModule.BulletSize),
BulletBloom = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BulletBloom, ClientModule.BulletBloom),
BulletBrightness = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BulletBrightness, ClientModule.BulletBrightness),
}
end
end
local CastBehavior = FastCast.newBehavior()
CastBehavior.RaycastParams = CastParams
CastBehavior.TravelType = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.TravelType, ClientModule.TravelType)
CastBehavior.MaxDistance = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.Range, ClientModule.Range)
CastBehavior.Lifetime = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.Lifetime, ClientModule.Lifetime)
CastBehavior.HighFidelityBehavior = FastCast.HighFidelityBehavior.Default
--CastBehavior.CosmeticBulletTemplate = CosmeticBullet -- Uncomment if you just want a simple template part and aren't using PartCache
CastBehavior.CosmeticBulletProvider = CosmeticPartProvider -- Comment out if you aren't using PartCache
CastBehavior.CosmeticBulletContainer = ProjectileContainer
CastBehavior.Acceleration = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.Acceleration, ClientModule.Acceleration)
CastBehavior.AutoIgnoreContainer = false
CastBehavior.HitEventOnTermination = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitEventOnTermination, ClientModule.HitEventOnTermination)
CastBehavior.CanPenetrateFunction = CanRayPenetrate
CastBehavior.CanHitFunction = CanRayHit
local RaycastHitbox = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.RaycastHitbox, ClientModule.RaycastHitbox)
local RaycastHitboxData = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.RaycastHitboxData, ClientModule.RaycastHitboxData)
CastBehavior.RaycastHitbox = (RaycastHitbox and #RaycastHitboxData > 0) and RaycastHitboxData or nil
CastBehavior.CurrentCFrame = CFrame.new(Origin, Origin + Dir)
CastBehavior.ModifiedDirection = CFrame.new(Origin, Origin + Dir).LookVector
CastBehavior.Hitscan = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HitscanMode, ClientModule.HitscanMode)
local LaserTrailId = HttpService:GenerateGUID()
if Replicate then
if LaserTrailEnabled and DamageableLaserTrail then
table.insert(LaserTrails, {
Id = LaserTrailId,
LaserContainer = {},
HitHumanoids = {},
Terminate = false,
})
end
end
local BoltCFrameTable = {}
local LightningBoltEnabled = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LightningBoltEnabled, ClientModule.LightningBoltEnabled)
if LightningBoltEnabled then
local BoltRadius = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BoltRadius, ClientModule.BoltRadius)
for i = 1, AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BoltCount, ClientModule.BoltCount) do
if i == 1 then
table.insert(BoltCFrameTable, CFrame.new(0, 0, 0))
else
table.insert(BoltCFrameTable, CFrame.new(math.random(-BoltRadius, BoltRadius), math.random(-BoltRadius, BoltRadius), 0))
end
end
end
CastBehavior.UserData = {
ShootId = ShootId,
Tool = Tool,
Character = Character,
ClientModule = ClientModule,
Misc = Misc,
Replicate = Replicate,
PenetrationData = PenetrationData,
BulletParticleData = BulletParticleData,
LaserData = {
LaserTrailEnabled = LaserTrailEnabled,
LaserTrailWidth = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LaserTrailWidth, ClientModule.LaserTrailWidth),
LaserTrailHeight = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LaserTrailHeight, ClientModule.LaserTrailHeight),
LaserTrailColor = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LaserTrailColor, ClientModule.LaserTrailColor),
RandomizeLaserColorIn = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.RandomizeLaserColorIn, ClientModule.RandomizeLaserColorIn),
LaserTrailMaterial = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LaserTrailMaterial, ClientModule.LaserTrailMaterial),
LaserTrailShape = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LaserTrailShape, ClientModule.LaserTrailShape),
LaserTrailReflectance = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LaserTrailReflectance, ClientModule.LaserTrailReflectance),
LaserTrailTransparency = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LaserTrailTransparency, ClientModule.LaserTrailTransparency),
LaserTrailVisibleTime = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LaserTrailVisibleTime, ClientModule.LaserTrailVisibleTime),
LaserTrailFadeTime = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LaserTrailFadeTime, ClientModule.LaserTrailFadeTime),
ScaleLaserTrail = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ScaleLaserTrail, ClientModule.ScaleLaserTrail),
LaserTrailScaleMultiplier = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LaserTrailScaleMultiplier, ClientModule.LaserTrailScaleMultiplier),
RandomLaserColor = Color3.new(math.random(), math.random(), math.random()),
LaserTrailId = LaserTrailId,
UpdateLaserTrail = UpdateLaserTrail,
LaserTrailContainer = {},
},
LightningData = {
LightningBoltEnabled = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LightningBoltEnabled, ClientModule.LightningBoltEnabled),
BoltWideness = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BoltWideness, ClientModule.BoltWideness),
BoltWidth = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BoltWidth, ClientModule.BoltWidth),
BoltHeight = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BoltHeight, ClientModule.BoltHeight),
BoltColor = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BoltColor, ClientModule.BoltColor),
RandomizeBoltColorIn = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.RandomizeBoltColorIn, ClientModule.RandomizeBoltColorIn),
BoltMaterial = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BoltMaterial, ClientModule.BoltMaterial),
BoltShape = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BoltShape, ClientModule.BoltShape),
BoltReflectance = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BoltReflectance, ClientModule.BoltReflectance),
BoltTransparency = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BoltTransparency, ClientModule.BoltTransparency),
BoltVisibleTime = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BoltVisibleTime, ClientModule.BoltVisibleTime),
BoltFadeTime = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BoltFadeTime, ClientModule.BoltFadeTime),
ScaleBolt = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ScaleBolt, ClientModule.ScaleBolt),
BoltScaleMultiplier = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BoltScaleMultiplier, ClientModule.BoltScaleMultiplier),
RandomBoltColor = Color3.new(math.random(), math.random(), math.random()),
BoltCFrameTable = BoltCFrameTable,
},
SpinData = {
CanSpinPart = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.CanSpinPart, ClientModule.CanSpinPart),
SpinX = SpinX,
SpinY = SpinY,
SpinZ = SpinZ,
InitalTick = os.clock(),
InitalAngularVelocity = Vector3.new(SpinX, SpinY, SpinZ),
InitalRotation = (CastBehavior.CurrentCFrame - CastBehavior.CurrentCFrame.p),
ProjectileOffset = Vector3.new(),
},
DebrisData = {
DebrisProjectile = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.DebrisProjectile, ClientModule.DebrisProjectile),
AnchorDebris = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.AnchorDebris, ClientModule.AnchorDebris),
CollideDebris = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.CollideDebris, ClientModule.CollideDebris),
NormalizeDebris = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.NormalizeDebris, ClientModule.NormalizeDebris),
BounceDebris = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BounceDebris, ClientModule.BounceDebris),
BounceVelocity = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BounceVelocity, ClientModule.BounceVelocity),
DecayProjectile = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.DecayProjectile, ClientModule.DecayProjectile),
AnchorDecay = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.AnchorDecay, ClientModule.AnchorDecay),
CollideDecay = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.CollideDecay, ClientModule.CollideDecay),
DecayVelocity = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.DecayVelocity, ClientModule.DecayVelocity),
VelocityInfluence = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.VelocityInfluence, ClientModule.VelocityInfluence),
DisableDebrisContents = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.DisableDebrisContents, ClientModule.DisableDebrisContents),
},
BounceData = {
CurrentBounces = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.RicochetAmount, ClientModule.RicochetAmount),
BounceElasticity = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BounceElasticity, ClientModule.BounceElasticity),
FrictionConstant = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.FrictionConstant, ClientModule.FrictionConstant),
IgnoreSlope = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.IgnoreSlope, ClientModule.IgnoreSlope),
SlopeAngle = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.SlopeAngle, ClientModule.SlopeAngle),
BounceHeight = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BounceHeight, ClientModule.BounceHeight),
NoExplosionWhileBouncing = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.NoExplosionWhileBouncing, ClientModule.NoExplosionWhileBouncing),
StopBouncingOn = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.StopBouncingOn, ClientModule.StopBouncingOn),
SuperRicochet = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.SuperRicochet, ClientModule.SuperRicochet),
BounceBetweenHumanoids = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.BounceBetweenHumanoids, ClientModule.BounceBetweenHumanoids),
PredictDirection = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.PredictDirection, ClientModule.PredictDirection),
BouncedHumanoids = {},
},
HomeData = {
Homing = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.Homing, ClientModule.Homing),
HomingDistance = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HomingDistance, ClientModule.HomingDistance),
TurnRatePerSecond = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.TurnRatePerSecond, ClientModule.TurnRatePerSecond),
HomeThroughWall = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.HomeThroughWall, ClientModule.HomeThroughWall),
LockOnOnHovering = ClientModule.LockOnOnHovering,
LockedEntity = Misc.LockedEntity,
},
UpdateData = {
UpdateRayInExtra = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.UpdateRayInExtra, ClientModule.UpdateRayInExtra),
ExtraRayUpdater = AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.ExtraRayUpdater, ClientModule.ExtraRayUpdater),
},
IgnoreList = IgnoreList,
LastSegmentOrigin = Vector3.new(),
SegmentOrigin = Vector3.new(),
SegmentDirection = Vector3.new(),
SegmentVelocity = Vector3.new(),
LastPosition = Origin,
CastBehavior = CastBehavior,
Whizzed = false,
}
local Simulate = Caster:Fire(Origin, Dir, ModifiedBulletSpeed, CastBehavior)
end
if Replicate then
if LaserTrailEnabled and DamageableLaserTrail then
if UpdateLaserTrail then
UpdateLaserTrail.Event:Connect(function(Id, LaserContainer, Terminate)
for _, v in pairs(LaserTrails) do
if v.Id == Id then
v.LaserContainer = LaserContainer
if Terminate then
v.Terminate = true
end
break
end
end
end)
end
local Connection
Connection = RunService.Heartbeat:Connect(function(dt)
if #LaserTrails <= 0 then
if UpdateLaserTrail then
UpdateLaserTrail:Destroy()
end
if Connection then
Connection:Disconnect()
Connection = nil
end
else
for i, v in next, LaserTrails, nil do
local Terminated = false
if v.Terminate then
if #v.LaserContainer <= 0 then
Terminated = true
table.remove(LaserTrails, i)
end
end
if not Terminated then
for _, vv in pairs(v.LaserContainer) do
if vv then
local TouchingParts = Workspace:GetPartsInPart(vv, RegionParams)
for _, part in pairs(TouchingParts) do
if part and part.Parent then
local Target = part:FindFirstAncestorOfClass("Model")
local TargetHumanoid = Target and Target:FindFirstChildOfClass("Humanoid")
local TargetTorso = Target and (Target:FindFirstChild("HumanoidRootPart") or part.Parent:FindFirstChild("Head"))
if TargetHumanoid and TargetHumanoid.Parent ~= Character and TargetTorso then
if TargetHumanoid.Health > 0 then
if not table.find(v.HitHumanoids, TargetHumanoid) then
table.insert(v.HitHumanoids, TargetHumanoid)
Thread:Spawn(function()
InflictTarget:InvokeServer("GunLaser", Tool, ClientModule, TargetHumanoid, TargetTorso, part, part.Size, Misc)
end)
if Tool and Tool.GunClient:FindFirstChild("MarkerEvent") then
Tool.GunClient.MarkerEvent:Fire(ClientModule, false)
end
if AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LaserTrailConstantDamage, ClientModule.LaserTrailConstantDamage) then
Thread:Delay(AddressTableValue(ClientModule.ChargedShotAdvanceEnabled, Misc.ChargeLevel, ClientModule.ChargeAlterTable.LaserTrailDamageRate, ClientModule.LaserTrailDamageRate), function()
local Index = table.find(v.HitHumanoids, TargetHumanoid)
if Index then
table.remove(v.HitHumanoids, Index)
end
end)
end
end
end
end
end
end
end
end
end
end
end
end)
end
end
end
end
Caster.RayFinalHit:Connect(OnRayFinalHit)
Caster.RayHit:Connect(OnRayHit)
Caster.LengthChanged:Connect(OnRayUpdated)
Caster.CastTerminating:Connect(OnRayTerminated)
return ProjectileHandler
|
--Made by Asleum
|
--This ForceField does not protect you its just cosmetic.
|
--Body Variables
|
local myHuman = script.Parent:WaitForChild("Humanoid")
local myTorso = script.Parent:WaitForChild("Torso")
local myHead = script.Parent:WaitForChild("Head")
local neck = myTorso:WaitForChild("Neck")
local headWeld = myTorso:WaitForChild("Head Weld")
local rArm = script.Parent:WaitForChild("Right Arm")
local lArm = script.Parent:WaitForChild("Left Arm")
local lShoulder = myTorso:WaitForChild("Left Shoulder")
local rShoulder = myTorso:WaitForChild("Right Shoulder")
local lArmWeld = myTorso:WaitForChild("Left Arm Weld")
local rArmWeld = myTorso:WaitForChild("Right Arm Weld")
local outfits = game:GetService("ServerStorage").Outfits:GetChildren()
local outfit = outfits[math.random(1,#outfits)]:Clone()
for i, v in pairs(outfit:GetChildren()) do
v.Parent = script.Parent
end
outfit:Destroy()
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
raycastParams.FilterDescendantsInstances = {script.Parent}
local FastCast = require(game:GetService("ReplicatedStorage"):WaitForChild("FastCastRedux"))
FastCast.DebugLogging = false
FastCast.VisualizeCasts = false
local Caster = FastCast.new()
Caster.WorldRoot = workspace
local FastStats = FastCast.newBehavior()
FastStats.HitEventOnTermination = true
FastStats.Lifetime = 5
FastStats.MaxDistance = 1000
FastStats.TravelType = "Lifetime"
FastStats.Acceleration = Vector3.new(0,0,0)
FastStats.RaycastParams = raycastParams
FastStats.CosmeticBulletTemplate = game:GetService("ReplicatedStorage"):WaitForChild("Miscs"):WaitForChild("Projectiles"):WaitForChild("Bullet")
|
------------------------------------------------------------------------
--
-- * used only in luaK:posfix()
------------------------------------------------------------------------
|
function luaK:codecomp(fs, op, cond, e1, e2)
local o1 = self:exp2RK(fs, e1)
local o2 = self:exp2RK(fs, e2)
self:freeexp(fs, e2)
self:freeexp(fs, e1)
if cond == 0 and op ~= "OP_EQ" then
-- exchange args to replace by `<' or `<='
o1, o2 = o2, o1 -- o1 <==> o2
cond = 1
end
e1.info = self:condjump(fs, op, cond, o1, o2)
e1.k = "VJMP"
end
|
--[[Steering]]
|
Tune.SteerInner = 70 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 65 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .2 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .2 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
--Steer Gyro Tuning
Tune.SteerD = 100 -- Steering Dampening
Tune.SteerMaxTorque = 50000 -- Steering Force
Tune.SteerP = 1500 -- Steering Aggressiveness
|
--- Skip forwards in now
-- @param delta now to skip forwards
|
function Spring:TimeSkip(delta)
local now = tick()
local position, velocity = self:_positionVelocity(now+delta)
self._position0 = position
self._velocity0 = velocity
self._time0 = now
end
function Spring:__index(index)
if Spring[index] then
return Spring[index]
elseif index == "Value" or index == "Position" or index == "p" then
local position, _ = self:_positionVelocity(tick())
return position
elseif index == "Velocity" or index == "v" then
local _, velocity = self:_positionVelocity(tick())
return velocity
elseif index == "Target" or index == "t" then
return self._target
elseif index == "Damper" or index == "d" then
return self._damper
elseif index == "Speed" or index == "s" then
return self._speed
else
error(("%q is not a valid member of Spring"):format(tostring(index)), 2)
end
end
function Spring:__newindex(index, value)
local now = tick()
if index == "Value" or index == "Position" or index == "p" then
local _, velocity = self:_positionVelocity(now)
self._position0 = value
self._velocity0 = velocity
elseif index == "Velocity" or index == "v" then
local position, _ = self:_positionVelocity(now)
self._position0 = position
self._velocity0 = value
elseif index == "Target" or index == "t" then
local position, velocity = self:_positionVelocity(now)
self._position0 = position
self._velocity0 = velocity
self._target = value
elseif index == "Damper" or index == "d" then
local position, velocity = self:_positionVelocity(now)
self._position0 = position
self._velocity0 = velocity
self._damper = math.clamp(value, 0, 1)
elseif index == "Speed" or index == "s" then
local position, velocity = self:_positionVelocity(now)
self._position0 = position
self._velocity0 = velocity
self._speed = value < 0 and 0 or value
else
error(("%q is not a valid member of Spring"):format(tostring(index)), 2)
end
self._time0 = now
end
function Spring:_positionVelocity(now)
local p0 = self._position0
local v0 = self._velocity0
local p1 = self._target
local d = self._damper
local s = self._speed
local t = s*(now - self._time0)
local d2 = d*d
local h, si, co
if d2 < 1 then
h = math.sqrt(1 - d2)
local ep = math.exp(-d*t)/h
co, si = ep*math.cos(h*t), ep*math.sin(h*t)
elseif d2 == 1 then
h = 1
local ep = math.exp(-d*t)/h
co, si = ep, ep*t
else
h = math.sqrt(d2 - 1)
local u = math.exp((-d + h)*t)/(2*h)
local v = math.exp((-d - h)*t)/(2*h)
co, si = u + v, u - v
end
local a0 = h*co + d*si
local a1 = 1 - (h*co + d*si)
local a2 = si/s/2
local b0 = -s*si
local b1 = s*si
local b2 = h*co - d*si
return
a0*p0 + a1*p1 + a2*v0,
b0*p0 + b1*p1 + b2*v0
end
return Spring
|
--ScanForPoint()
|
hum.MoveToFinished:connect(function()
anims.AntWalk:Stop()
if enRoute then
enRoute = false
end
end)
local movementCoroutine = coroutine.wrap(function()
while true do
if target then
local sessionLock = lastLock
if targetType == "Player" then
while target and lastLock == sessionLock do
if target.Character and target.Character:IsDescendantOf(workspace) and target.Character.Humanoid and target.Character.Humanoid.Health > 0 then
local dist = (root.Position-target.Character.PrimaryPart.Position).magnitude
if dist < 5 then
|
--[=[
@within Plasma
@function blur
@tag widgets
@param size number -- The size of the blur
A blur effect in the world. Created in Lighting.
]=]
|
local Lighting = game:GetService("Lighting")
local Runtime = require(script.Parent.Parent.Runtime)
local portal = require(script.Parent.portal)
return function(size)
portal(Lighting, function()
Runtime.useInstance(function()
local blur = Instance.new("BlurEffect")
blur.Size = size
return blur
end)
end)
end
|
-------------------------------------
|
equiped=false
sp=script.Parent
RayLength=200
Spread=.0001
enabled=true
reloading=false
down=false
r=game:service("RunService")
last=0
last2=0
last3=0
last4=0
last5=0
last6=0
p = Instance.new("Part")
p.Parent = game.Lighting
p.Name = "BulletTexture"
p.CanCollide = true
p.formFactor = "Custom"
p.Size = Vector3.new(1,0.1,1)
p.Transparency = 1
g = Instance.new("SpecialMesh")
g.Parent = p
Bullet=Instance.new("Part")
Bullet.Name="Bullet"
Bullet.BrickColor=BrickColor.new("New Yeller")
Bullet.Anchored=true
Bullet.CanCollide=false
Bullet.Locked=true
Bullet.Size=Vector3.new(1,1,1)
|
--// Animations
|
-- Idle Anim
IdleAnim = function(char, speed, objs)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.32277012, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[3], nil , CFrame.new(1.06851184, 0.973718464, -2.29667926, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- FireMode Anim
FireModeAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0.340285569, 0, -0.0787199363, 0.962304771, 0.271973342, 0, -0.261981696, 0.926952124, -0.268561482, -0.0730415657, 0.258437991, 0.963262498), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(0.67163527, -0.310947895, -1.34432662, 0.766044378, -2.80971371e-008, 0.642787576, -0.620885074, -0.258818865, 0.739942133, 0.166365519, -0.965925872, -0.198266774), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.25)
objs[4]:WaitForChild("Click"):Play()
end;
-- Reload Anim
ReloadAnim = function(char, speed, objs)
ts:Create(objs[1], TweenInfo.new(0.6), {C1 = CFrame.new(-0.902175903, -1.15645337, -1.32277012, 0.984807789, -0.163175702, -0.0593911409, 0, -0.342020363, 0.939692557, -0.17364797, -0.925416529, -0.336824328)}):Play()
wait(0.5)
ts:Create(objs[2], TweenInfo.new(0.6), {C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.787567914, -0.220087856, 0.575584888, -0.323594928, 0.647189975, 0.690240026, -0.524426222, -0.72986728, 0.438486755)}):Play()
wait(0.5)
script.Parent.Parent.Parent.Mag.GrabCartridge:Play()
wait(2)
ts:Create(objs[2], TweenInfo.new(0.6), {C1 = CFrame.new(0.805950999, 0.559619546, -1.73060048, 0.802135408, -0.348581612, 0.484839559, -0.597102284, -0.477574915, 0.644508123, 0.00688350201, -0.806481719, -0.59121877)}):Play()
wait(0.5)
script.Parent.Parent.Parent.Mag.PourPowder:Play()
wait(1.1)
ts:Create(objs[1], TweenInfo.new(0.6), {C1 = CFrame.new(-0.902175903, -1.15645337, -1.32277012, 0.984807789, -0.163175702, -0.0593911409, 0, -0.342020363, 0.939692557, -0.17364797, -0.925416529, -0.336824328)}):Play()
wait(0.5)
ts:Create(objs[2], TweenInfo.new(0.6), {C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.787567914, -0.220087856, 0.575584888, -0.323594928, 0.647189975, 0.690240026, -0.524426222, -0.72986728, 0.438486755)}):Play()
wait(0.5)
ts:Create(objs[2], TweenInfo.new(0.6), {C1 = CFrame.new(0.805950999, 0.559619546, -1.73060048, 0.802135408, -0.348581612, 0.484839559, -0.597102284, -0.477574915, 0.644508123, 0.00688350201, -0.806481719, -0.59121877)}):Play()
wait(0.5)
script.Parent.Parent.Parent.Mag.Tap:Play()
wait(1)
script.Parent.Parent.Parent.Mag.Tap:Play()
wait(1)
script.Parent.Parent.Parent.Mag.Tap:Play()
wait(1)
ts:Create(objs[1], TweenInfo.new(0.6), {C1 = CFrame.new(-0.902175903, -1.15645337, -1.32277012, 0.984807789, -0.163175702, -0.0593911409, 0, -0.342020363, 0.939692557, -0.17364797, -0.925416529, -0.336824328)}):Play()
wait(0.5)
ts:Create(objs[2], TweenInfo.new(0.6), {C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.787567914, -0.220087856, 0.575584888, -0.323594928, 0.647189975, 0.690240026, -0.524426222, -0.72986728, 0.438486755)}):Play()
wait(0.5)
script.Parent.Parent.Parent.Mag.Cap:Play()
wait(0.5)
end;
-- Bolt Anim
BoltBackAnim = function(char, speed, objs)
TweenJoint(objs[3], nil , CFrame.new(-0.723402083, 0.561492503, -1.32277012, 0.98480773, 0.173648179, -2.07073381e-09, 0, 1.19248806e-08, 1, 0.173648179, -0.98480773, 1.17437144e-08), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(-0.674199283, -0.379443169, -1.24877262, 0.098731339, -0.973386228, -0.206811741, -0.90958333, -0.172570169, 0.377991527, -0.403621316, 0.150792867, -0.902414143), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.4)
objs[5]:WaitForChild("BoltBack"):Play()
TweenJoint(objs[2], nil , CFrame.new(-0.674199283, -0.578711689, -0.798391461, 0.098731339, -0.973386228, -0.206811741, -0.90958333, -0.172570169, 0.377991527, -0.403621316, 0.150792867, -0.902414143), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.273770154, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[3], nil , CFrame.new(-0.723402083, 0.311225414, -1.32277012, 0.98480773, 0.173648179, -2.07073381e-09, 0.0128111057, -0.0726553723, 0.997274816, 0.173174962, -0.982123971, -0.0737762004), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.3)
end;
BoltForwardAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.1)
wait(0.2)
end;
-- Bolting Back
BoltingBackAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.1, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.1)
end;
BoltingForwardAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.1)
end;
InspectAnim = function(char, speed, objs)
ts:Create(objs[1],TweenInfo.new(1),{C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.999723792, 0.0109803826, 0.0207702816, -0.0223077796, 0.721017241, 0.692557871, -0.00737112388, -0.692829967, 0.721063137)}):Play()
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(-1.49363565, -0.699174881, -1.32277012, 0.66716975, -8.8829113e-09, -0.74490571, 0.651565909, -0.484672248, 0.5835706, -0.361035138, -0.874695837, -0.323358655)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(1.37424219, -0.699174881, -1.03685927, -0.204235911, 0.62879771, 0.750267386, 0.65156585, -0.484672219, 0.58357054, 0.730581641, 0.60803473, -0.310715646)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.32277012, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
ts:Create(objs[1],TweenInfo.new(1),{C1 = CFrame.new(0.447846293, 0.654529572, -1.81345785, 0.761665463, -0.514432132, 0.393986136, -0.560285628, -0.217437655, 0.799250066, -0.325492471, -0.82950604, -0.453843832)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(0.15),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.55972552, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
ts:Create(objs[1],TweenInfo.new(0.3),{C1 = CFrame.new(0.447846293, 0.654529572, -1.81345785, 0.761665463, -0.514432132, 0.393986136, -0.560285628, -0.217437655, 0.799250066, -0.325492471, -0.82950604, -0.453843832)}):Play()
wait(0.1)
end;
nadeReload = function(char, speed, objs)
ts:Create(objs[1], TweenInfo.new(0.6), {C1 = CFrame.new(-0.902175903, -1.15645337, -1.32277012, 0.984807789, -0.163175702, -0.0593911409, 0, -0.342020363, 0.939692557, -0.17364797, -0.925416529, -0.336824328)}):Play()
wait(0.1)
ts:Create(objs[2], TweenInfo.new(0.6), {C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.787567914, -0.220087856, 0.575584888, -0.323594928, 0.647189975, 0.690240026, -0.524426222, -0.72986728, 0.438486755)}):Play()
wait(0.1)
ts:Create(objs[2], TweenInfo.new(0.6), {C1 = CFrame.new(0.805950999, 0.559619546, -1.73060048, 0.802135408, -0.348581612, 0.484839559, -0.597102284, -0.477574915, 0.644508123, 0.00688350201, -0.806481719, -0.59121877)}):Play()
wait(10)
end;
}
return Settings
|
--Automatic Gauge Scaling
|
if autoscaling then
local Drive={}
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("FL")~= nil then
table.insert(Drive,car.Wheels.FL)
end
if car.Wheels:FindFirstChild("FR")~= nil then
table.insert(Drive,car.Wheels.FR)
end
if car.Wheels:FindFirstChild("F")~= nil then
table.insert(Drive,car.Wheels.F)
end
end
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("RL")~= nil then
table.insert(Drive,car.Wheels.RL)
end
if car.Wheels:FindFirstChild("RR")~= nil then
table.insert(Drive,car.Wheels.RR)
end
if car.Wheels:FindFirstChild("R")~= nil then
table.insert(Drive,car.Wheels.R)
end
end
local wDia = 0
for i,v in pairs(Drive) do
if v.Size.x>wDia then wDia = v.Size.x end
end
Drive = nil
for i,v in pairs(UNITS) do
v.maxSpeed = math.ceil(v.scaling*wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive)
v.spInc = math.max(math.ceil(v.maxSpeed/200)*20,20)
end
end
for i=0,revEnd*2 do
local ln = script.Parent.ln:clone()
ln.Parent = script.Parent.Tach
ln.Rotation = 45 + i * 225 / (revEnd*2)
ln.Num.Text = i/2
ln.Num.Rotation = -ln.Rotation
if i*500>=math.floor(_pRPM/500)*500 then
ln.Frame.BackgroundColor3 = Color3.new(1,0,0)
if i<revEnd*2 then
ln2 = ln:clone()
ln2.Parent = script.Parent.Tach
ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2)
ln2.Num:Destroy()
ln2.Visible=true
end
end
if i%2==0 then
ln.Frame.Size = UDim2.new(0,3,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
ln.Num.Visible = true
else
ln.Num:Destroy()
end
ln.Visible=true
end
local lns = Instance.new("Frame",script.Parent.Speedo)
lns.Name = "lns"
lns.BackgroundTransparency = 1
lns.BorderSizePixel = 0
lns.Size = UDim2.new(0,0,0,0)
for i=1,90 do
local ln = script.Parent.ln:clone()
ln.Parent = lns
ln.Rotation = 45 + 225*(i/90)
if i%2==0 then
ln.Frame.Size = UDim2.new(0,2,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
else
ln.Frame.Size = UDim2.new(0,3,0,5)
end
ln.Num:Destroy()
ln.Visible=true
end
for i,v in pairs(UNITS) do
local lnn = Instance.new("Frame",script.Parent.Speedo)
lnn.BackgroundTransparency = 1
lnn.BorderSizePixel = 0
lnn.Size = UDim2.new(0,0,0,0)
lnn.Name = v.units
if i~= 1 then lnn.Visible=false end
for i=0,v.maxSpeed,v.spInc do
local ln = script.Parent.ln:clone()
ln.Parent = lnn
ln.Rotation = 45 + 225*(i/v.maxSpeed)
ln.Num.Text = i
ln.Num.TextSize = 14
ln.Num.Rotation = -ln.Rotation
ln.Frame:Destroy()
ln.Num.Visible=true
ln.Visible=true
end
end
script.Parent.Parent.IsOn.Changed:connect(function()
if script.Parent.Parent.IsOn.Value then
for i=1,0,0.1 do
wait()
script.Speed.TextTransparency=i
script.Gear.TextTransparency=i
script.TMode.TextTransparency=i
end
end
end)
script.Parent.Parent.Values.RPM.Changed:connect(function()
script.Parent.Tach.Needle.Rotation = 45 + 225 * math.min(1,script.Parent.Parent.Values.RPM.Value / (revEnd*1000))
end)
script.Parent.Parent.Values.Gear.Changed:connect(function()
local gearText = script.Parent.Parent.Values.Gear.Value
if gearText > 0 then gearText="Gear: D"
elseif gearText == 0 then gearText = "Gear: N"
elseif gearText == -1 then gearText = "Gear: R"
end
script.Parent.Gear.Text = gearText
end)
script.Parent.Parent.Values.TCS.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCS.Value then
script.Parent.TCS.TextColor3 = Color3.new(1,170/255,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,170/255,0)
if script.Parent.Parent.Values.TCSActive.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
else
wait()
script.Parent.TCS.Visible = false
end
else
script.Parent.TCS.Visible = true
script.Parent.TCS.TextColor3 = Color3.new(1,0,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,0,0)
end
else
script.Parent.TCS.Visible = false
end
end)
script.Parent.Parent.Values.TCSActive.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
else
wait()
script.Parent.TCS.Visible = false
end
else
script.Parent.TCS.Visible = false
end
end)
script.Parent.TCS.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
end
else
if script.Parent.TCS.Visible then
script.Parent.TCS.Visible = false
end
end
end)
script.Parent.Parent.Values.ABS.Changed:connect(function()
if _Tune.ABSEnabled then
if script.Parent.Parent.Values.ABS.Value then
script.Parent.ABS.TextColor3 = Color3.new(1,170/255,0)
script.Parent.ABS.TextStrokeColor3 = Color3.new(1,170/255,0)
if script.Parent.Parent.Values.ABSActive.Value then
wait()
script.Parent.ABS.Visible = not script.Parent.ABS.Visible
else
wait()
script.Parent.ABS.Visible = false
end
else
script.Parent.ABS.Visible = true
script.Parent.ABS.TextColor3 = Color3.new(1,0,0)
script.Parent.ABS.TextStrokeColor3 = Color3.new(1,0,0)
end
else
script.Parent.ABS.Visible = false
end
end)
script.Parent.Parent.Values.ABSActive.Changed:connect(function()
if _Tune.ABSEnabled then
if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = not script.Parent.ABS.Visible
elseif not script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = true
else
wait()
script.Parent.ABS.Visible = false
end
else
script.Parent.ABS.Visible = false
end
end)
script.Parent.ABS.Changed:connect(function()
if _Tune.ABSEnabled then
if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = not script.Parent.ABS.Visible
elseif not script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = true
end
else
if script.Parent.ABS.Visible then
script.Parent.ABS.Visible = false
end
end
end)
function PBrake()
script.Parent.PBrake.Visible = script.Parent.Parent.Values.PBrake.Value
end
script.Parent.Parent.Values.PBrake.Changed:connect(PBrake)
function Gear()
if script.Parent.Parent.Values.TransmissionMode.Value == "Auto" then
script.Parent.TMode.Text = "A/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,170/255,0)
elseif script.Parent.Parent.Values.TransmissionMode.Value == "Semi" then
script.Parent.TMode.Text = "S/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255)
else
script.Parent.TMode.Text = "M/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,85/255,.5)
end
end
script.Parent.Parent.Values.TransmissionMode.Changed:connect(Gear)
script.Parent.Parent.Values.Velocity.Changed:connect(function(property)
script.Parent.Speedo.Needle.Rotation =45 + 225 * math.min(1,UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed)
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
script.Parent.Speed.MouseButton1Click:connect(function()
if currentUnits==#UNITS then
currentUnits = 1
else
currentUnits = currentUnits+1
end
for i,v in pairs(script.Parent.Speedo:GetChildren()) do
v.Visible=v.Name==UNITS[currentUnits].units or v.Name=="Needle" or v.Name=="lns"
end
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
wait(.1)
Gear()
PBrake()
|
--Healing that looks nice.
|
var = (".")
function onClicked(click)
if (script.Parent.Value1.Value == 0) then
script.Parent.Value1.Value = 1
for i = 1, 5, 1 do
var = (var .. ".")
game.Players.LocalPlayer.Character.Humanoid.Health = game.Players.LocalPlayer.Character.Humanoid.Health + 20
wait(0.2)
end
var = (".")
script.Parent.Value1.Value = 0
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
-- esse script tira o heal default do roblox
|
local players = game:GetService("Players")
players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
if char:FindFirstChild("Health") then
char:WaitForChild("Health"):Destroy()
end
end)
end)
|
--[[
Sets the system marker so that clients can see it through walls. If message is nil, then the marker is removed.
]]
|
function BaseSystem:_setMarker(message)
local part = self._model.PrimaryPart
DestroyMarker:FireAllClients(part)
local translatedNames = {
Camera = translate("Camera"),
Engine = translate("Engine"),
Generator = translate("Generator"),
Gravity = translate("Gravity"),
Lights = translate("Lights"),
Shield = translate("Shields")
}
if message then
CreateMarker:FireAllClients(part, translatedNames[self._model.Name] or self._model.Name, message)
end
end
|
--[[Wheel Alignment]]
|
--[Don't physically apply alignment to wheels]
--[Values are in degrees]
Tune.FCamber = 1
Tune.RCamber = 1
Tune.FToe = 0
Tune.RToe = 0
|
--[[Transmission]]
|
Tune.TransModes = {"Auto", "Semi", "Manual"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 3.50 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.50 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.50 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 3.00 ,
--[[ 3 ]] 2.50 ,
--[[ 4 ]] 2.00 ,
--[[ 5 ]] 1.50 ,
--[[ 6 ]] 1.00 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--Manual: Quick Shifter
|
Tune.QuickShifter = true -- To quickshift, cut off the throttle to upshift, and apply throttle to downshift, all without clutch.
Tune.QuickShiftTime = 0.25 -- Determines how much time you have to quick shift up or down before you need to use the clutch.
|
--[[ Local Variables ]]
|
--
local MasterControl = {}
local Players = game:GetService('Players')
local RunService = game:GetService('RunService')
while not Players.LocalPlayer do
wait()
end
local LocalPlayer = Players.LocalPlayer
local CachedHumanoid = nil
local RenderSteppedCon = nil
local moveFunc = LocalPlayer.Move
local isJumping = false
local moveValue = Vector3.new(0,0,0)
|
--[[
Novena Constraint Type: Motorcycle
The Bike Chassis
SecondLogic | Inspare (thanks!)
Avxnturador | Novena
--]]
|
local autoscaling = true --Estimates top speed
local UNITS = { --Click on speed to change units
--First unit is default
{
units = "KM/H" ,
scaling = (10/12) * 1.09728 , -- 1 stud : 10 inches | ft/s to KP/H
maxSpeed = 370 ,
spInc = 40 , -- Increment between labelled notches
},
{
units = "SPS" ,
scaling = 1 , -- Roblox standard
maxSpeed = 400 ,
spInc = 40 , -- Increment between labelled notches
}
}
|
------- extreme math equations
|
local v = 30
local c = 50
local m = part:GetMass()
if m< 20 then
m = 20
end
part.RotVelocity =Vector3.new(math.random(-v,v)/(m/c),math.random(-v,v)/(m/c),math.random(-v,v)/(m/c))
game:GetService("Debris"):AddItem(script.Parent,0.1)--penetration
end
local a = part.Parent:findFirstChild("Humanoid")
local b = part.Parent.Parent:findFirstChild("Humanoid")
local debrispart = Instance.new("Part")
debrispart.Name="debrispart"
debrispart.Size = Vector3.new(0.05,0.05,0.05)
debrispart.BrickColor = part.BrickColor
debrispart.Anchored=true
debrispart.CanCollide = false
debrispart.Transparency=1
debrispart.Position=positiono
debrispart.Parent=game.Workspace
if a == nil and b == nil then
local thingy = script.debris:Clone()
thingy.Color=ColorSequence.new(part.Color,part.Color)
thingy.Parent=debrispart
spawn(function()
thingy:Emit(10)
end)
end
if a ~= nil or b ~= nil then
local thingy = script.blood:Clone()
thingy.Parent=debrispart
spawn(function()
thingy:Emit(10)
end)
end
game:GetService("Debris"):AddItem(debrispart,1)
game:GetService("Debris"):AddItem(script.Parent,0.05)
--[[if position ~= nil then
end]]--
end
script.Parent.Touched:connect(hit)
|
--[[Transmission]]
|
Tune.TransModes = {"Auto", "Semi"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 3 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.04 ,
--[[ 3 ]] 1.38 ,
--[[ 4 ]] 1.03 ,
--[[ 5 ]] 0.81 ,
--[[ 6 ]] 0.64 ,
}
Tune.FDMult = 0.6 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
-- Ammo Effect
|
function ammoEffect()
local t = 0.3
ammoUI.AmmoEffect.Size = UDim2.new(1, 0, 1, 0)
ammoUI.AmmoEffect.TextTransparency = 0
ammoUI.AmmoEffect:TweenSize(UDim2.new(2.1, 0, 2.1, 0), "InOut", "Quad", t, true)
for i = 1, 10 do
ammoUI.AmmoEffect.TextTransparency = ammoUI.AmmoEffect.TextTransparency + 0.1
wait(t/10)
end
return
end
|
--set up ghost following you
|
Spawn(function()
while Alive do
local torsoAt = Character.Torso.Position
local toGhost = Body.Position - torsoAt
toGhost = Vector3.new(toGhost.x, 0, toGhost.z).unit
local ghostAt = torsoAt + toGhost*3 + Vector3.new(0, 2 + 1*math.sin(tick()), 0)
--
Body.Float.position = ghostAt
Body.Rotate.cframe = Character.Torso.CFrame
wait()
Body.Anchored = false;
Body.CanCollide = false;
Body:SetNetworkOwner(nil)
end
end)
|
--Spin Limit
|
if Spin <= 0 then
Spin = 0
end
if Spin > 10 then
cam = game.Workspace.CurrentCamera
local cam_rot = cam.CoordinateFrame - cam.CoordinateFrame.p
local cam_scroll = (cam.CoordinateFrame.p - cam.Focus.p).magnitude
local ncf = CFrame.new(cam.Focus.p)*cam_rot*CFrame.fromEulerAnglesXYZ(0.001, 0, 0)
cam.CoordinateFrame = ncf*CFrame.new(0, 0, cam_scroll)
script.Ding.Pitch = .6 + (.3 * (Spin/40))
script.Ding:Play()
end
if Spin > 45 then
Spin = 45
end
|
--Made by Superluck, Uploaded by FederalSignal_QCB.
--Made by Superluck, Uploaded by FederalSignal_QCB.
--Made by Superluck, Uploaded by FederalSignal_QCB.
|
wait(1)
while true do
script.Parent.Parent.Parent.Scripts.SoundBlock.Value.Sound.PlaybackSpeed = script.Parent.PlaybackSpeed
script.Parent.Parent.Parent.Scripts.SoundBlock.Value.Sound.Volume = (script.Parent.Volume*2)*11
script.Parent.Parent.Parent.Scripts.SoundBlock.Value.Sound.EmitterSize = script.Parent.EmitterSize*10
script.Parent.Parent.Parent.Scripts.SoundBlock.Value.Sound.SoundId = script.Parent.SoundId
script.Parent.Parent.Parent.Scripts.SoundBlock.Value.Sound.Playing = script.Parent.Playing
script.Parent.Parent.Parent.Scripts.SoundBlock.Value.Sound.DistortionSoundEffect.Level = (script.Parent.Volume*1.3)*4
wait()
end
|
--[=[
Same as `andThenCall`, except for `finally`.
Attaches a `finally` handler to this Promise that calls the given callback with the predefined arguments.
@param callback (...: any) -> any
@param ...? any -- Additional arguments which will be passed to `callback`
@return Promise
]=]
|
function Promise.prototype:finallyCall(callback, ...)
assert(type(callback) == "function", string.format(ERROR_NON_FUNCTION, "Promise:finallyCall"))
local length, values = pack(...)
return self:_finally(debug.traceback(nil, 2), function()
return callback(unpack(values, 1, length))
end)
end
|
-- This file was @generated by Tarmac. It is not intended for manual editing.
|
return {
ApertureOutline = "rbxassetid://10075108836",
ApertureSolid = "rbxassetid://10075108932",
CameraFilled = "rbxassetid://10075109090",
CameraOutline = "rbxassetid://10075109448",
Caret = "rbxassetid://10075138934",
CheckCircle = "rbxassetid://10075110227",
EmoteOutline = "rbxassetid://10075110453",
EmoteSolid = "rbxassetid://10075110659",
EyeClosed = "rbxassetid://10075110843",
EyeOpen = "rbxassetid://10075110954",
Filters = {
Antique = "rbxassetid://10075195631",
Cute = "rbxassetid://10075195904",
Dramatic = "rbxassetid://10075196064",
Monochrome = "rbxassetid://10075196387",
Normal = "rbxassetid://10075196662",
Pop = "rbxassetid://10075196915",
Soft = "rbxassetid://10075197132",
},
Poses = {
BreakDance = "rbxassetid://10075186317",
Cheer = "rbxassetid://10075186554",
Clapping = "rbxassetid://10075186766",
Dolphin = "rbxassetid://10075186950",
Flossing = "rbxassetid://10075187146",
Guitar = "rbxassetid://10075187373",
JumpWave = "rbxassetid://10075187644",
Louder = "rbxassetid://10075187820",
Normal = "rbxassetid://10075187987",
TopRock = "rbxassetid://10075188289",
Twirl = "rbxassetid://10075188477",
Wave = "rbxassetid://10075188642",
},
SparkleOutline = "rbxassetid://10075074919",
SparkleSolid = "rbxassetid://10075075008",
ToolboxIcon = "rbxassetid://10205311137",
UsersOutline = "rbxassetid://10075111071",
UsersSolid = "rbxassetid://10075111227",
XClose = "rbxassetid://10075139060",
}
|
-- find player's head pos
|
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local head = vCharacter:findFirstChild("Head")
if head == nil then return end
Tool.Handle.Fire:Play()
local launch = head.Position + 10 * v
local missile = Pellet:clone()
missile.CFrame = CFrame.new(launch,shootDirect)
missile.Position = launch
missile.Velocity = v * 85
local force = Instance.new("BodyForce")
force.force = Vector3.new(0,942,0)
force.Parent = missile
missile.SnowballScript.Disabled = false
missile.Parent = game.Workspace
end
function gunUp()
Tool.GripPos = Vector3.new(0.3,0,-1.2)
end
function gunOut()
Tool.GripPos = Vector3.new(0.3,0,-1.5)
end
function onEquipped()
Tool.Handle.Fire:Stop()
end
function onUnequipped()
Tool.Handle.Fire:Stop()
end
Tool.Equipped:connect(onEquipped)
Tool.Unequipped:connect(onUnequipped)
enabled = true
function onActivated()
if not enabled then
return
end
enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
local targetPos = humanoid.TargetPoint
local lookAt = (targetPos - character.Head.Position).unit
shootDirect = targetPos
local reload = 0.0000001
gunUp()
fire(lookAt, shootDirect)
wait(0.1)
gunOut()
wait(reload)
wait(reload)
enabled = true
end
script.Parent.Activated:connect(onActivated)
|
-- I'm honestly not sure
-- Andrew Bereza
|
game.ReplicatedStorage.RequestGui.OnServerInvoke = function(Player,GuiName)
local Gui = game.StarterGui:FindFirstChild(GuiName)
if Gui and Player.PlayerGui:FindFirstChild(GuiName) == nil then
print(Player.Name.." REQUESTED GUI "..GuiName)
Gui:Clone().Parent = Player.PlayerGui
end
end
|
--("IsASeatWeld")
|
if w.Part1.Parent:findFirstChild("Humanoid")~=nil then
|
--while true do
-- for _, player in pairs(Players:GetPlayers()) do -- loop through all the players
-- local playerRoot = player.Character and player.Character:FindFirstChild("HumanoidRootPart") -- get the player's humanoidrootpart
| |
--!strict
|
local T = require(script.Parent.Parent.Types)
|
-- Services
|
local runService = game:GetService("RunService")
local playerService = game:GetService("Players")
|
-- aboutWindow Close Button Functions
|
local topbar_acloseButton_nf = TweenService:Create(aboutCloseButton, Bar_Button_TweenInfo, button_not_focused)
local topbar_acloseButton_f = TweenService:Create(aboutCloseButton, Bar_Button_TweenInfo, button_focused)
local topbar_acloseButton_p = TweenService:Create(aboutCloseButton, Bar_Button_TweenInfo, button_pressed)
local topbar_aclosebutton_r = TweenService:Create(aboutCloseButton, Bar_Button_TweenInfo, button_released)
aboutCloseButton.MouseEnter:Connect(function()
topbar_acloseButton_f:Play()
end)
aboutCloseButton.MouseLeave:Connect(function()
topbar_acloseButton_nf:Play() -- These are all
end) -- for the closeButton
|
-- This is your invite friends plugin script! Thanks for installing.
|
game.Players.PlayerAdded:Connect(function(player)
local SocialService = game:GetService ("SocialService")
SocialService:PromptGameInvite(player)
SocialService.GameInvitePromptClosed:Connect (function(player,ids)
end)
end)
|
--]]
|
local nextTime = 0
local runService = game:service("RunService");
while Figure.Parent~=nil do
time = runService.Stepped:wait()
if time > nextTime then
move(time)
nextTime = time + 0.1
end
end
|
---- \/Ally\/
|
model = script.Parent
wait(0.5)
currentP = "Off"
script.Parent.Events.Ally.OnServerEvent:Connect( function(player, pattern)
if script.Parent.Values.Ally.Value == true then
script.Parent.Values.Ally.Value = false
else
script.Parent.Values.Ally.Value = true
end
end)
|
--GAMEPASS--OR--DevProduct--
|
local Gamepass = script.Parent.Robux.GamepassId
local GamepassInfo = MarketplaceService:GetProductInfo(Gamepass.Value, Enum.InfoType.GamePass.Name)
|
--[=[
Retrieves groupInfo about a group.
@param groupId number
@return Promise<table>
]=]
|
function GroupUtils.promiseGroupInfo(groupId)
assert(groupId, "Bad groupId")
return Promise.spawn(function(resolve, reject)
local groupInfo = nil
local ok, err = pcall(function()
groupInfo = GroupService:GetGroupInfoAsync(groupId)
end)
if not ok then
return reject(err)
end
if type(groupInfo) ~= "table" then
return reject("Rank is not a number")
end
return resolve(groupInfo)
end)
end
|
--// Commands
--// Highly recommended you disable Intellesense before editing this...
|
return function(Vargs, GetEnv)
local env = GetEnv(nil, {script = script})
setfenv(1, env)
local server = Vargs.Server
local service = Vargs.Service
local Settings = server.Settings
local Functions, Commands, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Deps
local function Init()
Functions = server.Functions;
Admin = server.Admin;
Anti = server.Anti;
Core = server.Core;
HTTP = server.HTTP;
Logs = server.Logs;
Remote = server.Remote;
Process = server.Process;
Variables = server.Variables;
Commands = server.Commands;
Deps = server.Deps;
--// Automatic New Command Caching and Ability to do server.Commands[":ff"]
setmetatable(Commands, {
__index = function(self, ind)
local targInd = Admin.CommandCache[string.lower(ind)]
if targInd then
return rawget(Commands, targInd)
end
end;
__newindex = function(self, ind, val)
rawset(Commands, ind, val)
if val and type(val) == "table" and val.Commands and val.Prefix then
for i, cmd in pairs(val.Commands) do
Admin.PrefixCache[val.Prefix] = true
Admin.CommandCache[string.lower((val.Prefix..cmd))] = ind
end
end
end;
})
Logs:AddLog("Script", "Loading Command Modules...")
--// Load command modules
if server.CommandModules then
local env = GetEnv()
for i, module in ipairs(server.CommandModules:GetChildren()) do
local func = require(module)
local ran, tab = pcall(func, Vargs, env)
if ran and tab and type(tab) == "table" then
for ind, cmd in pairs(tab) do
Commands[ind] = cmd
end
Logs:AddLog("Script", "Loaded Command Module: ".. module.Name)
elseif not ran then
warn("CMDMODULE ".. module.Name .. " failed to load:")
warn(tostring(tab))
Logs:AddLog("Script", "Loading Command Module Failed: ".. module.Name)
end
end
end
--// Cache commands
Admin.CacheCommands()
Commands.Init = nil
Logs:AddLog("Script", "Commands Module Initialized")
end;
local function RunAfterPlugins()
--// Load custom user-supplied commands in settings.Commands
for ind, cmd in pairs(Settings.Commands or {}) do
if type(cmd) == "table" and cmd.Function then
setfenv(cmd.Function, getfenv())
Commands[ind] = cmd
end
end
--// Change command permissions based on settings
local Trim = service.Trim
for ind, cmd in pairs(Settings.Permissions or {}) do
local com, level = string.match(cmd, "^(.*):(.*)")
if com and level then
if string.find(level, ",") then
local newLevels = {}
for lvl in string.gmatch(level, "[^%s,]+") do
table.insert(newLevels, Trim(lvl))
end
Admin.SetPermission(com, newLevels)
else
Admin.SetPermission(com, level)
end
end
end
--// Update existing permissions to new levels
for i, cmd in pairs(Commands) do
if type(cmd) == "table" and cmd.AdminLevel then
local lvl = cmd.AdminLevel
if type(lvl) == "string" then
cmd.AdminLevel = Admin.StringToComLevel(lvl)
--print("Changed " .. tostring(lvl) .. " to " .. tostring(cmd.AdminLevel))
elseif type(lvl) == "table" then
for b, v in pairs(lvl) do
lvl[b] = Admin.StringToComLevel(v)
end
end
if not cmd.Prefix then
cmd.Prefix = Settings.Prefix
end
if cmd.ListUpdater then
Logs.ListUpdaters[i] = function(plr, ...)
if not plr or Admin.CheckComLevel(Admin.GetLevel(plr), cmd.AdminLevel) then
if type(cmd.ListUpdater) == "function" then
return cmd.ListUpdater(plr, ...)
end
return Logs[cmd.ListUpdater]
end
end
end
end
end
Commands.RunAfterPlugins = nil
end;
server.Commands = {
Init = Init;
RunAfterPlugins = RunAfterPlugins;
};
end
|
--game.Lighting:WaitForChild("Blur").Enabled = true
--game.Lighting.ColorCorrection.Enabled = true
|
local contenProvider = game:GetService("ContentProvider")
game.Loaded:Wait()
local toLoad = workspace:GetDescendants()
local total = #toLoad
for i,v in pairs(toLoad) do
loadingScreen.Background.Counter.Text = "Loading: " .. i .. "/" .. total
contenProvider:PreloadAsync({v})
end
|
--[[**
ensures Roblox Vector3 type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
t.Vector3 = t.typeof("Vector3")
|
-----------------
--| Variables |--
-----------------
|
local DebrisService = Game:GetService('Debris')
local PlayersService = Game:GetService('Players')
local Rocket = script.Parent
local CreatorTag = Rocket:WaitForChild('creator')
local SwooshSound = Rocket:WaitForChild('Swoosh')
|
-- [TORQUE CURVE VISUAL]
-- https://www.desmos.com/calculator/nap6stpjqf
-- Use sliders to manipulate values
-- Edit everything as if your car is NATURALLY aspirated, or as if it lacks a turbo.
|
Tune.Horsepower = 250
Tune.IdleRPM = 700
Tune.PeakRPM = 7000
Tune.Redline = 8000
Tune.EqPoint = 5252
Tune.PeakSharpness = 20
Tune.CurveMult = 0.2
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
|
-- Functions to check if a mock was ever called with given arguments.
|
local getCalls = require(script.Parent.getCalls)
local cmpLiteralArgs = require(script.Parent.cmpLiteralArgs)
local cmpPredicateArgs = require(script.Parent.cmpPredicateArgs)
local fmtArgs = require(script.Parent.fmtArgs)
local AnyCallMatches = {}
function AnyCallMatches.args(mock, test)
local callList = getCalls(mock)
local size = #callList
if size == 0 then
return false, "mock was not called"
end
local msg
for i = 1, size do
local result
result, msg = test(callList[i].args)
if result then
return true
end
end
if not msg then
msg = fmtArgs(callList[size].args) .. " did not match"
end
if size > 1 then
msg = msg .. " (+" .. (size - 1) .. " other calls)"
end
return false, msg
end
function AnyCallMatches.literals(mock, ...)
local expected = table.pack(...)
return AnyCallMatches.args(mock, function(actual)
return cmpLiteralArgs(expected, actual)
end)
end
function AnyCallMatches.predicates(mock, ...)
local predicates = table.pack(...)
return AnyCallMatches.args(mock, function(actual)
return cmpPredicateArgs(predicates, actual)
end)
end
return AnyCallMatches
|
--[[**
ensures Roblox DockWidgetPluginGuiInfo type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
t.DockWidgetPluginGuiInfo = t.typeof("DockWidgetPluginGuiInfo")
|
--[=[
Ensures the computed version of a value is limited by lifetime instead
of multiple. Used in conjunction with [Blend.Children] and [Blend.Computed].
:::warning
In general, cosntructing new instances like this is a bad idea, so it's recommended against it.
:::
```lua
local render = Blend.New "ScreenGui" {
Parent = game.Players.LocalPlayer.PlayerGui;
[Blend.Children] = {
Blend.Single(Blend.Computed(percentVisible, function()
-- you generally would not want to do this anyway because this reconstructs a new frame
-- every frame.
Blend.New "Frame" {
Size = UDim2.new(1, 0, 1, 0);
BackgroundTransparency = 0.5;
};
end)
};
};
maid:GiveTask(render:Subscribe(function(gui)
print(gui)
end))
```
@function Single
@param Observable<Instance | Brio<Instance>>
@return Observable<Brio<Instance>>
@within Blend
]=]
|
function Blend.Single(observable)
return Observable.new(function(sub)
local maid = Maid.new()
maid:GiveTask(observable:Subscribe(function(result)
if Brio.isBrio(result) then
local copy = BrioUtils.clone(result)
maid._current = copy
sub:Fire(copy)
return copy
end
local current = Brio.new(result)
maid._current = current
sub:Fire(current)
return current
end))
return maid
end)
end
|
--[[
Called when the original table is changed.
This will firstly find any keys meeting any of the following criteria:
- they were not previously present
- a dependency used during generation of this value has changed
It will recalculate those key pairs, storing information about any
dependencies used in the processor callback during output key generation,
and save the new key to the output array with the same value. If it is
overwriting an older value, that older value will be passed to the
destructor for cleanup.
Finally, this function will find keys that are no longer present, and remove
their output keys from the output table and pass them to the destructor.
]]
|
function class:update(): boolean
local inputIsState = self._inputIsState
local newInputTable = if inputIsState then self._inputTable:get(false) else self._inputTable
local oldInputTable = self._oldInputTable
local outputTable = self._outputTable
local keyOIMap = self._keyOIMap
local keyIOMap = self._keyIOMap
local meta = self._meta
local didChange = false
-- clean out main dependency set
for dependency in pairs(self.dependencySet) do
dependency.dependentSet[self] = nil
end
self._oldDependencySet, self.dependencySet = self.dependencySet, self._oldDependencySet
table.clear(self.dependencySet)
-- if the input table is a state object, add it as a dependency
if inputIsState then
self._inputTable.dependentSet[self] = true
self.dependencySet[self._inputTable] = true
end
-- STEP 1: find keys that changed or were not previously present
for newInKey, value in newInputTable do
-- get or create key data
local keyData = self._keyData[newInKey]
if keyData == nil then
keyData = {
dependencySet = setmetatable({}, utility.WEAK_KEYS_METATABLE),
oldDependencySet = setmetatable({}, utility.WEAK_KEYS_METATABLE),
dependencyValues = setmetatable({}, utility.WEAK_KEYS_METATABLE),
}
self._keyData[newInKey] = keyData
end
-- check if the key is new
local shouldRecalculate = oldInputTable[newInKey] == nil
-- check if the key's dependencies have changed
if shouldRecalculate == false then
for dependency, oldValue in pairs(keyData.dependencyValues) do
if oldValue ~= dependency:get(false) then
shouldRecalculate = true
break
end
end
end
-- recalculate the output key if necessary
if shouldRecalculate then
keyData.oldDependencySet, keyData.dependencySet = keyData.dependencySet, keyData.oldDependencySet
table.clear(keyData.dependencySet)
local processOK, newOutKey, newMetaValue = Dependencies.captureDependencies(
keyData.dependencySet,
self._processor,
newInKey
)
if processOK then
if not self._destructor and (utility.needsDestruction(newOutKey) or utility.needsDestruction(newMetaValue)) then
warn("destructorNeededForKeys")
end
local oldInKey = keyOIMap[newOutKey]
local oldOutKey = keyIOMap[newInKey]
-- check for key collision
if oldInKey ~= newInKey and newInputTable[oldInKey] ~= nil then
utility.parseError("forKeysKeyCollision", tostring(newOutKey), tostring(oldInKey), tostring(newOutKey))
end
-- check for a changed output key
if oldOutKey ~= newOutKey and keyOIMap[oldOutKey] == newInKey then
-- clean up the old calculated value
local oldMetaValue = meta[oldOutKey]
local destructOK, err = xpcall(self._destructor or utility.cleanup, utility.parseError, oldOutKey, oldMetaValue)
if not destructOK then
warn("forKeysDestructorError", err)
end
keyOIMap[oldOutKey] = nil
outputTable[oldOutKey] = nil
meta[oldOutKey] = nil
end
-- update the stored data for this key
oldInputTable[newInKey] = value
meta[newOutKey] = newMetaValue
keyOIMap[newOutKey] = newInKey
keyIOMap[newInKey] = newOutKey
outputTable[newOutKey] = value
-- if we had to recalculate the output, then we did change
didChange = true
else
-- restore old dependencies, because the new dependencies may be corrupt
keyData.oldDependencySet, keyData.dependencySet = keyData.dependencySet, keyData.oldDependencySet
warn("forKeysProcessorError", newOutKey)
end
end
-- save dependency values and add to main dependency set
for dependency in pairs(keyData.dependencySet) do
keyData.dependencyValues[dependency] = dependency:get(false)
self.dependencySet[dependency] = true
dependency.dependentSet[self] = true
end
end
-- STEP 2: find keys that were removed
for outputKey, inputKey in keyOIMap do
if newInputTable[inputKey] == nil then
-- clean up the old calculated value
local oldMetaValue = meta[outputKey]
local destructOK, err = xpcall(self._destructor or utility.cleanup, utility.parseError, outputKey, oldMetaValue)
if not destructOK then
warn("forKeysDestructorError", err)
end
-- remove data
oldInputTable[inputKey] = nil
meta[outputKey] = nil
keyOIMap[outputKey] = nil
keyIOMap[inputKey] = nil
outputTable[outputKey] = nil
self._keyData[inputKey] = nil
-- if we removed a key, then the table/state changed
didChange = true
end
end
return didChange
end
local function ForKeys<KO, M>(
inputTable,
processor: (value: any) -> (KO, M?),
destructor: (KO, M?) -> ()?
)
local inputIsState = inputTable.type == "State" and typeof(inputTable.get) == "function"
local self = setmetatable({
type = "State",
kind = "ForKeys",
dependencySet = {},
-- if we held strong references to the dependents, then they wouldn't be
-- able to get garbage collected when they fall out of scope
dependentSet = setmetatable({}, utility.WEAK_KEYS_METATABLE),
_oldDependencySet = {},
_processor = processor,
_destructor = destructor,
_inputIsState = inputIsState,
_inputTable = inputTable,
_oldInputTable = {},
_outputTable = {},
_keyOIMap = {},
_keyIOMap = {},
_keyData = {},
_meta = {},
}, CLASS_METATABLE)
self:update()
return self
end
return ForKeys
|
-- Decompiled with the Synapse X Luau decompiler.
|
script.Parent.MouseButton1Click:Connect(function()
local v1 = {};
for v2, v3 in pairs(script.Parent.Parent.Parent.Parent.MainFrame.Inventory:GetChildren()) do
if v3:IsA("Frame") and v3.MassDeleteIndicator.Visible == true then
v1[#v1 + 1] = v3.PetID.Value;
end;
end;
game.ReplicatedStorage.RemoteEvents.PetActionRequest:InvokeServer("Mass Delete", {
Pets = v1
});
script.Parent.Parent.Parent.MassDelete.Value = false;
script.Parent.Parent.Visible = false;
end);
|
--[[
Calls the provided handler when any of the provided signals are fired.
Returns an array of the connections made.
Example usage:
local handler = print
local connections = connectAll(
{signalA, signalB},
handler
)
eventA:Fire("1 Hello,", "world!")
eventB:Fire("2 foo", "bar")
for _, connection in ipairs(connections) do
connection:Disconnect()
end
Output:
1 Hello, world!
2 foo bar
--]]
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Signal = require(ReplicatedStorage.Source.Signal)
type Handler = (...any) -> ...any
local function connectAll(signals: { RBXScriptSignal | Signal.ClassType }, handler: Handler)
local connections: { RBXScriptConnection | Signal.SignalConnection } = {}
for _, signal in ipairs(signals) do
local connection: RBXScriptConnection | Signal.SignalConnection = (signal :: any):Connect(handler)
table.insert(connections, connection)
end
return connections
end
return connectAll
|
---Place this INSIDE the model. Don't replace the model name or anything.
------------------------------------------------------------------------------------------
|
object = script.Parent
if (object ~= nil) and (object ~= game.Workspace) then
model = object
backup = model:clone() -- Make the backup
waitTime = 10 --Time to wait between regenerations
wait(math.random(0, waitTime))
while true do
wait(waitTime) -- Regen wait time
model:remove()
wait(2.5) -- Display regen message for this amount of time
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
message.Parent = nil
end
end
|
-- Table setup containing product IDs and functions for handling purchases
|
local productFunctions = {
[1323972481] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 5
return true
end
end;
[1323974333] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 10
return true
end
end;
[1323974716] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 50
return true
end
end;
[1323979004] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 100
return true
end
end;
[1323979357] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 500
return true
end
end;
[1323979664] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 1000
return true
end
end;
[1323980134] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 5000
return true
end
end;
[1323980633] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 10000
return true
end
end;
[1323980925] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 50000
return true
end
end;
[1323981308] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 100000
return true
end
end;
[1323981717] = function(receipt, player)
local stats = player:FindFirstChild("DonationValue")
local donation = stats
if donation then
donation.Value = donation.Value + 500000
return true
end
end;
}
MarketplaceService.ProcessReceipt = function(receiptInfo)
local playerProductKey = receiptInfo.PlayerId .. "_" .. receiptInfo.PurchaseId
local purchased = false
local success, errorMessage = pcall(function()
purchased = purchaseHistoryStore:GetAsync(playerProductKey)
end)
if success and purchased then
return Enum.ProductPurchaseDecision.PurchaseGranted
elseif not success then
error("Data store error:" .. errorMessage)
end
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
local handler = productFunctions[receiptInfo.ProductId]
local success, result = pcall(handler, receiptInfo, player)
if not success or not result then
warn("Error occurred while processing a product purchase")
print("\nProductId:", receiptInfo.ProductId)
print("\nPlayer:", player)
return Enum.ProductPurchaseDecision.NotProcessedYet
end
local success, errorMessage = pcall(function()
purchaseHistoryStore:SetAsync(playerProductKey, true)
end)
if not success then
error("Cannot save purchase data: " .. errorMessage)
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end
|
--[[
Make sure to put Menu Blur Script in StarterGui
And that you put MenuBlur in Lighting
Or paste this in the command bar:
workspace:WaitForChild("Menu Blur Script").MenuBlur.Parent = game:GetService("Lighting") wait() workspace:WaitForChild("Menu Blur Script").Parent = game:GetService("StarterGui")
]]
|
local Lighting = game:GetService("Lighting")
local MenuBluriness = Lighting.MenuBlur
local GuiService = game:GetService("GuiService")
GuiService.MenuOpened:Connect(function()
MenuBluriness.Enabled = true
wait()
MenuBluriness.Size = 24
end)
GuiService.MenuClosed:Connect(function()
MenuBluriness.Size = 12
wait()
MenuBluriness.Enabled = false
end)
|
-- Creates a spread simulator based on the weapons runtime data
-- @param WeaponRuntimeData
-- @return SpreadSimulator
|
function SpreadSimulator.New(weaponRuntimeData)
local self = {}
setmetatable(self,SpreadSimulator)
self.runtimeData = weaponRuntimeData
self.weaponDefinition = weaponRuntimeData:GetWeaponDefinition()
if not self.weaponDefinition:GetSpreadRange() then
return nil
end
-- Constants
self.minSpread = self.weaponDefinition:GetSpreadRange().x
self.maxSpread = self.weaponDefinition:GetSpreadRange().y
self.spreadIntensity = self.weaponDefinition:GetSpreadIntensity()
self.spreadReduction = self.weaponDefinition:GetSpreadReduction()
self.rng = Random.new()
-- Variables
self.currentSpread = self.minSpread
return self
end
|
--/Barrel
|
module.IsSuppressor = true
module.IsFlashHider = true
|
--None of this is mine...
|
Tool = script.Parent;
local arms = nil
local torso = nil
local welds = {}
function Equip(mouse)
wait(0.01)
arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
torso = Tool.Parent:FindFirstChild("Torso")
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = nil
sh[2].Part1 = nil
local weld1 = Instance.new("Weld")
weld1.Part0 = torso
weld1.Parent = torso
weld1.Part1 = arms[1]
weld1.C1 = CFrame.new(0.9, 0.6, 0.4) * CFrame.fromEulerAnglesXYZ(math.rad(270), math.rad(25), math.rad(0)) ---The first set of numbers changes where the arms move to the second set changes their angles
welds[1] = weld1
weld1.Name = "weld1"
local weld2 = Instance.new("Weld")
weld2.Part0 = torso
weld2.Parent = torso
weld2.Part1 = arms[2]
weld2.C1 = CFrame.new(-1, 0.6, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-20), 0) --- Same as top
welds[2] = weld2
weld2.Name = "weld2"
end
else
print("sh")
end
else
print("arms")
end
end
function Unequip(mouse)
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = arms[1]
sh[2].Part1 = arms[2]
welds[1].Parent = nil
welds[2].Parent = nil
end
else
print("sh")
end
else
print("arms")
end
end
Tool.Equipped:connect(Equip)
Tool.Unequipped:connect(Unequip)
|
--Playing Animation--
|
if enabled.Value == true then
humanim:Play()
humanim.Looped = true
humanim:AdjustSpeed(sp.Value)
end
|
--[=[
@class Trove
A Trove is helpful for tracking any sort of object during
runtime that needs to get cleaned up at some point.
]=]
|
local Trove = {}
Trove.__index = Trove
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 350 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6000 -- Use sliders to manipulate values
Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 4.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 0 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--[=[
Declarative UI system inspired by Fusion
@class Blend
]=]
|
local require = require(script.Parent.loader).load(script)
local AccelTween = require("AccelTween")
local BlendDefaultProps = require("BlendDefaultProps")
local Brio = require("Brio")
local Maid = require("Maid")
local MaidTaskUtils = require("MaidTaskUtils")
local Observable = require("Observable")
local Promise = require("Promise")
local Rx = require("Rx")
local BrioUtils = require("BrioUtils")
local RxInstanceUtils = require("RxInstanceUtils")
local RxValueBaseUtils = require("RxValueBaseUtils")
local Signal = require("Signal")
local Spring = require("Spring")
local SpringUtils = require("SpringUtils")
local StepUtils = require("StepUtils")
local ValueBaseUtils = require("ValueBaseUtils")
local ValueObject = require("ValueObject")
local ValueObjectUtils = require("ValueObjectUtils")
local Blend = {}
|
--Special Colors
--Using these options will override the RGB Colors section. Make sure that your setup is correct.
--You may only use one of these options.
|
local stillRainbow = false --Change this to true in order to enable still rainbow colors (Gradient.)
local dynamicRainbow = false --Change this to true in order to enable dynamic rainbow colors (Changes over time.)
|
--[=[
@interface ComponentConfig
@within Component
.Tag string -- CollectionService tag to use
.Ancestors {Instance}? -- Optional array of ancestors in which components will be started
.Extensions {Extension}? -- Optional array of extension objects
Component configuration passed to `Component.new`.
- If no Ancestors option is included, it defaults to `{workspace, game.Players}`.
- If no Extensions option is included, it defaults to a blank table `{}`.
]=]
|
type ComponentConfig = {
Tag: string,
Ancestors: AncestorList?,
Extensions: {Extension}?,
}
|
--This Script works for R6 R15 and Rthro!!
|
local JumpHeight = 200
local Can = true
script.Parent.Touched:Connect(function(hit)
if hit.Name == "Left Leg"
or hit.Name == "Right Leg"
or hit.Name == "Torso"
or hit.Name == "Left Arm"
or hit.Name == "Right Arm"
or hit.Name == "LeftFoot"
or hit.Name == "RightFoot"
or hit.Name == "HumanoidRootPart"
or hit.Name == "RightHand"
or hit.Name == "LeftHand"
or hit.Name == "Head" then
if Can == true then
Can = false
local Character=hit.Parent
local HumanoidRootPart=Character:WaitForChild("HumanoidRootPart")
local Boost=Instance.new("BodyPosition",HumanoidRootPart)
Boost.D=1000
Boost.P=15000
Boost.MaxForce=Vector3.new(0,100000000,0)
Boost.Position=Vector3.new(0,HumanoidRootPart.Position.Y + JumpHeight,0)
--Delete The Next Line After This One For No Sound
script.Parent.Spring:Play()
--(Not Recomended) Change To How Long The 'Boost' Exists
game.Debris:AddItem(Boost,0.6)
wait(0.75)
Can=true
end
end
end)
|
-- body[r].B.Light.Range = d2/4
|
body[r].B.Light.Brightness = d2/80
for i,v in pairs(body[r]:GetChildren()) do
if v.Name ~= "B" then
v.Transparency = 1 - (d2/80)
end
end
else
|
--[[Run]]
|
--Print Version
local ver=require(car["A-Chassis Tune"].README)
print("//INSPARE: AC6 Loaded - Build "..ver)
--Runtime Loops
-- ~60 c/s
game["Run Service"].Stepped:connect(function()
--Steering
Steering()
--RPM
RPM()
--Update External Values
_IsOn = car.DriveSeat.IsOn.Value
_InControls = script.Parent.ControlsOpen.Value
script.Parent.Values.Gear.Value = _CGear
script.Parent.Values.RPM.Value = _RPM
script.Parent.Values.Horsepower.Value = _HP
script.Parent.Values.Torque.Value = _HP * _Tune.EqPoint / _RPM
script.Parent.Values.TransmissionMode.Value = _TMode
script.Parent.Values.Throttle.Value = _GThrot
script.Parent.Values.Brake.Value = _GBrake
script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
script.Parent.Values.SteerT.Value = _GSteerT
script.Parent.Values.PBrake.Value = _PBrake
script.Parent.Values.TCS.Value = _TCS
script.Parent.Values.TCSActive.Value = _TCSActive
script.Parent.Values.ABS.Value = _ABS
script.Parent.Values.ABSActive.Value = _ABSActive
script.Parent.Values.MouseSteerOn.Value = _MSteer
script.Parent.Values.Velocity.Value = car.DriveSeat.Velocity
end)
-- ~15 c/s
while wait(.0667) do
--Power
Engine()
--Flip
if _Tune.AutoFlip then Flip() end
end
|
-----<< CONNECTIONS >>-----
|
tool.Equipped:Connect(equip)
tool.Unequipped:Connect(unequip)
game.ReplicatedStorage:WaitForChild("ROBLOX_PistolHitEvent").OnClientEvent:Connect(hitmarkerUpdate)
game.ReplicatedStorage:WaitForChild("ROBLOX_PistolShotEvent").OnClientEvent:Connect(function(mag, ammo) updateWeaponHud(mag, ammo) end)
|
--[[START]]
|
script.Parent:WaitForChild("Car")
script.Parent:WaitForChild("IsOn")
script.Parent:WaitForChild("ControlsOpen")
script.Parent:WaitForChild("Values")
|
----- Script: -----
|
Button.Activated:Connect(function()
if Information.Case.Value == 0 then
Messages.Type.SelectPackage.Value = true
Messages.FireMessage.Value = true
elseif Information.Case.Value == 1 then
BuyCaseEvents.Case1:FireServer(Information.PricePoints.Value,Information.PriceGems.Value,true)
end
end)
|
-- Do not edit these values, they are not the developer-set limits, they are limits
-- to the values the camera system equations can correctly handle
|
local MIN_ALLOWED_ELEVATION_DEG = -80
local MAX_ALLOWED_ELEVATION_DEG = 80
local externalProperties = {}
externalProperties["InitialDistance"] = 25
externalProperties["MinDistance"] = 10
externalProperties["MaxDistance"] = 100
externalProperties["InitialElevation"] = 35
externalProperties["MinElevation"] = 35
externalProperties["MaxElevation"] = 35
externalProperties["ReferenceAzimuth"] = -45 -- Angle around the Y axis where the camera starts. -45 offsets the camera in the -X and +Z directions equally
externalProperties["CWAzimuthTravel"] = 90 -- How many degrees the camera is allowed to rotate from the reference position, CW as seen from above
externalProperties["CCWAzimuthTravel"] = 90 -- How many degrees the camera is allowed to rotate from the reference position, CCW as seen from above
externalProperties["UseAzimuthLimits"] = false -- Full rotation around Y axis available by default
local Util = require(script.Parent:WaitForChild("CameraUtils"))
local CameraInput = require(script.Parent:WaitForChild("CameraInput"))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.