prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--------------------[ GUI SETUP FUNCTION ]--------------------------------------------
|
function convertKey(Key)
if Key == string.char(8) then
return "BKSPCE"
elseif Key == string.char(9) then
return "TAB"
elseif Key == string.char(13) then
return "ENTER"
elseif Key == string.char(17) then
return "UP"
elseif Key == string.char(18) then
return "DOWN"
elseif Key == string.char(19) then
return "RIGHT"
elseif Key == string.char(20) then
return "LEFT"
elseif Key == string.char(22) then
return "HOME"
elseif Key == string.char(23) then
return "END"
elseif Key == string.char(27) then
return "F2"
elseif Key == string.char(29) then
return "F4"
elseif Key == string.char(30) then
return "F5"
elseif Key == string.char(32) or Key == " " then
return "F7"
elseif Key == string.char(33) or Key == "!" then
return "F8"
elseif Key == string.char(34) or Key == '"' then
return "F9"
elseif Key == string.char(35) or Key == "#" then
return "F10"
elseif Key == string.char(37) or Key == "%" then
return "F12"
elseif Key == string.char(47) or Key == "/" then
return "R-SHIFT"
elseif Key == string.char(48) or Key == "0" then
return "L-SHIFT"
elseif Key == string.char(49) or Key == "1" then
return "R-CTRL"
elseif Key == string.char(50) or Key == "2" then
return "L-CTRL"
elseif Key == string.char(51) or Key == "3" then
return "R-ALT"
elseif Key == string.char(52) or Key == "4" then
return "L-ALT"
else
return string.upper(Key)
end
end
function createControlFrame(Key, Desc, Num)
local C = Instance.new("Frame")
C.BackgroundTransparency = ((Num % 2) == 1 and 0.7 or 1)
C.BorderSizePixel = 0
C.Name = "C"..Num
C.Position = UDim2.new(0, 0, 0, Num * 20)
C.Size = UDim2.new(1, 0, 0, 20)
C.ZIndex = 10
local K = Instance.new("TextLabel")
K.BackgroundTransparency = 1
K.Name = "Key"
K.Size = UDim2.new(0, 45, 1, 0)
K.ZIndex = 10
K.Font = Enum.Font.ArialBold
K.FontSize = Enum.FontSize.Size14
K.Text = Key
K.TextColor3 = Color3.new(1, 1, 1)
K.TextScaled = (string.len(Key) > 5)
K.TextWrapped = (string.len(Key) > 5)
K.Parent = C
local D = Instance.new("TextLabel")
D.BackgroundTransparency = 1
D.Name = "Desc"
D.Position = UDim2.new(0, 50, 0, 0)
D.Size = UDim2.new(1, -50, 1, 0)
D.ZIndex = 10
D.Font = Enum.Font.SourceSansBold
D.FontSize = Enum.FontSize.Size14
D.Text = "- "..Desc
D.TextColor3 = Color3.new(1, 1, 1)
D.TextXAlignment = Enum.TextXAlignment.Left
D.Parent = C
C.Parent = Controls
end
function createModes()
numModes = 0
for i, v in pairs(S.selectFireSettings.Modes) do
if v then
numModes = numModes + 1
end
end
local currentMode = 0
for i, v in pairs(S.selectFireSettings.Modes) do
if v then
local Frame = Instance.new("Frame")
Frame.BackgroundTransparency = 1
Frame.Name = currentMode
Frame.Position = UDim2.new()
Frame.Size = UDim2.new()
Frame.Parent = fireModes
local modeLabel = Instance.new("TextLabel")
modeLabel.BackgroundTransparency = 1
modeLabel.Name = "Label"
modeLabel.Position = UDim2.new(0, -20, 0, 0)
modeLabel.Size = UDim2.new(0, 40, 0, 20)
modeLabel.Font = Enum.Font.SourceSansBold
modeLabel.FontSize = Enum.FontSize.Size18
modeLabel.Text = string.upper(i)
modeLabel.TextColor3 = Color3.new(1, 1, 1)
modeLabel.TextScaled = true
modeLabel.TextStrokeTransparency = 0
modeLabel.TextTransparency = 0.5
modeLabel.TextWrapped = true
modeLabel.Parent = Frame
table.insert(Modes, string.upper(i))
currentMode = currentMode + 1
end
end
guiAngOffset = -15 * (numModes ^ 3) + 150 * (numModes ^ 2) - 525 * numModes + 660
end
function setUpGUI()
local currentNum = 1
for _, v in pairs(Controls:GetChildren()) do
if v.Name ~= "Title" then
v:Destroy()
end
end
for _, PTable in pairs(Plugins.KeyDown) do
createControlFrame(convertKey(PTable.Key), PTable.Description, currentNum)
currentNum = currentNum + 1
end
if S.canChangeStance then
local Dive = (S.dolphinDive and " / Dive" or "")
createControlFrame(convertKey(S.Keys.lowerStance), "Lower Stance"..Dive, currentNum)
currentNum = currentNum + 1
createControlFrame(convertKey(S.Keys.raiseStance), "Raise Stance", currentNum)
currentNum = currentNum + 1
end
if S.selectFire then
createControlFrame(convertKey(S.Keys.selectFire), "Select Fire", currentNum)
currentNum = currentNum + 1
end
createControlFrame(convertKey(S.Keys.Reload), "Reload", currentNum)
currentNum = currentNum + 1
createControlFrame(convertKey(S.Keys.Sprint), "Sprint", currentNum)
currentNum = currentNum + 1
if S.canADS then
local Hold = (S.aimSettings.holdToADS and "HOLD " or "")
if S.Keys.ADS ~= "" then
createControlFrame(Hold..convertKey(S.Keys.ADS).." OR R-MOUSE", "Aim Down Sights", currentNum)
else
createControlFrame(Hold.." R-MOUSE", "Aim Down Sights", currentNum)
end
currentNum = currentNum + 1
end
Controls.Size = UDim2.new(1, 0, 0, currentNum * 20)
Controls.Position = UDim2.new(0, 0, 0, -(currentNum * 20) - 80)
if S.guiScope then
scopeSteady.Text = "Hold "..convertKey(S.Keys.scopeSteady).." to Steady"
end
if mainGUI:FindFirstChild("Co") then
mainGUI.Co:Destroy()
end
local Co = Instance.new("TextLabel")
Co.BackgroundTransparency = 1
Co.Name = "Co"
Co.Visible = true
Co.Position = UDim2.new(0, 0, 0, 0)
Co.Size = UDim2.new(1, 0, 0, 20)
Co.Font = Enum.Font.SciFi
Co.FontSize = Enum.FontSize.Size14
Co.Text = ("")
Co.TextColor3 = Color3.new(1, 1, 1)
Co.TextStrokeColor3 = Color3.new(1, 1, 1)
Co.TextStrokeTransparency = 1
Co.TextTransparency = 0.9
Co.TextXAlignment = Enum.TextXAlignment.Center
Co.Parent = mainGUI
gunNameTitle.Text = Gun.Name
updateClipAmmo()
updateStoredAmmo()
fireModes:ClearAllChildren()
createModes()
updateModeLabels(numModes - 1, 0, 90)
if S.selectFire then
modeGUI.Text = Modes[((rawFireMode - 1) % numModes) + 1]
else
modeGUI.Text = (
S.gunType.Semi and "SEMI" or
S.gunType.Auto and "AUTO" or
S.gunType.Burst and "BURST" or
"SAFETY"
)
end
end
|
-- Placeholder texture can be any roblox asset link
|
local initialTexture = ""
local RowCount = 4
local ColCount = 4
local perImageSpriteCount = RowCount * ColCount
local width = 256
local height = 256
local framesInTotal = 15
assert(numImages * RowCount * ColCount >= framesInTotal)
local animPeriod = 1 -- period for the whole animation, in seconds
assert(animPeriod > 0)
local curImageIdx = 0
local curSpriteIdx = 0
local fps = framesInTotal / animPeriod
local accumulatedTime = 0
local function AnimateImageSpriteSheet(dt)
accumulatedTime = math.fmod(accumulatedTime + dt, animPeriod)
curSpriteIdx = math.floor(accumulatedTime * fps)
local prevImageIndex = curImageIdx
curImageIdx = math.floor(curSpriteIdx / perImageSpriteCount)
if prevImageIndex ~= curImageIdx then
imageInstance.Image = imageAssetIDs[curImageIdx + 1]
end
local localSpriteIndex = curSpriteIdx - curImageIdx * perImageSpriteCount
local row = math.floor(localSpriteIndex / ColCount)
local col = localSpriteIndex - row * ColCount
imageInstance.ImageRectOffset = Vector2.new(col * width, row * height)
end
Animator.Connection = nil
Animator.Init = function()
Animator.Connection = game:GetService("RunService").RenderStepped:Connect(AnimateImageSpriteSheet)
end
Animator.Stop = function()
if Animator.Connection then
imageInstance.Image = initialTexture
Animator.Connection:Disconnect()
end
end
return Animator
|
--// Input Connections
|
L_110_.InputBegan:connect(function(L_315_arg1, L_316_arg2)
if not L_316_arg2 and L_15_ then
if L_315_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_315_arg1.KeyCode == Enum.KeyCode.ButtonL2) and not L_79_ and not L_78_ and not L_77_ and L_24_.CanAim and not L_74_ and L_15_ and not L_66_ and not L_67_ then
if not L_64_ then
if not L_65_ then
L_157_ = 0.015
L_158_ = 7
L_3_:WaitForChild("Humanoid").WalkSpeed = 7
end
if (L_3_.Head.Position - L_5_.CoordinateFrame.p).magnitude <= 2 then
L_97_ = L_50_
end
L_136_.target = L_56_.CFrame:toObjectSpace(L_44_.CFrame).p
L_98_.SoundId = 'rbxassetid://' .. L_102_[math.random(1, #L_102_)]
L_98_:Play()
L_118_:FireServer(true)
L_64_ = true
end
end;
if L_315_arg1.KeyCode == Enum.KeyCode.A and L_15_ then
L_137_ = CFrame.Angles(0, 0, 0.1)
end;
if L_315_arg1.KeyCode == Enum.KeyCode.D and L_15_ then
L_137_ = CFrame.Angles(0, 0, -0.1)
end;
if L_315_arg1.KeyCode == Enum.KeyCode.E and L_15_ and not L_80_ and not L_81_ then
L_80_ = true
L_82_ = false
L_81_ = true
LeanRight()
end
if L_315_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and not L_80_ and not L_82_ then
L_80_ = true
L_81_ = false
L_82_ = true
LeanLeft()
end
if L_315_arg1.KeyCode == L_24_.AlternateAimKey and not L_79_ and not L_78_ and not L_77_ and L_24_.CanAim and not L_74_ and L_15_ and not L_66_ and not L_67_ then
if not L_64_ then
if not L_65_ then
L_3_.Humanoid.WalkSpeed = 10
L_158_ = 10
L_157_ = 0.008
end
L_97_ = L_50_
L_136_.target = L_56_.CFrame:toObjectSpace(L_44_.CFrame).p
L_98_.SoundId = 'rbxassetid://' .. L_102_[math.random(1, #L_102_)]
L_98_:Play()
L_118_:FireServer(true)
L_64_ = true
end
end;
if L_315_arg1.UserInputType == (Enum.UserInputType.MouseButton1 or L_315_arg1.KeyCode == Enum.KeyCode.ButtonR2) and not L_79_ and not L_77_ and L_69_ and L_15_ and not L_66_ and not L_67_ and not L_74_ then
L_68_ = true
if not Shooting and L_15_ and not L_83_ then
if L_106_ > 0 then
Shoot()
end
elseif not Shooting and L_15_ and L_83_ then
if L_108_ > 0 then
Shoot()
end
end
end;
if L_315_arg1.KeyCode == (L_24_.LaserKey or L_315_arg1.KeyCode == Enum.KeyCode.DPadRight) and L_15_ and L_24_.LaserAttached then
local L_317_ = L_1_:FindFirstChild("LaserLight")
L_125_.KeyDown[1].Plugin()
end;
if L_315_arg1.KeyCode == (L_24_.LightKey or L_315_arg1.KeyCode == Enum.KeyCode.ButtonR3) and L_15_ and L_24_.LightAttached then
local L_318_ = L_1_:FindFirstChild("FlashLight"):FindFirstChild('Light')
local L_319_ = false
L_318_.Enabled = not L_318_.Enabled
end;
if L_15_ and L_315_arg1.KeyCode == (L_24_.FireSelectKey or L_315_arg1.KeyCode == Enum.KeyCode.DPadUp) and not L_79_ and not L_70_ and not L_78_ then
L_70_ = true
if L_92_ == 1 then
if Shooting then
Shooting = false
end
if L_24_.AutoEnabled then
L_92_ = 2
L_83_ = false
L_69_ = L_84_
elseif not L_24_.AutoEnabled and L_24_.BurstEnabled then
L_92_ = 3
L_83_ = false
L_69_ = L_84_
elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then
L_92_ = 4
L_83_ = false
L_69_ = L_84_
elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then
L_92_ = 6
L_83_ = true
L_84_ = L_69_
L_69_ = L_85_
elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled then
L_92_ = 1
L_83_ = false
L_69_ = L_84_
end
elseif L_92_ == 2 then
if Shooting then
Shooting = false
end
if L_24_.BurstEnabled then
L_92_ = 3
L_83_ = false
L_69_ = L_84_
elseif not L_24_.BurstEnabled and L_24_.BoltAction then
L_92_ = 4
L_83_ = false
L_69_ = L_84_
elseif not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then
L_92_ = 6
L_83_ = true
L_84_ = L_69_
L_69_ = L_85_
elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
L_92_ = 1
L_83_ = false
L_69_ = L_84_
elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.SemiEnabled then
L_92_ = 2
L_83_ = false
L_69_ = L_84_
end
elseif L_92_ == 3 then
if Shooting then
Shooting = false
end
if L_24_.BoltAction then
L_92_ = 4
L_83_ = false
L_69_ = L_84_
elseif not L_24_.BoltAction and L_24_.ExplosiveEnabled then
L_92_ = 6
L_83_ = true
L_84_ = L_69_
L_69_ = L_85_
elseif not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
L_92_ = 1
L_83_ = false
L_69_ = L_84_
elseif not L_24_.BoltAction and not L_24_.SemiEnabled and L_24_.AutoEnabled then
L_92_ = 2
L_83_ = false
L_69_ = L_84_
elseif not L_24_.BoltAction and not L_24_.SemiEnabled and not L_24_.AutoEnabled then
L_92_ = 3
L_83_ = false
L_69_ = L_84_
end
elseif L_92_ == 4 then
if Shooting then
Shooting = false
end
if L_24_.ExplosiveEnabled then
L_92_ = 6
L_83_ = true
L_84_ = L_69_
L_69_ = L_85_
elseif not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
L_92_ = 1
L_83_ = false
L_69_ = L_84_
elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then
L_92_ = 2
L_83_ = false
L_69_ = L_84_
elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then
L_92_ = 3
L_83_ = false
L_69_ = L_84_
elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled then
L_92_ = 4
L_83_ = false
L_69_ = L_84_
end
elseif L_92_ == 6 then
if Shooting then
Shooting = false
end
L_85_ = L_69_
if L_24_.SemiEnabled then
L_92_ = 1
L_83_ = false
L_69_ = L_84_
elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then
L_92_ = 2
L_83_ = false
L_69_ = L_84_
elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then
L_92_ = 3
L_83_ = false
L_69_ = L_84_
elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then
L_92_ = 4
L_83_ = false
L_69_ = L_84_
elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction then
L_92_ = 6
L_83_ = true
L_84_ = L_69_
L_69_ = L_85_
end
end
UpdateAmmo()
FireModeAnim()
IdleAnim()
L_70_ = false
end;
if L_315_arg1.KeyCode == (Enum.KeyCode.F or L_315_arg1.KeyCode == Enum.KeyCode.DPadDown) and not L_79_ and not L_77_ and not L_78_ and not L_67_ and not L_70_ and not L_64_ and not L_66_ and not Shooting and not L_76_ then
if not L_73_ and not L_74_ then
L_74_ = true
Shooting = false
L_69_ = false
L_138_ = time()
delay(0.6, function()
if L_106_ ~= L_24_.Ammo and L_106_ > 0 then
CreateShell()
end
end)
BoltBackAnim()
L_73_ = true
elseif L_73_ and L_74_ then
BoltForwardAnim()
Shooting = false
L_69_ = true
if L_106_ ~= L_24_.Ammo and L_106_ > 0 then
L_106_ = L_106_ - 1
elseif L_106_ >= L_24_.Ammo then
L_69_ = true
end
L_73_ = false
L_74_ = false
IdleAnim()
L_75_ = false
end
UpdateAmmo()
end;
if L_315_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_315_arg1.KeyCode == Enum.KeyCode.ButtonL3) and not L_78_ and not L_77_ and L_149_ then
L_71_ = true
if L_15_ and not L_70_ and not L_67_ and L_71_ and not L_65_ and not L_74_ then
Shooting = false
L_64_ = false
L_67_ = true
delay(0, function()
if L_67_ and not L_66_ then
L_64_ = false
L_72_ = true
end
end)
L_97_ = 80
L_157_ = 0.4
L_158_ = 16
L_3_.Humanoid.WalkSpeed = L_24_.SprintSpeed
end
end;
if L_315_arg1.KeyCode == (Enum.KeyCode.R or L_315_arg1.KeyCode == Enum.KeyCode.ButtonX) and not L_79_ and not L_78_ and not L_77_ and L_15_ and not L_66_ and not L_64_ and not Shooting and not L_67_ and not L_74_ then
if not L_83_ then
if L_107_ > 0 and L_106_ < L_24_.Ammo then
Shooting = false
L_66_ = true
for L_320_forvar1, L_321_forvar2 in pairs(game.Players:GetChildren()) do
if L_321_forvar2 and L_321_forvar2:IsA('Player') and L_321_forvar2 ~= L_2_ and L_321_forvar2.TeamColor == L_2_.TeamColor then
if (L_321_forvar2.Character.HumanoidRootPart.Position - L_3_.HumanoidRootPart.Position).magnitude <= 150 then
if L_7_:FindFirstChild('AHH') and not L_7_.AHH.IsPlaying and L_24_.CanCallout then
L_122_:FireServer(L_7_.AHH, L_101_[math.random(0, 23)])
end
end
end
end
ReloadAnim()
if L_106_ <= 0 then
if not L_24_.CanSlideLock then
BoltBackAnim()
BoltForwardAnim()
end
end
IdleAnim()
L_69_ = true
if L_106_ <= 0 then
if (L_107_ - (L_24_.Ammo - L_106_)) < 0 then
L_106_ = L_106_ + L_107_
L_107_ = 0
else
L_107_ = L_107_ - (L_24_.Ammo - L_106_)
L_106_ = L_24_.Ammo
end
elseif L_106_ > 0 then
if (L_107_ - (L_24_.Ammo - L_106_)) < 0 then
L_106_ = L_106_ + L_107_ + 1
L_107_ = 0
else
L_107_ = L_107_ - (L_24_.Ammo - L_106_)
L_106_ = L_24_.Ammo + 1
end
end
L_66_ = false
if not L_75_ then
L_69_ = true
end
end;
elseif L_83_ then
if L_108_ > 0 then
Shooting = false
L_66_ = true
nadeReload()
IdleAnim()
L_66_ = false
L_69_ = true
end
end;
UpdateAmmo()
end;
if L_315_arg1.KeyCode == Enum.KeyCode.RightBracket and L_64_ then
if (L_51_ < 1) then
L_51_ = L_51_ + L_24_.SensitivityIncrement
end
end
if L_315_arg1.KeyCode == Enum.KeyCode.LeftBracket and L_64_ then
if (L_51_ > 0.1) then
L_51_ = L_51_ - L_24_.SensitivityIncrement
end
end
if L_315_arg1.KeyCode == (Enum.KeyCode.T or L_315_arg1.KeyCode == Enum.KeyCode.DPadLeft) and L_1_:FindFirstChild("AimPart2") then
if not L_86_ then
L_56_ = L_1_:WaitForChild("AimPart2")
L_50_ = L_24_.CycleAimZoom
if L_64_ then
L_97_ = L_24_.CycleAimZoom
end
L_86_ = true
else
L_56_ = L_1_:FindFirstChild("AimPart")
L_50_ = L_24_.AimZoom
if L_64_ then
L_97_ = L_24_.AimZoom
end
L_86_ = false
end;
end;
if L_315_arg1.KeyCode == L_24_.InspectionKey and not L_79_ and not L_78_ then
if not L_77_ then
L_77_ = true
InspectAnim()
IdleAnim()
L_77_ = false
end
end;
if L_315_arg1.KeyCode == L_24_.AttachmentKey and not L_79_ and not L_77_ then
if L_15_ then
if not L_78_ then
L_67_ = false
L_64_ = false
L_69_ = false
L_78_ = true
AttachAnim()
elseif L_78_ then
L_67_ = false
L_64_ = false
L_69_ = true
L_78_ = false
IdleAnim()
end
end
end;
if L_315_arg1.KeyCode == Enum.KeyCode.P and not L_77_ and not L_78_ and not L_64_ and not L_67_ and not L_65_ and not L_66_ and not Recoiling and not L_67_ then
if not L_79_ then
L_79_ = true
L_14_:Create(L_45_, TweenInfo.new(0.2), {
C1 = L_24_.SprintPos
}):Play()
wait(0.2)
L_115_:FireServer("Patrol", L_24_.SprintPos)
else
L_79_ = false
L_14_:Create(L_45_, TweenInfo.new(0.2), {
C1 = CFrame.new()
}):Play()
wait(0.2)
L_115_:FireServer("Unpatrol")
end
end;
end
end)
L_110_.InputEnded:connect(function(L_322_arg1, L_323_arg2)
if not L_323_arg2 and L_15_ then
if L_322_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_322_arg1.KeyCode == Enum.KeyCode.ButtonL2) and not L_77_ and L_24_.CanAim and not L_78_ then
if L_64_ then
if not L_65_ then
L_3_:WaitForChild("Humanoid").WalkSpeed = 16
L_157_ = 0.09
L_158_ = 11
end
L_97_ = 70
L_136_.target = Vector3.new()
L_98_.SoundId = 'rbxassetid://' .. L_103_[math.random(1, #L_103_)]
L_98_:Play()
L_118_:FireServer(false)
L_64_ = false
end
end;
if L_322_arg1.KeyCode == Enum.KeyCode.A and L_15_ then
L_137_ = CFrame.Angles(0, 0, 0)
end;
if L_322_arg1.KeyCode == Enum.KeyCode.D and L_15_ then
L_137_ = CFrame.Angles(0, 0, 0)
end;
if L_322_arg1.KeyCode == Enum.KeyCode.E and L_15_ and L_80_ then
Unlean()
L_80_ = false
L_82_ = false
L_81_ = false
end
if L_322_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and L_80_ then
Unlean()
L_80_ = false
L_82_ = false
L_81_ = false
end
if L_322_arg1.KeyCode == L_24_.AlternateAimKey and not L_77_ and L_24_.CanAim then
if L_64_ then
if not L_65_ then
L_3_.Humanoid.WalkSpeed = 16
L_158_ = 17
L_157_ = .25
end
L_97_ = 70
L_136_.target = Vector3.new()
L_136_.target = Vector3.new()
L_98_.SoundId = 'rbxassetid://' .. L_103_[math.random(1, #L_103_)]
L_118_:FireServer(false)
L_64_ = false
end
end;
if L_322_arg1.UserInputType == (Enum.UserInputType.MouseButton1 or L_322_arg1.KeyCode == Enum.KeyCode.ButtonR2) and not L_77_ then
L_68_ = false
if Shooting then
Shooting = false
end
end;
if L_322_arg1.KeyCode == Enum.KeyCode.E and L_15_ then
local L_324_ = L_42_:WaitForChild('GameGui')
if L_16_ then
L_324_:WaitForChild('AmmoFrame').Visible = false
L_16_ = false
end
end;
if L_322_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_322_arg1.KeyCode == Enum.KeyCode.ButtonL3) and not L_77_ and not L_70_ and not L_65_ then -- SPRINT
L_71_ = false
if L_67_ and not L_64_ and not Shooting and not L_71_ then
L_67_ = false
L_72_ = false
L_97_ = 70
L_3_.Humanoid.WalkSpeed = 16
L_157_ = 0.09
L_158_ = 11
end
end;
end
end)
L_110_.InputChanged:connect(function(L_325_arg1, L_326_arg2)
if not L_326_arg2 and L_15_ and L_24_.FirstPersonOnly and L_64_ then
if L_325_arg1.UserInputType == Enum.UserInputType.MouseWheel then
if L_325_arg1.Position.Z == 1 and (L_51_ < 1) then
L_51_ = L_51_ + L_24_.SensitivityIncrement
elseif L_325_arg1.Position.Z == -1 and (L_51_ > 0.1) then
L_51_ = L_51_ - L_24_.SensitivityIncrement
end
end
end
end)
L_110_.InputChanged:connect(function(L_327_arg1, L_328_arg2)
if not L_328_arg2 and L_15_ then
local L_329_, L_330_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_56_.CFrame.p, (L_56_.CFrame.lookVector).unit * 10000), IgnoreList);
if L_329_ then
local L_331_ = (L_330_ - L_6_.Position).magnitude
L_33_.Text = math.ceil(L_331_) .. ' m'
end
end
end)
|
-- To change settings, open the Config module inside of PlayerOutliner.
| |
-- Adjust torque and springs based on gravity to keep the car drivable
|
local function gravityAdjust()
local defaultGravity = 196.2
local actualGravity = Workspace.Gravity
local gravityChange = actualGravity / defaultGravity
-- Speed is adjusted so that the height of jumps is preserved
-- So maxSpeed is scaled proportionally to the sqrt of gravity
ActualDrivingTorque = VehicleParameters.DrivingTorque * gravityChange
ActualBrakingTorque = VehicleParameters.BrakingTorque * gravityChange
ActualStrutSpringStiffnessFront = VehicleParameters.StrutSpringStiffnessFront * gravityChange
ActualStrutSpringDampingFront = VehicleParameters.StrutSpringDampingFront * math.sqrt( gravityChange )
ActualStrutSpringStiffnessRear = VehicleParameters.StrutSpringStiffnessRear * gravityChange
ActualStrutSpringDampingRear = VehicleParameters.StrutSpringDampingRear * math.sqrt( gravityChange )
ActualTorsionSpringStiffness = VehicleParameters.TorsionSpringStiffness * gravityChange
ActualTorsionSpringDamping = VehicleParameters.TorsionSpringDamping * math.sqrt( gravityChange )
end
local function convertProperty(property, value)
if property == "MaxSpeed" or property == "ReverseSpeed" then
-- convert to studs/sec
return value / mphConversion
end
return value
end
local changedAttributesConnection = nil
local function updateFromConfiguration()
local obj = script.Parent.Parent
for property, value in pairs(VehicleParameters) do
local configProp = obj:GetAttribute(property)
if configProp then
VehicleParameters[property] = convertProperty(property, configProp)
end
end
-- Handle dynamic changes
changedAttributesConnection = obj.AttributeChanged:Connect(function(property)
-- Only handle attributes we're interested in
if VehicleParameters[property] == nil then
return
end
local value = obj:GetAttribute(property)
VehicleParameters[property] = convertProperty(property, value)
if DoGravityAdjust then
gravityAdjust()
end
if Chassis then
Chassis.InitializeDrivingValues() -- reinitialize chassis so that changes are reflected in the rig
end
end)
end
updateFromConfiguration()
if DoGravityAdjust then
gravityAdjust()
end
workspace.Changed:Connect(function(prop)
if prop == "Gravity" then
if DoGravityAdjust then
gravityAdjust()
end
if Chassis then
Chassis.InitializeDrivingValues() -- reinitialize chassis so that changes are reflected in the rig
end
end
end)
local Motors
local SteeringPrismatic
local RedressMount
|
--//Connections
|
event.OnClientEvent:Connect(function(jumpingPlr)
if jumpingPlr == player then return end --Don't player the effect again for our own player
local jumpingChar = jumpingPlr.Character or jumpingPlr.CharacterAdded:Wait()
JumpEffect(jumpingChar)
end)
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_SoundsMisc")
local _Tune = require(car["A-Chassis Tune"])
local on = 0
local mult=0
local det=.13
script:WaitForChild("Rel")
script:WaitForChild("Start")
script.Parent.Values.Gear.Changed:connect(function() mult=1 end)
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
handler:FireServer("newSound","Rel",car.DriveSeat,script.Rel.SoundId,0,script.Rel.Volume,true)
handler:FireServer("newSound","Start",car.DriveSeat,script.Start.SoundId,1,script.Start.Volume,false)
handler:FireServer("playSound","Rel")
car.DriveSeat:WaitForChild("Rel")
car.DriveSeat:WaitForChild("Start")
while wait() do
mult=math.max(0,mult-.1)
local _RPM = script.Parent.Values.RPM.Value
if script.Parent.Values.PreOn.Value then
handler:FireServer("playSound","Start")
wait(3.4)
else
if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
RelVolume = 3*(1 - math.min(((script.Parent.Values.RPM.Value*3)/_Tune.Redline),1))
RelPitch = (math.max((((script.Rel.SetPitch.Value + script.Rel.SetRev.Value*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),script.Rel.SetPitch.Value)) * on
end
if FE then
handler:FireServer("updateSound","Rel",script.Rel.SoundId,RelPitch,RelVolume)
else
car.DriveSeat.Rel.Volume = RelVolume
car.DriveSeat.Rel.Pitch = RelPitch
end
end
|
--[[
Controller that sets different user interface views for the client. Listens to player state updates, creating and
destructing views as necessary.
]]
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterGui = game:GetService("StarterGui")
local Players = game:GetService("Players")
local Logger = require(ReplicatedStorage.Dependencies.GameUtils.Logger)
local views = {}
local currentView
local UIController = {}
|
--config
|
local shakeRate = 2 --how often to shake the screen in seconds. 0 is default, around 0.0166 seconds.
local shakeMin = 0 --the minimum amount of shake to apply, use whole numbers only
local shakeMax = 200 --the maximum amount of shake to apply, use whole numbers only
runService.RenderStepped:Connect(function()
if elapsedTime() > nextFire then
nextFire = elapsedTime() + shakeRate
hum.CameraOffset = Vector3.new(math.random(shakeMin, shakeMax)/1000, math.random(shakeMin, shakeMax)/1000, math.random(shakeMin, shakeMax)/1000)
end
end)
|
--Variables
|
local currentHumanoid = nil
local AnimationTracks = {}
local function getLocalHumanoid()
if LocalPlayer.Character then
return LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
end
end
|
--[[
To make another trader, duplicate a trader and change the proximity prompt text in their UpperTorso
ActionText: "FinalItemName"
ObjectText = "ItemRequired: 0/AmountRequired"
]]
|
events.TradeItem.OnServerEvent:Connect(function(plr, PP, final)
local tool = plr.Character:FindFirstChildWhichIsA("Tool")
tool:Destroy()
if final then
tools[PP.ActionText]:Clone().Parent = plr.Backpack
end
end)
NPCs.Seller.UpperTorso.ProximityPrompt.Triggered:Connect(function(plr)
local char = plr.Character
if not char then return end
local tool = char:FindFirstChildWhichIsA("Tool")
if not tool or not tool:FindFirstChild("Handle") then return end
local res = tool.Handle:FindFirstChild("Price")
if res then
tool:Destroy()
plr.Wallet.Value += res.Value
end
end)
|
-- PRIVATE METHODS
|
function Zone:_calculateRegion(tableOfParts, dontRound)
local bounds = {["Min"] = {}, ["Max"] = {}}
for boundType, details in pairs(bounds) do
details.Values = {}
function details.parseCheck(v, currentValue)
if boundType == "Min" then
return (v <= currentValue)
elseif boundType == "Max" then
return (v >= currentValue)
end
end
function details:parse(valuesToParse)
for i,v in pairs(valuesToParse) do
local currentValue = self.Values[i] or v
if self.parseCheck(v, currentValue) then
self.Values[i] = v
end
end
end
end
for _, part in pairs(tableOfParts) do
local sizeHalf = part.Size * 0.5
local corners = {
part.CFrame * CFrame.new(-sizeHalf.X, -sizeHalf.Y, -sizeHalf.Z),
part.CFrame * CFrame.new(-sizeHalf.X, -sizeHalf.Y, sizeHalf.Z),
part.CFrame * CFrame.new(-sizeHalf.X, sizeHalf.Y, -sizeHalf.Z),
part.CFrame * CFrame.new(-sizeHalf.X, sizeHalf.Y, sizeHalf.Z),
part.CFrame * CFrame.new(sizeHalf.X, -sizeHalf.Y, -sizeHalf.Z),
part.CFrame * CFrame.new(sizeHalf.X, -sizeHalf.Y, sizeHalf.Z),
part.CFrame * CFrame.new(sizeHalf.X, sizeHalf.Y, -sizeHalf.Z),
part.CFrame * CFrame.new(sizeHalf.X, sizeHalf.Y, sizeHalf.Z),
}
for _, cornerCFrame in pairs(corners) do
local x, y, z = cornerCFrame:GetComponents()
local values = {x, y, z}
bounds.Min:parse(values)
bounds.Max:parse(values)
end
end
local minBound = {}
local maxBound = {}
-- Rounding a regions coordinates to multiples of 4 ensures the region optimises the region
-- by ensuring it aligns on the voxel grid
local function roundToFour(to_round)
local ROUND_TO = 4
local divided = (to_round+ROUND_TO/2) / ROUND_TO
local rounded = ROUND_TO * math.floor(divided)
return rounded
end
for boundName, boundDetail in pairs(bounds) do
for _, v in pairs(boundDetail.Values) do
local newTable = (boundName == "Min" and minBound) or maxBound
local newV = v
if not dontRound then
local roundOffset = (boundName == "Min" and -2) or 2
newV = roundToFour(v+roundOffset) -- +-2 to ensures the zones region is not rounded down/up
end
table.insert(newTable, newV)
end
end
local boundMin = Vector3.new(unpack(minBound))
local boundMax = Vector3.new(unpack(maxBound))
local region = Region3.new(boundMin, boundMax)
return region, boundMin, boundMax
end
function Zone:_displayBounds()
if not self.displayBoundParts then
self.displayBoundParts = true
local boundParts = {BoundMin = self.boundMin, BoundMax = self.boundMax}
for boundName, boundCFrame in pairs(boundParts) do
local part = Instance.new("Part")
part.Anchored = true
part.CanCollide = false
part.Transparency = 0.5
part.Size = Vector3.new(1,1,1)
part.Color = Color3.fromRGB(255,0,0)
part.CFrame = CFrame.new(boundCFrame)
part.Name = boundName
part.Parent = workspace
self.janitor:add(part, "Destroy")
end
end
end
function Zone:_update()
local container = self.container
local zoneParts = {}
local updateQueue = 0
self._updateConnections:clean()
local containerType = typeof(container)
local holders = {}
local INVALID_TYPE_WARNING = "The zone container must be a model, folder, basepart or table!"
if containerType == "table" then
for _, part in pairs(container) do
if part:IsA("BasePart") then
table.insert(zoneParts, part)
end
end
elseif containerType == "Instance" then
if container:IsA("BasePart") then
table.insert(zoneParts, container)
else
table.insert(holders, container)
for _, part in pairs(container:GetDescendants()) do
if part:IsA("BasePart") then
table.insert(zoneParts, part)
else
table.insert(holders, part)
end
end
end
end
self.zoneParts = zoneParts
self.overlapParams = {}
local allZonePartsAreBlocksNew = true
for _, zonePart in pairs(zoneParts) do
local success, shapeName = pcall(function() return zonePart.Shape.Name end)
if shapeName ~= "Block" then
allZonePartsAreBlocksNew = false
end
end
self.allZonePartsAreBlocks = allZonePartsAreBlocksNew
local zonePartsWhitelist = OverlapParams.new()
zonePartsWhitelist.FilterType = Enum.RaycastFilterType.Whitelist
zonePartsWhitelist.MaxParts = #zoneParts
zonePartsWhitelist.FilterDescendantsInstances = zoneParts
self.overlapParams.zonePartsWhitelist = zonePartsWhitelist
local zonePartsIgnorelist = OverlapParams.new()
zonePartsIgnorelist.FilterType = Enum.RaycastFilterType.Blacklist
zonePartsIgnorelist.FilterDescendantsInstances = zoneParts
self.overlapParams.zonePartsIgnorelist = zonePartsIgnorelist
-- this will call update on the zone when the container parts size or position changes, and when a
-- child is removed or added from a holder (anything which isn't a basepart)
local function update()
if self.autoUpdate then
local executeTime = os.clock()
if self.respectUpdateQueue then
updateQueue += 1
executeTime += 0.1
end
local updateConnection
updateConnection = runService.Heartbeat:Connect(function()
if os.clock() >= executeTime then
updateConnection:Disconnect()
if self.respectUpdateQueue then
updateQueue -= 1
end
if updateQueue == 0 and self.zoneId then
self:_update()
end
end
end)
end
end
local partProperties = {"Size", "Position"}
local function verifyDefaultCollision(instance)
if instance.CollisionGroupId ~= 0 then
assert(nil, "Zone parts must belong to the 'Default' (0) CollisionGroup! Consider using zone:relocate() if you wish to move zones outside of workspace to prevent them interacting with other parts.")
end
end
for _, part in pairs(zoneParts) do
for _, prop in pairs(partProperties) do
self._updateConnections:add(part:GetPropertyChangedSignal(prop):Connect(update), "Disconnect")
end
verifyDefaultCollision(part)
self._updateConnections:add(part:GetPropertyChangedSignal("CollisionGroupId"):Connect(function()
verifyDefaultCollision(part)
end), "Disconnect")
end
local containerEvents = {"ChildAdded", "ChildRemoved"}
for _, holder in pairs(holders) do
for _, event in pairs(containerEvents) do
self._updateConnections:add(self.container[event]:Connect(function(child)
if child:IsA("BasePart") then
update()
end
end), "Disconnect")
end
end
local region, boundMin, boundMax = self:_calculateRegion(zoneParts)
local exactRegion, _, _ = self:_calculateRegion(zoneParts, true)
self.region = region
self.exactRegion = exactRegion
self.boundMin = boundMin
self.boundMax = boundMax
local rSize = region.Size
self.volume = rSize.X*rSize.Y*rSize.Z
-- Update: I was going to use this for the old part detection until the CanTouch property was released
-- everything below is now irrelevant however I'll keep just in case I use again for future
-------------------------------------------------------------------------------------------------
-- When a zones region is determined, we also check for parts already existing within the zone
-- these parts are likely never to move or interact with the zone, so we set the number of these
-- to the baseline MaxParts value. 'recommendMaxParts' is then determined through the sum of this
-- and maxPartsAddition. This ultimately optimises region checks as they can be generated with
-- minimal MaxParts (i.e. recommendedMaxParts can be used instead of math.huge every time)
--[[
local result = self.worldModel:FindPartsInRegion3(region, nil, math.huge)
local maxPartsBaseline = #result
self.recommendedMaxParts = maxPartsBaseline + self.maxPartsAddition
--]]
self:_updateTouchedConnections()
self.updated:Fire()
end
function Zone:_updateOccupants(trackerName, newOccupants)
local previousOccupants = self.occupants[trackerName]
if not previousOccupants then
previousOccupants = {}
self.occupants[trackerName] = previousOccupants
end
local signalsToFire = {}
for occupant, prevItem in pairs(previousOccupants) do
local newItem = newOccupants[occupant]
if newItem == nil or newItem ~= prevItem then
previousOccupants[occupant] = nil
if not signalsToFire.exited then
signalsToFire.exited = {}
end
table.insert(signalsToFire.exited, occupant)
end
end
for occupant, _ in pairs(newOccupants) do
if previousOccupants[occupant] == nil then
local isAPlayer = occupant:IsA("Player")
previousOccupants[occupant] = (isAPlayer and occupant.Character) or true
if not signalsToFire.entered then
signalsToFire.entered = {}
end
table.insert(signalsToFire.entered, occupant)
end
end
return signalsToFire
end
function Zone:_formTouchedConnection(triggerType)
local touchedJanitorName = "_touchedJanitor"..triggerType
local touchedJanitor = self[touchedJanitorName]
if touchedJanitor then
touchedJanitor:clean()
else
touchedJanitor = self.janitor:add(Janitor.new(), "destroy")
self[touchedJanitorName] = touchedJanitor
end
self:_updateTouchedConnection(triggerType)
end
function Zone:_updateTouchedConnection(triggerType)
local touchedJanitorName = "_touchedJanitor"..triggerType
local touchedJanitor = self[touchedJanitorName]
if not touchedJanitor then return end
for _, basePart in pairs(self.zoneParts) do
touchedJanitor:add(basePart.Touched:Connect(self.touchedConnectionActions[triggerType], self), "Disconnect")
end
end
function Zone:_updateTouchedConnections()
for triggerType, _ in pairs(self.touchedConnectionActions) do
local touchedJanitorName = "_touchedJanitor"..triggerType
local touchedJanitor = self[touchedJanitorName]
if touchedJanitor then
touchedJanitor:cleanup()
self:_updateTouchedConnection(triggerType)
end
end
end
function Zone:_disconnectTouchedConnection(triggerType)
local touchedJanitorName = "_touchedJanitor"..triggerType
local touchedJanitor = self[touchedJanitorName]
if touchedJanitor then
touchedJanitor:cleanup()
self[touchedJanitorName] = nil
end
end
local function round(number, decimalPlaces)
return math.round(number * 10^decimalPlaces) * 10^-decimalPlaces
end
function Zone:_partTouchedZone(part)
local trackingDict = self.trackingTouchedTriggers["part"]
if trackingDict[part] then return end
local nextCheck = 0
local verifiedEntrance = false
local enterPosition = part.Position
local enterTime = os.clock()
local partJanitor = self.janitor:add(Janitor.new(), "destroy")
trackingDict[part] = partJanitor
local instanceClassesToIgnore = {Seat = true, VehicleSeat = true}
local instanceNamesToIgnore = {HumanoidRootPart = true}
if not (instanceClassesToIgnore[part.ClassName] or not instanceNamesToIgnore[part.Name]) then
part.CanTouch = false
end
--
local partVolume = round((part.Size.X * part.Size.Y * part.Size.Z), 5)
self.totalPartVolume += partVolume
--
partJanitor:add(heartbeat:Connect(function()
local clockTime = os.clock()
if clockTime >= nextCheck then
----
local cooldown = enum.Accuracy.getProperty(self.accuracy)
nextCheck = clockTime + cooldown
----
-- We initially perform a singular point check as this is vastly more lightweight than a large part check
-- If the former returns false, perform a whole part check in case the part is on the outer bounds.
local withinZone = self:findPoint(part.CFrame)
if not withinZone then
withinZone = self:findPart(part)
end
if not verifiedEntrance then
if withinZone then
verifiedEntrance = true
self.partEntered:Fire(part)
elseif (part.Position - enterPosition).Magnitude > 1.5 and clockTime - enterTime >= cooldown then
-- Even after the part has exited the zone, we track it for a brief period of time based upon the criteria
-- in the line above to ensure the .touched behaviours are not abused
partJanitor:cleanup()
end
elseif not withinZone then
verifiedEntrance = false
enterPosition = part.Position
enterTime = os.clock()
self.partExited:Fire(part)
end
end
end), "Disconnect")
partJanitor:add(function()
trackingDict[part] = nil
part.CanTouch = true
self.totalPartVolume = round((self.totalPartVolume - partVolume), 5)
end, true)
end
local partShapeActions = {
["Ball"] = function(part)
return "GetPartBoundsInRadius", {part.Position, part.Size.X}
end,
["Block"] = function(part)
return "GetPartBoundsInBox", {part.CFrame, part.Size}
end,
["Other"] = function(part)
return "GetPartsInPart", {part}
end,
}
function Zone:_getRegionConstructor(part, overlapParams)
local success, shapeName = pcall(function() return part.Shape.Name end)
local methodName, args
if success and self.allZonePartsAreBlocks then
local action = partShapeActions[shapeName]
if action then
methodName, args = action(part)
end
end
if not methodName then
methodName, args = partShapeActions.Other(part)
end
if overlapParams then
table.insert(args, overlapParams)
end
return methodName, args
end
|
-- Services
|
local DataStoreService = game:GetService("DataStoreService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
--Made by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
CoilSound = Handle:WaitForChild("CoilSound")
EqualizingForce = (236 / 1.2) -- amount of force required to levitate a mass
Gravity = 0.85 -- things float at > 1
GhostEffect = nil
MassCon1 = nil
MassCon2 = nil
function GetTotalMass(root)
local force = 0
for _, obj in pairs(root:GetChildren()) do
if obj:IsA("BasePart") then
force = force + obj:GetMass() * EqualizingForce * Gravity
end
force = force + GetTotalMass(obj)
end
return force
end
function OnMassChanged(child, character)
if GhostEffect and GhostEffect.Parent then
GhostEffect.force = Vector3.new(0, GetTotalMass(Character), 0)
end
end
function UpdateGhostState(Unequipped)
if Unequipped then
GhostEffect:Destroy()
GhostEffect = nil
MassCon1:disconnect()
MassCon2:disconnect()
else
if not GhostEffect then
GhostEffect = Instance.new("BodyForce")
GhostEffect.Name = "GravityCoilEffect"
GhostEffect.force = Vector3.new(0, GetTotalMass(Character), 0)
GhostEffect.Parent = Head
MassCon1 = Character.ChildAdded:connect(function(Child)
OnMassChanged(Child, Character)
end)
MassCon2 = Character.ChildRemoved:connect(function(Child)
OnMassChanged(Child, Character)
end)
end
end
end
function OnEquipped()
Character = Tool.Parent
Head = Character:FindFirstChild("Head")
if not Head or not Head.Parent then
return
end
CoilSound:Play()
UpdateGhostState(false)
end
function OnUnequipped()
UpdateGhostState(true)
end
Tool.Equipped:connect(OnEquipped)
Tool.Unequipped:connect(OnUnequipped)
|
-- ScreenSpace -> WorldSpace. Taking a screen width that you want that object to be
-- and a world width that is the size of that object, and returning the position to
-- put that object at to satisfy those.
|
function ScreenSpace.ScreenToWorldByWidth(x, y, screenWidth, worldWidth)
local aspectRatio = ScreenSpace.AspectRatio()
local hfactor = math.tan(math.rad(workspace.CurrentCamera.FieldOfView)/2)
local wfactor = aspectRatio*hfactor
local sx, sy = ScreenSpace.ViewSizeX(), ScreenSpace.ViewSizeY()
--
local depth = - (sx * worldWidth) / (screenWidth * 2 * wfactor)
--
local xf, yf = x/sx*2 - 1, y/sy*2 - 1
local xpos = xf * -wfactor * depth
local ypos = yf * hfactor * depth
--
return Vector3.new(xpos, ypos, depth)
end
return ScreenSpace
|
-- ROBLOX deviation start: no Omit utility in Luau
|
type AsymmetricMatchersOmitAnyAndAnything = {
arrayContaining: (Array<unknown>) -> AsymmetricMatcher,
objectContaining: (Record<string, unknown>) -> AsymmetricMatcher,
stringContaining: (string) -> AsymmetricMatcher,
stringMatching: (string | RegExp) -> AsymmetricMatcher,
}
type AsymmetricMatchers = {
any: (unknown) -> AsymmetricMatcher,
anything: () -> AsymmetricMatcher,
} & AsymmetricMatchersOmitAnyAndAnything
|
-- Loading
|
local CutsceneFolder = workspace.Cutscenes:WaitForChild("welcome") -- The folder that contains the cutscene data (Cameras...)
local Destroy = true -- Destroy folder after loading? you don't want your player to see your cameras floating around!
local NoYield = false -- Generally you want this to be set to false, because loading takes a little bit of time, and you don't want to interact with the cutscene when it's not loaded
local SafeMode = true -- This is adviced to be turned on, especially if the cutscene folder data is too big to load at one frame. when turned on, it loads a camera every frame, not all at once.
local Cutscene = require(CutsceneModule)
local Demo = Cutscene.new(Camera, Looping, Speed, FreezeControls) -- Create cutscene
Demo:Load(CutsceneFolder, Destroy, NoYield, SafeMode) -- Load cutscene data from folder
local PlayOnPartTouch = script:FindFirstChild("PlayOnPartTouch")
local PlayOnPlayerJoin = script:FindFirstChild("PlayOnPlayerJoin")
local PlayOnCharacterAdded = script:FindFirstChild("PlayOnCharacterAdded")
local PlayOnCharacterDied = script:FindFirstChild("PlayOnCharacterDied")
local PlayOnEventFire = script:FindFirstChild("PlayOnEventFire")
local PlayOnRemoteEventFire = script:FindFirstChild("PlayOnEventFire")
local ProtectTheCharacterWhilePlaying = script:FindFirstChild("ProtectTheCharacterWhilePlaying")
local CharacterProtector = script:FindFirstChild("CharacterProtector")
local Music = script:FindFirstChild("Music")
local StopMusicWhenFinished = script:FindFirstChild("StopMusicWhenFinished")
local StopOnEventFire = script:FindFirstChild("StopOnEventFire")
local StopOnRemoteEventFire = script:FindFirstChild("StopOnRemoteEventFire")
local PlayOnce = script:FindFirstChild("PlayOnce")
local Debounce = script:FindFirstChild("Cooldown")
local OnFinishedRemove = script:FindFirstChild("OnFinishedRemove")
local bin = true
local Player = game:GetService("Players").LocalPlayer
local CutsceneGui = script:FindFirstChild("Cutscene")
|
-- Decompiled with the Synapse X Luau decompiler.
|
client = nil;
cPcall = nil;
Pcall = nil;
Routine = nil;
service = nil;
gTable = nil;
return function(p1)
local l__Parent__1 = script.Parent.Parent;
local l__PlayerGui__2 = service.PlayerGui;
local l__Message__3 = p1.Message;
if p1.Time then
end;
local v4 = {
Type = "Hint",
Title = "Hint",
Message = l__Message__3,
Icon = "rbxassetid://7501175708",
Time = os.date("%X"),
Function = nil
};
table.insert(client.Variables.CommunicationsHistory, v4);
service.Events.CommsCenter:Fire(v4);
local v5 = client.UI.Get("HintHolder", nil, true);
if not v5 then
local v6 = service.New("ScreenGui");
local v7 = client.UI.Register(v6);
local v8 = service.New("ScrollingFrame", v6);
client.UI.Prepare(v6);
v7.Name = "HintHolder";
v8.Name = "Frame";
v8.BackgroundTransparency = 1;
v8.Size = UDim2.new(1, 0, 0, 150);
v8.CanvasSize = UDim2.new(0, 0, 0, 0);
v8.ChildAdded:Connect(function(p2)
if #v8:GetChildren() == 0 then
v8.Visible = false;
return;
end;
v8.Visible = true;
end);
v8.ChildRemoved:Connect(function(p3)
if #v8:GetChildren() == 0 then
v8.Visible = false;
return;
end;
v8.Visible = true;
end);
v5 = v7;
v7:Ready();
end;
local l__Frame__9 = v5.Object.Frame;
if client.UI.Get("Notif") then
local v10 = 30;
else
v10 = 0;
end;
if client.UI.Get("TopBar") then
local v11 = 40;
else
v11 = 0;
end;
l__Frame__9.Position = UDim2.new(0, 0, 0, v10 + v11 - 35);
local v12 = l__Frame__9:GetChildren();
l__Parent__1.Position = UDim2.new(0, 0, 0, -100);
l__Parent__1.Frame.msg.Text = l__Message__3;
local l__X__13 = l__Parent__1.Frame.msg.TextBounds.X;
local function v14(p4, p5)
p4 = p4 and 0;
local v15 = #l__Frame__9:GetChildren();
for v16, v17 in pairs(l__Frame__9:GetChildren()) do
if v17 ~= p5 then
v17.Position = UDim2.new(0, 0, 0, (v16 + p4) * 28);
if v16 ~= v15 then
v17.Size = UDim2.new(1, 0, 0, 28);
end;
end;
end;
end;
local v18 = -1;
v14(-1);
l__Parent__1.Parent = l__Frame__9;
if #l__Frame__9:GetChildren() > 5 then
v18 = -2;
end;
UDim2.new(0, 0, 0, (#l__Frame__9:GetChildren() + v18) * 28);
v14(-1);
if #l__Frame__9:GetChildren() > 5 then
local v19 = l__Frame__9:GetChildren()[1];
v14(-2, v19);
v19:Destroy();
end;
wait(p1.Time and 5);
if l__Parent__1 and l__Parent__1.Parent then
v14(-2, l__Parent__1);
l__Parent__1:Destroy();
end;
end;
|
--[[
___ _______ _ _______
/ _ |____/ ___/ / ___ ____ ___ (_)__ /__ __/
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< / /
/_/ |_| \___/_//_/\_,_/___/___/_/___/ /_/
SecondLogic @ Inspare
Avxnturador @ Novena
]]
|
local autoscaling = false --Estimates top speed
local UNITS = { --Click on speed to change units
--First unit is default
{
units = "MPH" ,
scaling = (10/12) * (60/88) , -- 1 stud : 10 inches | ft/s to MPH
maxSpeed = 230 ,
spInc = 20 , -- Increment between labelled notches
},
{
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
}
}
|
-- This module creates BodyVelocities for certain actions such as pushing and knockback.
|
return
function(Strength, Duration, Parent)
local Velocity = Instance.new('BodyVelocity')
Velocity.Name = 'Velocity'
Velocity.MaxForce = Vector3.new(1, 1, 1) * math.huge
Velocity.Velocity = Strength
Velocity.Parent = Parent
game:GetService('Debris'):AddItem(Velocity, Duration)
end
|
--[[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 ]]
|
-- Establishes level of debug output that should occur
|
Logger.setCutoff(Logger.LOG_LEVEL.Warn)
UserInput.init()
UIController.init()
ClientVehicleManager.init()
CameraController.init()
ClientPlayerStatusHandler.init()
ReplicatedStorage:FindFirstChild("Menu").Parent = workspace
if game.PlaceId ~= 0 and RunService:IsClient() then
translateDataModel()
end
Logger.log("Client tasks completed")
|
--end)
--[[ Last synced 7/22/2022 04:44 --No backdoors. --[[ ]]
|
--
|
-- Each note takes up exactly 8 seconds in audio. i.e C2 lasts 8 secs, C2# lasts 8 secs, C3 lasts 8 secs, C3# lasts 8 secs etc. for each audio
-- These are the IDs of the piano sounds.
|
settings.SoundSource = Piano.Keys.KeyBox
settings.CameraCFrame = CFrame.new(
(Box.CFrame * CFrame.new(0, 0, 1)).p, -- +z is towards player
(Box.CFrame * CFrame.new(0, 0, 0)).p
)
|
-- This is the same as Icon.new(), except it adds additional behaviour for certain specified names designed to mimic core icons, such as 'Chat'
|
function Icon.mimic(coreIconToMimic)
local iconName = coreIconToMimic.."Mimic"
local icon = IconController.getIcon(iconName)
if icon then
return icon
end
icon = Icon.new()
icon:setName(iconName)
if coreIconToMimic == "Chat" then
icon:setOrder(-1)
icon:setImage("rbxasset://textures/ui/TopBar/chatOff.png", "deselected")
icon:setImage("rbxasset://textures/ui/TopBar/chatOn.png", "selected")
icon:setImageYScale(0.625)
-- Since roblox's core gui api sucks melons I reverted to listening for signals within the chat modules
-- unfortunately however they've just gone and removed *these* signals therefore
-- this mimic chat and similar features are now impossible to recreate accurately, so I'm disabling for now
-- ill go ahead and post a feature request; fingers crossed we get something by the next decade
--[[
-- Setup maid and cleanup actioon
local maid = icon._maid
icon._fakeChatMaid = maid:give(Maid.new())
maid.chatMimicCleanup = function()
starterGui:SetCoreGuiEnabled("Chat", icon.enabled)
end
-- Tap into chat module
local chatMainModule = players.LocalPlayer.PlayerScripts:WaitForChild("ChatScript").ChatMain
local ChatMain = require(chatMainModule)
local function displayChatBar(visibility)
icon.ignoreVisibilityStateChange = true
ChatMain.CoreGuiEnabled:fire(visibility)
ChatMain.IsCoreGuiEnabled = false
ChatMain:SetVisible(visibility)
icon.ignoreVisibilityStateChange = nil
end
local function setIconEnabled(visibility)
icon.ignoreVisibilityStateChange = true
ChatMain.CoreGuiEnabled:fire(visibility)
icon:setEnabled(visibility)
starterGui:SetCoreGuiEnabled("Chat", false)
icon:deselect()
icon.updated:Fire()
icon.ignoreVisibilityStateChange = nil
end
-- Open chat via Slash key
icon._fakeChatMaid:give(userInputService.InputEnded:Connect(function(inputObject, gameProcessedEvent)
if gameProcessedEvent then
return "Another menu has priority"
elseif not(inputObject.KeyCode == Enum.KeyCode.Slash or inputObject.KeyCode == Enum.SpecialKey.ChatHotkey) then
return "No relavent key pressed"
elseif ChatMain.IsFocused() then
return "Chat bar already open"
elseif not icon.enabled then
return "Icon disabled"
end
ChatMain:FocusChatBar(true)
icon:select()
end))
-- ChatActive
icon._fakeChatMaid:give(ChatMain.VisibilityStateChanged:Connect(function(visibility)
if not icon.ignoreVisibilityStateChange then
if visibility == true then
icon:select()
else
icon:deselect()
end
end
end))
-- Keep when other icons selected
icon.deselectWhenOtherIconSelected = false
-- Mimic chat notifications
icon._fakeChatMaid:give(ChatMain.MessagesChanged:connect(function()
if ChatMain:GetVisibility() == true then
return "ChatWindow was open"
end
icon:notify(icon.selected)
end))
-- Mimic visibility when StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, state) is called
coroutine.wrap(function()
runService.Heartbeat:Wait()
icon._fakeChatMaid:give(ChatMain.CoreGuiEnabled:connect(function(newState)
if icon.ignoreVisibilityStateChange then
return "ignoreVisibilityStateChange enabled"
end
local topbarEnabled = starterGui:GetCore("TopbarEnabled")
if topbarEnabled ~= IconController.previousTopbarEnabled then
return "SetCore was called instead of SetCoreGuiEnabled"
end
if not icon.enabled and userInputService:IsKeyDown(Enum.KeyCode.LeftShift) and userInputService:IsKeyDown(Enum.KeyCode.P) then
icon:setEnabled(true)
else
setIconEnabled(newState)
end
end))
end)()
icon.deselected:Connect(function()
displayChatBar(false)
end)
icon.selected:Connect(function()
displayChatBar(true)
end)
setIconEnabled(starterGui:GetCoreGuiEnabled("Chat"))
--]]
end
return icon
end
|
--[=[
Instantiates a new Janitor object.
@return Janitor
]=]
|
function Janitor.new()
return setmetatable({
CurrentlyCleaning = false;
[IndicesReference] = nil;
}, Janitor)
end
export type Janitor = typeof(Janitor.new())
return Janitor
|
--// All global vars will be wiped/replaced except script
|
return function(data, env)
if env then
setfenv(1, env)
end
local playergui = service.PlayerGui
local localplayer = service.Players.LocalPlayer
local scr = client.UI.Prepare(script.Parent.Parent)
local main = scr.Main
local t1 = main.Title
local t2 = main.Message
local msg = data.Message
local color = data.Color
local found = client.UI.Get("Output")
if found then
for i,v in pairs(found) do
local p = v.Object
if p and p.Parent then
p.Main.Position = UDim2.new(0, 0, 0.35, p.Main.Position.Y.Offset+50)
end
end
end
t2.Text = msg
spawn(function()
local sound = Instance.new("Sound",service.LocalContainer())
sound.SoundId = "rbxassetid://7152562261"
sound.Volume = 0.1
sound:Play()
wait(0.8)
sound:Destroy()
end)
main.Size = UDim2.new(1, 0, 0, 0)
gTable.Ready()
main:TweenSize(UDim2.new(1, 0, 0, 50), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.1)
wait(5)
gTable.Destroy()
end
|
--Close MainFrame
|
function module:CloseMainFrame()
TopBarButton.ImageRectOffset = Vector2.new(0,0)
mainFrame.Visible = false
end
module:CloseMainFrame()
updateDragBar()
|
-- setup emote chat hook
--Game.Players.LocalPlayer.Chatted:connect(function(msg)
-- local emote = ""
-- if (string.sub(msg, 1, 3) == "/e ") then
-- emote = string.sub(msg, 4)
-- elseif (string.sub(msg, 1, 7) == "/emote ") then
-- emote = string.sub(msg, 8)
-- end
--
-- if (pose == "Standing" and emoteNames[emote] ~= nil) then
-- playAnimation(emote, 0.1, Humanoid)
-- end
-- print("===> " .. string.sub(msg, 1, 3) .. "(" .. emote .. ")")
--end)
| |
--[=[
Gets the value in the children
@param parent Instance
@param instanceType string
@param name string
@param default any?
@return any
]=]
|
function ValueBaseUtils.getValue(parent, instanceType, name, default)
assert(typeof(parent) == "Instance", "Bad argument 'parent'")
assert(type(instanceType) == "string", "Bad argument 'instanceType'")
assert(type(name) == "string", "Bad argument 'name'")
local foundChild = parent:FindFirstChild(name)
if foundChild then
if foundChild:IsA(instanceType) then
return foundChild.Value
else
warn(("[ValueBaseUtils.getValue] - Value of type %q of name %q is of type %q in %s instead")
:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
return nil
end
else
return default
end
end
|
--[[
Fired when state is left
]]
|
function Transitions.onLeaveWarmup(stateMachine, event, from, to, playerComponent)
PlayerWarmup.leave(stateMachine, playerComponent)
end
|
--// SS3 controls for AC6 by Itzt, originally for 2014 Infiniti QX80. i don't know how to tune ac lol
|
wait(0.1)
local player = game.Players.LocalPlayer
local HUB = script.Parent.HUB
local TR = script.Parent.Tracker
local limitButton = HUB.Name
local lightOn = false
local Camera = game.Workspace.CurrentCamera
local cam = script.Parent.nxtcam.Value
local carSeat = script.Parent.CarSeat.Value
local mouse = game.Players.LocalPlayer:GetMouse()
local windows = false
local winfob = HUB.Parent.Windows
|
--[[
Indents a list of strings and then concatenates them together with newlines
into a single string.
]]
|
local function indentLines(lines, indentLevel)
local outputBuffer = {}
for _, line in ipairs(lines) do
table.insert(outputBuffer, indent(line, indentLevel))
end
return table.concat(outputBuffer, "\n")
end
local logInfoMetatable = {}
|
-- functions
|
local function ProcessReceipt(receiptInfo)
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if player then
if receiptInfo.ProductId == TIER_SKIP_ID then
print(player.Name .. " skipped a tier")
local success = script.Parent.Ranking.RankingScript.SkipTier:Invoke(player)
if success then
return Enum.ProductPurchaseDecision.PurchaseGranted
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
elseif CURRENCY_IDS[receiptInfo.ProductId] then
local tickets = CURRENCY_IDS[receiptInfo.ProductId]
local playerData = PLAYER_DATA:FindFirstChild(player.Name)
if playerData then
print(player, "purchased", tickets, "tickets")
playerData.Currency.Tickets.Value = playerData.Currency.Tickets.Value + tickets
local success = script.Parent.DataScript.SaveData:Invoke(player)
if success then
return Enum.ProductPurchaseDecision.PurchaseGranted
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
end
else
return Enum.ProductPurchaseDecision.NotProcessedYet
end
end
|
-- ================================================================================
-- LOCAL FUNCTIONS
-- ================================================================================
-- Apply Gamepad Deadzone
|
local function ApplyDeadzone(n)
if math.abs(n) < GAMEPAD_DEADZONE then return 0 end
return (n + (n > 0 and -GAMEPAD_DEADZONE or GAMEPAD_DEADZONE)) / (1 - GAMEPAD_DEADZONE)
end -- ApplyDeadzone()
local function UpdateBoost(boost, step)
-- Update boost amount
if boost and boostAmount > step then
boostAmount = boostAmount - step
elseif ((boostAmount >= 0) and (boostAmount < maxBoostAmount)) then
-- Restore boost when boost is off (restores at half speed of use rate)
boostAmount = boostAmount + step/2
boost = false
end
return boost
end
|
-- Basic settings
|
local ROTATION_SPEED = math.pi * 4.5
local plr = game.Players.LocalPlayer
local tweenService = game:GetService("TweenService")
game.ReplicatedStorage.Interactions.Client.BeginKnifeThrow.OnClientEvent:connect(function(knife, rotateAxis, velocity)
-- Connect end knife throw
local stopLoop = false
local finalCFrame = nil
local endEvent = game.ReplicatedStorage.Interactions.Client.EndKnifeThrow.OnClientEvent:connect(function(otherKnife, cframe)
if otherKnife == knife then
stopLoop = true
finalCFrame = cframe
end
end)
-- Make knife move smoothly
local currentTween = nil
while not stopLoop do
-- Wait
local waitTime = wait()
-- Tween
local rotateAmt = rotateAxis * (-ROTATION_SPEED) * waitTime
local goal = {
CFrame = (knife.CFrame + (velocity * waitTime)) * CFrame.fromEulerAnglesXYZ(rotateAmt.X, rotateAmt.Y, rotateAmt.Z)
}
currentTween = tweenService:Create(knife, TweenInfo.new(waitTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), goal)
currentTween:Play()
end
-- Disconnect event
endEvent:disconnect()
-- End tween
if currentTween ~= nil then
currentTween:Cancel()
end
-- Set final CFrame
if knife.Parent ~= nil and finalCFrame ~= nil then
knife.CFrame = finalCFrame
end
end)
|
-- Modifies an array of path parts in place by interpreting "." and ".." segments
|
function Path:_normalizeArray(parts: Array<string>, isrelative: boolean)
local skip = 0
for i = #parts, 1, -1 do
local part = parts[i]
if part == "." then
table.remove(parts, i)
elseif part == ".." then
table.remove(parts, i)
skip = skip + 1
elseif skip > 0 then
table.remove(parts, i)
skip = skip - 1
end
end
if isrelative then
while skip > 0 do
table.insert(parts, 1, "..")
skip = skip - 1
end
end
end
function Path:_splitBySeparators(filepath: string)
local parts = {}
for part in filepath:gmatch("[^" .. self.sep .. "]+") do
parts[#parts + 1] = part
end
return parts
end
function Path:normalize(filepath: string)
filepath = self:normalizeSeparators(filepath)
local is_absolute = self:isAbsolute(filepath)
local root = is_absolute and self:getRoot(filepath) or nil
local trailing_slash = filepath:sub(#filepath) == self.sep
if root then
filepath = filepath:sub(root:len() + 1)
end
local parts = self:_splitBySeparators(filepath)
self:_normalizeArray(parts, not is_absolute)
filepath = table.concat(parts, self.sep)
if #filepath == 0 then
if is_absolute then
return root
end
return "."
end
if trailing_slash then
filepath = filepath .. self.sep
end
if is_absolute then
filepath = root .. filepath
end
return filepath
end
function Path:_filterparts(parts: Array<string>)
local filteredparts = {}
-- filter out empty parts
for i, part in ipairs(parts) do
if part and part ~= "" then
table.insert(filteredparts, part)
end
end
for i, part in ipairs(filteredparts) do
-- Strip leading slashes on all but first item
if i > 1 then
while part:sub(1, 1) == self.sep do
part = part:sub(2)
end
end
-- Strip trailing slashes on all but last item
if i < #filteredparts then
while part:sub(#part) == self.sep do
part = part:sub(1, #part - 1)
end
end
filteredparts[i] = part
end
return filteredparts
end
function Path:_rawjoin(parts: Array<string>)
return table.concat(parts, self.sep)
end
function Path:_filteredjoin(...: string)
local parts: Array<string> = { ... }
for i, part in ipairs(parts) do
parts[i] = self:normalizeSeparators(part)
end
local filteredparts = self:_filterparts(parts)
local joined = self:_rawjoin(filteredparts)
return joined, filteredparts
end
function Path:join(...: string)
local joined = self:_filteredjoin(...)
return self:normalize(joined)
end
|
----------------//
|
UIS.InputBegan:connect(function(i,GP) if not GP then if i.KeyCode == KeyCode then Inn:play() end end end)
UIS.InputEnded:connect(function(i,GP) if not GP then if i.KeyCode == KeyCode then Out:play() end end end)
|
-- ROBLOX TODO: Not sure how to model this, upstream: https://github.com/facebook/flow/blob/main/tests/react_instance/class.js#L10
-- ROBLOX FIXME Luau: if I make this Object, we run into normalization issues: '{| current: React_ElementRef<any>? |}' could not be converted into '(((?) -> any) | {| current: ? |})?
|
export type React_ElementRef<C> = C
export type React_Ref<ElementType> =
{ current: React_ElementRef<ElementType> | nil }
| ((React_ElementRef<ElementType> | nil) -> ())
|
-- Note: Overrides base class GetIsJumping with get-and-clear behavior to do a single jump
-- rather than sustained jumping. This is only to preserve the current behavior through the refactor.
|
function DynamicThumbstick:GetIsJumping()
local wasJumping = self.isJumping
self.isJumping = false
return wasJumping
end
function DynamicThumbstick:Enable(enable: boolean?, uiParentFrame): boolean?
if enable == nil then return false end -- If nil, return false (invalid argument)
enable = enable and true or false -- Force anything non-nil to boolean before comparison
if self.enabled == enable then return true end -- If no state change, return true indicating already in requested state
if enable then
-- Enable
if not self.thumbstickFrame then
self:Create(uiParentFrame)
end
self:BindContextActions()
else
ContextActionService:UnbindAction(DYNAMIC_THUMBSTICK_ACTION_NAME)
-- Disable
self:OnInputEnded() -- Cleanup
end
self.enabled = enable
self.thumbstickFrame.Visible = enable
return nil
end
|
--- Skill
|
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Debounce = true
Player = game.Players.LocalPlayer
local Track1 : Animation = script:WaitForChild("Anim01")
Track1 = Player.Character:WaitForChild("Humanoid"):LoadAnimation(script.Anim01)
local PrevWalkSpeed = nil
local Tween = game:GetService("TweenService")
local Gui = Player.PlayerGui:WaitForChild("Mochi_Skill_List".. Player.Name):WaitForChild("Frame")
local Cooldown = 5
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.X and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "None" then
Tool.Active.Value = "2BurningDough"
PrevWalkSpeed = Player.Character:WaitForChild("Humanoid").WalkSpeed
Gui:FindFirstChild(Tool.Active.Value).Frame.Size = UDim2.new(1, 0, 1, 0)
Player.Character:WaitForChild("Humanoid").WalkSpeed = 5
Track1:Play()
Track1:AdjustSpeed(0)
wait(0.15)
script.Fire:FireServer("hold")
end
end)
UIS.InputEnded:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.X and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "2BurningDough" then
Debounce = false
Tool.Active.Value = "2BurningDough"
Track1:AdjustSpeed(1)
wait(0.1)
script.Fire:FireServer(plr)
local hum = Player.Character.Humanoid
for i = 1,10 do
wait()
hum.CameraOffset = Vector3.new(
math.random(-1,1),
math.random(-1,1),
math.random(-1,1))
end
hum.CameraOffset = Vector3.new(0,0,0)
Tween:Create(Gui:FindFirstChild(Tool.Active.Value).Frame, TweenInfo.new(Cooldown), {Size = UDim2.new(0, 0, 1, 0)}):Play()
Tool.Active.Value = "None"
Player.Character:WaitForChild("Humanoid").WalkSpeed = PrevWalkSpeed
wait(Cooldown)
Debounce = true
end
end)
|
-- connect up
|
function stopLoopedSounds()
sRunning:Stop()
sClimbing:Stop()
sSwimming:Stop()
end
if hasPlayer == nil then
Humanoid.Died:connect(onDied)
Humanoid.Running:connect(onRunning)
Humanoid.Swimming:connect(onSwimming)
Humanoid.Climbing:connect(onClimbing)
Humanoid.Jumping:connect(function(state) onStateNoStop(state, sJumping) prevState = "Jump" end)
Humanoid.GettingUp:connect(function(state) stopLoopedSounds() onStateNoStop(state, sGettingUp) prevState = "GetUp" end)
Humanoid.FreeFalling:connect(function(state) stopLoopedSounds() onStateFall(state, sFreeFalling) prevState = "FreeFall" end)
Humanoid.FallingDown:connect(function(state) stopLoopedSounds() end)
Humanoid.StateChanged:connect(function(old, new)
if not (new.Name == "Dead" or
new.Name == "Running" or
new.Name == "RunningNoPhysics" or
new.Name == "Swimming" or
new.Name == "Jumping" or
new.Name == "GettingUp" or
new.Name == "Freefall" or
new.Name == "FallingDown") then
stopLoopedSounds()
end
end)
end
|
--[[
{Madwork}
-[RateLimiter]---------------------------------------
Prevents RemoteEvent spamming; Player references are automatically removed as they leave
Members:
RateLimiter.Default [RateLimiter]
Functions:
RateLimiter.NewRateLimiter(rate) --> [RateLimiter]
rate [number] -- Events per second allowed; Excessive events are dropped
Methods [RateLimiter]:
RateLimiter:CheckRate(source) --> is_to_be_processed [bool] -- Whether event should be processed
source [any]
RateLimiter:CleanSource(source) -- Forgets about the source - must be called for any object that
has been passed to RateLimiter:CheckRate() after that object is no longer going to be used;
Does not have to be called for Player instances!
RateLimiter:Cleanup() -- Forgets all sources
RateLimiter:Destroy() -- Make the RateLimiter module forget about this RateLimiter object
--]]
|
local SETTINGS = {
DefaultRateLimiterRate = 120,
}
|
--[=[
@param observer (any) -> nil
@return Connection
Observes the value of the property. The observer will
be called right when the value is first ready, and
every time the value changes. This is safe to call
immediately (i.e. no need to use `IsReady` or `OnReady`
before using this method).
Observing is essentially listening to `Changed`, but
also sends the initial value right away (or at least
once `OnReady` is completed).
```lua
local function ObserveValue(value)
print(value)
end
clientRemoteProperty:Observe(ObserveValue)
```
]=]
|
function ClientRemoteProperty:Observe(observer: (any) -> nil)
if self._ready then
task.defer(observer, self._value)
end
return self.Changed:Connect(observer)
end
|
-- Code for handling controls of various data types --
|
local Controls = {}
Controls["default"] = function(object, propertyData, readOnly)
local propertyName = propertyData["Name"]
local propertyType = propertyData["ValueType"]
local box = CreateTextBox(readOnly)
box.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
box.Position = UDim2.new(0, Styles.Margin, 0, 0)
local function update()
local value = object[propertyName]
box.Text = ToString(value, propertyType.Name)
end
if not readOnly then
box.FocusLost:connect(function(enterPressed)
Set(object, propertyData, ToValue(box.Text,propertyType.Name))
update()
end)
end
update()
object.Changed:connect(function(property)
if (property == propertyName) then
update()
end
end)
return box
end
Controls["bool"] = function(object, propertyData, readOnly)
local propertyName = propertyData["Name"]
local checked = object[propertyName]
local checkbox, setValue = CreateCheckbox(checked, readOnly, function(value)
Set(object, propertyData, not checked)
end)
checkbox.Position = UDim2.new(0, Styles.Margin, 0, Styles.Margin)
setValue(checked)
local function update()
checked = object[propertyName]
setValue(checked)
end
object.Changed:connect(function(property)
if (property == propertyName) then
update()
end
end)
if object:IsA("BoolValue") then
object.Changed:connect(function(val)
update()
end)
end
update()
return checkbox
end
Controls["BrickColor"] = function(object, propertyData, readOnly)
local propertyName = propertyData["Name"]
local frame,label,brickColorBox = CreateBrickColor(readOnly, function(brickColor)
Set(object, propertyData, brickColor)
end)
local function update()
local value = object[propertyName]
brickColorBox.BackgroundColor3 = value.Color
label.Text = tostring(value)
end
update()
object.Changed:connect(function(property)
if (property == propertyName) then
update()
end
end)
return frame
end
Controls["Color3"] = function(object, propertyData, readOnly)
local propertyName = propertyData["Name"]
local frame,textBox,colorBox = CreateColor3Control(readOnly)
textBox.FocusLost:connect(function(enterPressed)
Set(object, propertyData, ToValue(textBox.Text,"Color3"))
local value = object[propertyName]
colorBox.BackgroundColor3 = value
textBox.Text = ToString(value, "Color3")
end)
local function update()
local value = object[propertyName]
colorBox.BackgroundColor3 = value
textBox.Text = ToString(value, "Color3")
end
update()
object.Changed:connect(function(property)
if (property == propertyName) then
update()
end
end)
return frame
end
Controls["Enum"] = function(object, propertyData, readOnly)
local propertyName = propertyData["Name"]
local propertyType = propertyData["ValueType"]
local enumName = object[propertyName].Name
local enumNames = {}
for _,enum in pairs(Enum[tostring(propertyType.Name)]:GetEnumItems()) do
table.insert(enumNames, enum.Name)
end
local dropdown, propertyLabel = CreateDropDown(enumNames, enumName, readOnly, function(value)
Set(object, propertyData, value)
end)
--dropdown.Parent = frame
local function update()
local value = object[propertyName].Name
propertyLabel.Text = tostring(value)
end
update()
object.Changed:connect(function(property)
if (property == propertyName) then
update()
end
end)
return dropdown
end
Controls["Object"] = function(object, propertyData, readOnly)
local propertyName = propertyData["Name"]
local propertyType = propertyData["ValueType"]
local box = CreateObject(readOnly,function()end)
box.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0)
box.Position = UDim2.new(0, Styles.Margin, 0, 0)
local function update()
if AwaitingObjectObj == object then
if AwaitingObjectValue == true then
box.Text = "Select an Object"
return
end
end
local value = object[propertyName]
box.Text = ToString(value, propertyType.Name)
end
if not readOnly then
box.MouseButton1Click:connect(function()
if AwaitingObjectValue then
AwaitingObjectValue = false
update()
return
end
AwaitingObjectValue = true
AwaitingObjectObj = object
AwaitingObjectProp = propertyData
box.Text = "Select an Object"
end)
box.Cancel.Visible = true
box.Cancel.MouseButton1Click:connect(function()
object[propertyName] = nil
end)
end
update()
object.Changed:connect(function(property)
if (property == propertyName) then
update()
end
end)
if object:IsA("ObjectValue") then
object.Changed:connect(function(val)
update()
end)
end
return box
end
function GetControl(object, propertyData, readOnly)
local propertyType = propertyData["ValueType"]
local control = nil
if propertyType.Category == "Enum" and RbxApi.Enums[propertyType.Name] then
control = Controls["Enum"](object, propertyData, readOnly)
elseif propertyType.Category == "Class" and RbxApi.Classes[propertyType.Name] then
control = Controls["Object"](object, propertyData, readOnly)
elseif Controls[propertyType.Name] then
control = Controls[propertyType.Name](object, propertyData, readOnly)
else
control = Controls["default"](object, propertyData, readOnly)
end
return control
end
|
-- Looking for how exactly to set up your background music? Open the Readme/Instructions script!
|
local settings = {}
settings.UseGlobalBackgroundMusic = true -- If you want to play Global Background Music for everyone in your game, set this to true.
settings.UseMusicZones = true -- If you are using the Background Music Zones to play specific music in certain areas, set this to true.
|
-- if human.Health <= 0 then
-- torso.Velocity = (torso.Position - position).unit * 10;
-- print("Dead");
-- end
|
print("Took "..(100-(distance-radius)*(100/radius)).." Damage")
end
elseif human2 then
distance = (position-origPos).magnitude
|
-- Decompiled with the Synapse X Luau decompiler.
|
client = nil;
cPcall = nil;
Pcall = nil;
Routine = nil;
service = nil;
gTable = nil;
return function(p1)
local l__PlayerGui__1 = service.Players.LocalPlayer.PlayerGui;
local l__Parent__2 = script.Parent.Parent;
local l__Frame__3 = l__Parent__2.Frame;
local l__ScrollingFrame__4 = l__Parent__2.Frame.ScrollingFrame;
local v5 = client.Remote.Get("Setting", { "SplitKey", "ConsoleKeyCode", "BatchKey", "Prefix" });
local v6 = client.Remote.Get("FormattedCommands") or {};
local v7 = UDim2.new(0.36, 0, 0, 47);
local v8 = UDim2.new(0.32, 0, 0.353, 0);
local v9 = UDim2.new(0.32, 0, 0, -200);
local v10 = TweenInfo.new(0.15);
local v11 = service.TweenService:Create(l__Frame__3, v10, {
Size = UDim2.new(0.36, 0, 0, 200)
});
local v12 = service.TweenService:Create(l__Frame__3, v10, {
Size = v7
});
l__Frame__3.Position = v9;
l__Frame__3.Visible = false;
l__Frame__3.Size = v7;
l__ScrollingFrame__4.Visible = false;
client.Variables.ChatEnabled = service.StarterGui:GetCoreGuiEnabled("Chat");
client.Variables.PlayerListEnabled = service.StarterGui:GetCoreGuiEnabled("PlayerList");
local u1 = false;
local l__PlayerList__2 = l__Parent__2.Frame.PlayerList;
local u3 = service.TweenService:Create(l__Frame__3, v10, {
Position = v9
});
local u4 = false;
local u5 = service.TweenService:Create(l__Frame__3, v10, {
Position = v8
});
local l__TextBox__6 = l__Parent__2.Frame.TextBox;
local function u7()
if l__Parent__2:IsDescendantOf(game) and not u1 then
u1 = true;
l__ScrollingFrame__4:ClearAllChildren();
l__ScrollingFrame__4.CanvasSize = UDim2.new(0, 0, 0, 0);
l__ScrollingFrame__4.ScrollingEnabled = false;
l__Frame__3.Size = v7;
l__ScrollingFrame__4.Visible = false;
l__PlayerList__2.Visible = false;
scrollOpen = false;
u3:Play();
u1 = false;
u4 = false;
end;
end;
l__TextBox__6.FocusLost:Connect(function(p2)
if p2 and l__TextBox__6.Text ~= "" and string.len(l__TextBox__6.Text) > 1 then
client.Remote.Send("ProcessCommand", l__TextBox__6.Text);
end;
u7();
end);
local function u8()
if l__Parent__2:IsDescendantOf(game) and not u1 then
u1 = true;
l__ScrollingFrame__4.ScrollingEnabled = true;
l__PlayerList__2.ScrollingEnabled = true;
u5:Play();
l__Frame__3.Size = v7;
l__ScrollingFrame__4.Visible = false;
l__PlayerList__2.Visible = false;
scrollOpen = false;
l__TextBox__6.Text = "";
l__Frame__3.Visible = true;
l__Frame__3.Position = v8;
l__TextBox__6:CaptureFocus();
l__TextBox__6.Text = "";
wait();
l__TextBox__6.Text = "";
u1 = false;
u4 = true;
end;
end;
local l__Prefix__9 = v5.Prefix;
local l__BatchKey__10 = v5.BatchKey;
local l__SplitKey__11 = v5.SplitKey;
local l__Entry__12 = l__Parent__2.Entry;
l__TextBox__6.Changed:Connect(function(p3)
if p3 ~= "Text" or l__TextBox__6.Text == "" or not u8 then
if p3 == "Text" and l__TextBox__6.Text == "" and u4 then
v12:Play();
l__ScrollingFrame__4.Visible = false;
l__PlayerList__2.Visible = false;
scrollOpen = false;
l__ScrollingFrame__4:ClearAllChildren();
l__ScrollingFrame__4.CanvasSize = UDim2.new(0, 0, 0, 0);
end;
return;
end;
if string.sub(l__TextBox__6.Text, string.len(l__TextBox__6.Text)) == "\t" then
if l__PlayerList__2:FindFirstChild("Entry 0") then
l__TextBox__6.Text = (string.sub(l__TextBox__6.Text, 1, string.len(l__TextBox__6.Text) - 1) .. l__PlayerList__2["Entry 0"].Text) .. " ";
elseif l__ScrollingFrame__4:FindFirstChild("Entry 0") then
l__TextBox__6.Text = string.split(l__ScrollingFrame__4["Entry 0"].Text, "<")[1];
else
l__TextBox__6.Text = l__TextBox__6.Text .. l__Prefix__9;
end;
l__TextBox__6.CursorPosition = string.len(l__TextBox__6.Text) + 1;
l__TextBox__6.Text = string.gsub(l__TextBox__6.Text, "\t", "");
end;
l__ScrollingFrame__4:ClearAllChildren();
l__PlayerList__2:ClearAllChildren();
local v13 = l__TextBox__6.Text;
if string.match(v13, ".*" .. l__BatchKey__10 .. "([^']+)") then
v13 = string.match(string.match(v13, ".*" .. l__BatchKey__10 .. "([^']+)"), "^%s*(.-)%s*$");
end;
local v14 = 0;
local v15 = string.match(v13, ".+" .. l__SplitKey__11 .. "(.*)$");
local l__next__16 = next;
local v17, v18 = service.Players:GetPlayers();
while true do
local v19, v20 = l__next__16(v17, v18);
if not v19 then
break;
end;
v18 = v19;
if v15 then
if string.sub(string.lower(tostring(v20)), 1, #v15) == string.lower(v15) or string.match(v13, l__SplitKey__11 .. "$") then
local v21 = l__Entry__12:Clone();
v21.Text = tostring(v20);
v21.Name = "Entry " .. v14;
v21.TextXAlignment = "Right";
v21.Visible = true;
v21.Parent = l__PlayerList__2;
v21.Position = UDim2.new(0, 0, 0, 20 * v14);
v21.MouseButton1Down:Connect(function()
l__TextBox__6.Text = l__TextBox__6.Text .. tostring(v20);
l__TextBox__6:CaptureFocus();
end);
v14 = v14 + 1;
end;
elseif string.match(v13, l__SplitKey__11 .. "$") then
v21 = l__Entry__12:Clone();
v21.Text = tostring(v20);
v21.Name = "Entry " .. v14;
v21.TextXAlignment = "Right";
v21.Visible = true;
v21.Parent = l__PlayerList__2;
v21.Position = UDim2.new(0, 0, 0, 20 * v14);
v21.MouseButton1Down:Connect(function()
l__TextBox__6.Text = l__TextBox__6.Text .. tostring(v20);
l__TextBox__6:CaptureFocus();
end);
v14 = v14 + 1;
end;
end;
l__PlayerList__2.CanvasSize = UDim2.new(0, 0, 0, v14 * 20);
local v22 = 0;
for v23, v24 in next, v6 do
if string.sub(string.lower(v24), 1, #v13) == string.lower(v13) or string.find(string.lower(v24), string.match(string.lower(v13), "^(.-)" .. l__SplitKey__11) or string.lower(v13), 1, true) then
if not scrollOpen then
v11:Play();
l__ScrollingFrame__4.Visible = true;
l__PlayerList__2.Visible = true;
scrollOpen = true;
end;
local v25 = l__Entry__12:Clone();
v25.Visible = true;
v25.Parent = l__ScrollingFrame__4;
v25.Text = v24;
v25.Name = "Entry " .. v22;
v25.Position = UDim2.new(0, 0, 0, 20 * v22);
v25.MouseButton1Down:Connect(function()
l__TextBox__6.Text = v25.Text;
l__TextBox__6:CaptureFocus();
end);
v22 = v22 + 1;
end;
end;
if v22 > 0 then
l__Frame__3.Size = UDim2.new(0.36, 0, 0, math.clamp(math.max(v22, v14) * 20 + 53, 47, 200));
else
l__PlayerList__2.Visible = false;
l__Frame__3.Size = v7;
end;
l__ScrollingFrame__4.CanvasSize = UDim2.new(0, 0, 0, v22 * 20);
end);
local l__ConsoleKeyCode__13 = v5.ConsoleKeyCode;
gTable.BindEvent(service.UserInputService.InputBegan, function(p4)
if not service.UserInputService:GetFocusedTextBox() and rawequal(p4.UserInputType, Enum.UserInputType.Keyboard) and p4.KeyCode.Name == (client.Variables.CustomConsoleKey or l__ConsoleKeyCode__13) then
if u4 then
u7();
else
u8();
end;
client.Variables.ConsoleOpen = u4;
end;
end);
gTable:Ready();
end;
|
-- Color shortcuts: you can use these strings instead of defining exact color values
|
richText.ColorShortcuts = {}
richText.ColorShortcuts.White = Color3.new(1, 1, 1)
richText.ColorShortcuts.Black = Color3.new(0, 0, 0)
richText.ColorShortcuts.Red = Color3.new(1, 0.4, 0.4)
richText.ColorShortcuts.Green = Color3.new(0.4, 1, 0.4)
richText.ColorShortcuts.Blue = Color3.new(0.4, 0.4, 1)
richText.ColorShortcuts.Cyan = Color3.new(0.4, 0.85, 1)
richText.ColorShortcuts.Orange = Color3.new(1, 0.5, 0.2)
richText.ColorShortcuts.Yellow = Color3.new(1, 0.9, 0.2)
|
--Stoppie tune
|
local StoppieD = 15
local StoppieTq = 65
local StoppieP = 10
local StoppieMultiplier = 1
local StoppieDivider = 2
local clock = .0667 --How fast your wheelie script refreshes
|
--// Ammo Settings
|
Ammo = 6;
StoredAmmo = 6;
MagCount = math.huge; -- If you want infinate ammo, set to math.huge EX. MagCount = math.huge;
ExplosiveAmmo = 0;
|
--adjustspeed
|
function module.adjustSpeed(anim, hum ,speed)
local animation = hum.Animator:LoadAnimation(animFold[anim])
animation:Play()
animation:AdjustSpeed(speed)
end
|
--Itochu Code Panel Script
|
Codes = {1234,1337,9001} --Your code(Support multiple codes)
Input = ""
InputDisabled = false
Code = true
Panel = script.Parent
if Code then Panel.Code.Material = "Neon" end
function DoInput(Data)
if InputDisabled or not Code then return end
if string.len(Input) ~= 4 then
Input = Input..Data
end
if string.len(Input) == 4 then
local Accepted = false
for _,l in pairs(Codes) do
if tostring(l) == Input then Accepted = true end
end
if Accepted then
Panel.Code.Material = "SmoothPlastic"
Panel.Access.Material = "Neon"
YourFunc()
else
Panel.Code.Material = "SmoothPlastic"
Panel.Denied.Material = "Neon"
end
wait(2)
Input = ""
if Code then
Panel.Code.Material = "Neon"
end
Panel.Access.Material = "SmoothPlastic"
Panel.Denied.Material = "SmoothPlastic"
end
end
function YourFunc() --Script your function here
script.Parent.Parent.Open.Value = true --For Teknikk Automatic Door
end
for _,l in pairs(script.Parent:GetChildren()) do
if l.Name:sub(1,3) == "BTN" then
l.ClickDetector.mouseClick:connect(function()
DoInput(tonumber(l.Name:sub(4)))
end)
end
end
for _,l in pairs(script.Parent:GetChildren()) do
if l.Name:sub(1,2) == "BT" then
l.ClickDetector.mouseClick:connect(function()
Panel.Main.Beep:Play()
end)
end
end
|
-- Gyroscopic controller for mobile device (if enabled)
|
if UseGyroSteering.Value == true and UserInputService.TouchEnabled == true and UserInputService.GyroscopeEnabled == true then
|
--[[
Calculates test totals, verifies the tree is valid, and returns results.
]]
|
function TestSession:finalize()
if #self.nodeStack ~= 0 then
error("Cannot finalize TestResults with nodes still on the stack!", 2)
end
self:calculateTotals()
self:gatherErrors()
return self.results
end
|
-- local gateControlNewClone = gateControlNew:Clone()
-- gateControlNewClone.Parent = touchToClaim
-- gateControlNewClone.Disabled = false
|
--local gateControlNewClone = gateControlNew:Clone()
--gateControlNewClone.Parent = touchToClaim
--gateControlNewClone.Disabled = false
|
--[[
Server Module
--]]
|
local Settings = { --, not ; ? | server module!!
BulletHoleTexture = 'http://www.roblox.com/asset/?id=64291961'
,Damage = {40, 60}
,OneHanded = false --DONT USE YET
,FakeArms = true
,FakeArmTransparency = 0
,RightPos = CFrame.new(-1,0.7,0.45) * CFrame.Angles(math.rad(-90), 0, 0)
,LeftPos = CFrame.new(0.8,0.8,0.3) * CFrame.Angles(math.rad(-90), math.rad(45), 0)
}
return Settings
|
-- Customization
|
AntiTK = false; -- Set to false to allow TK and damaging of NPC, true for no TK. (To damage NPC, this needs to be false)
MouseSense = 0.5;
CanAim = true; -- Allows player to aim
CanBolt = false; -- When shooting, if this is enabled, the bolt will move (SCAR-L, ACR, AK Series)
LaserAttached = false;
LightAttached = false;
TracerEnabled = false;
SprintSpeed = 0;
CanCallout = false;
SuppressCalloutChance = 0;
|
--Categorises a model based on the location of the start and end points of the path in the model
|
function RoomPackager:CategoriseModel(pathModel)
if pathModel:FindFirstChild("EndParts") then
return game.ReplicatedStorage.PathModules.Branch
elseif pathModel.ObjectPrimaryPart.PathName.Value == "Start" then
return game.ReplicatedStorage.PathModules.StartModule
elseif pathModel.Start.Position.Y < pathModel.End.Position.Y - 5 then
return game.ReplicatedStorage.PathModules.GoingUp
elseif pathModel.Start.Position.Y > pathModel.End.Position.Y + 5 then
return game.ReplicatedStorage.PathModules.GoingDown
else
return game.ReplicatedStorage.PathModules.SameHeight
end
end
local function addBehavioursRecur(model, behaviourFolder)
local children = model:GetChildren()
for i = 1, #children do
if children[i]:isA("BasePart") then
behaviourFolder:Clone().Parent = children[i]
else
addBehavioursRecur(children[i], behaviourFolder)
end
end
end
RoomPackager.setUpBehaviours = function(roomModel)
if roomModel:FindFirstChild("Behaviours") then
addBehavioursRecur(roomModel, roomModel.Behaviours)
return
end
local children = roomModel:GetChildren()
for i = 1, #children do
RoomPackager.setUpBehaviours(children[i])
end
end
function RoomPackager:PackageRoom(roomBasePlate)
local roomModel = Instance.new("Model")
roomModel.Name = roomBasePlate.PathName.Value
roomModel.Parent = game.ReplicatedStorage.PathModules
local region = self:RegionFromBasePlate(roomBasePlate)
local modelFound = false
--Repeatedly finds 100 parts in the region, if the parts are seperated into different models more than 100 parts can be used
while true do
local parts = game.Workspace:FindPartsInRegion3(region, nil, 100)
for _, part in pairs(parts) do
if part.Name == "End" and roomModel:FindFirstChild("End") then
local endsModel = Instance.new("Model") --Used for branching the path
endsModel.Name = "EndParts"
endsModel.Parent = roomModel
part.Parent = endsModel
roomModel:FindFirstChild("End").Parent = endsModel
elseif part.Name == "End" and roomModel:FindFirstChild("EndParts") then
part.Parent = roomModel:FindFirstChild("EndParts")
else
local topLevelParent = closestParentToWorkspace(part)
if topLevelParent ~= nil then
if topLevelParent ~= part.Parent then
--A model has been found, this means we will search again for more parts in the region
modelFound = true
end
topLevelParent.Parent = roomModel
end
end
end
if modelFound == false then
break
else
modelFound = false
end
end
--Set-up model for use in the path (parts for locating the path are made transparent)
roomModel.ObjectPrimaryPart.Transparency = 1
roomModel.Start.Transparency = 1
if roomModel:FindFirstChild("EndParts") then
local ends = roomModel:FindFirstChild("EndParts"):GetChildren()
for i = 1, #ends do
ends[i].Transparency = 1
end
else
roomModel.End.Transparency = 1
end
roomModel.PrimaryPart = roomModel.ObjectPrimaryPart
roomModel.Parent = self:CategoriseModel(roomModel)
RoomPackager.setUpBehaviours(roomModel)
return roomModel
end
return RoomPackager
|
----------------------------------------------------------------------------------------------------
------------------=[ Status UI ]=-------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,EnableStatusUI = true --- Don't disabled it...
,RunWalkSpeed = 24
,NormalWalkSpeed = 12
,SlowPaceWalkSpeed = 6
,CrouchWalkSpeed = 6
,ProneWalksSpeed = 3
,InjuredWalksSpeed = 8
,InjuredCrouchWalkSpeed = 4
,EnableHunger = true --- Hunger and Thirst system (Removed)
,HungerWaitTime = 25
,CanDrown = true --- Glub glub glub *ded*
,EnableStamina = true --- Weapon Sway based on stamina (Unused)
,RunValue = 1 --- Stamina consumption
,StandRecover = .25 --- Stamina recovery while stading
,CrouchRecover = .5 --- Stamina recovery while crouching
,ProneRecover = 1 --- Stamina recovery while lying
,EnableGPS = true --- GPS shows your allies around you
,GPSdistance = 150
,InteractionMenuKey = Enum.KeyCode.LeftAlt
,BuildingEnabled = true
,BuildingKey = Enum.KeyCode.RightAlt
|
--Hinge Creation--
|
local wheelFL = Instance.new("HingeConstraint", FL)
wheelFL.Attachment0 = FL.Attachment
wheelFL.Attachment1 = xSSL.Attachment
wheelFL.ActuatorType = "Motor"
wheelFL.MotorMaxTorque = 200000
local wheelFR = Instance.new("HingeConstraint", FR)
wheelFR.Attachment0 = FR.Attachment
wheelFR.Attachment1 = xSSR.Attachment
wheelFR.ActuatorType = "Motor"
wheelFR.MotorMaxTorque = 200000
local wheelRL = Instance.new("HingeConstraint", RL)
wheelRL.Attachment0 = RL.Attachment
wheelRL.Attachment1 = zBRL.Wheel
wheelRL.ActuatorType = "Motor"
wheelRL.MotorMaxTorque = 200000
local wheelRR = Instance.new("HingeConstraint", RR)
wheelRR.Attachment0 = RR.Attachment
wheelRR.Attachment1 = zBRR.Wheel
wheelRR.ActuatorType = "Motor"
wheelRR.MotorMaxTorque = 200000
|
--(FL.RotVelocity.Magnitude+FR.RotVelocity.Magnitude+RL.RotVelocity.Magnitude+RR.RotVelocity.Magnitude+(speed/1.33034))/5
|
while wait() do
speed = carSeat.Velocity.Magnitude
power = 0
average = 10*(1-(carSeat.Storage.BrakeBias.Value/100))
track = carSeat.Velocity.Unit*carSeat.CFrame.lookVector
slipDetection = track.X+track.Z
Right = (carSeat.Parent.Parent.Wheels.RR.Wheel.Velocity.Magnitude+carSeat.Parent.Parent.Wheels.FR.Wheel.Velocity.Magnitude)/2
Left = (carSeat.Parent.Parent.Wheels.RL.Wheel.Velocity.Magnitude+carSeat.Parent.Parent.Wheels.FL.Wheel.Velocity.Magnitude)/2
if Right > Left then
left = true
else
left = false
end
if script.OVERRIDE.Value == false then
if carSeat.Storage.ASC.Value == true then
if speed > 45 then
if carSeat.Steer ~= 0 then
if slipDetection < 0.995 and left == true then
script.Toggle.Value = true
carSeat.Storage.TC.Value = true
else
script.Toggle.Value = false
carSeat.Storage.TC.Value = false
end
elseif carSeat.Steer == 0 then
if slipDetection < 0.99984 and left == true then
--carSeat.Storage.TC.Value = true
--script.Toggle.Value = true
else
script.Toggle.Value = false
carSeat.Storage.TC.Value = false
end
else
script.Toggle.Value = false
end
else script.Toggle.Value = false
end
--else script.Toggle.Value = false
end
if speed > 0 then
if script.Parent.Parent.Storage.Brake.Value ~= 0 or script.Toggle.Value == true then
if FL.RotVelocity.Magnitude + power > average then
script.Read.Value = true
FLBRAKE.CanCollide = true
FLBRAKEU.CanCollide = true --print("FL")
elseif FL.RotVelocity.Magnitude + power < average then
script.Read.Value = false
FLBRAKE.CanCollide = false
FLBRAKEU.CanCollide = false
end
elseif script.Parent.Parent.Storage.Brake.Value == 0 and script.Toggle.Value == false then
script.Read.Value = false
FLBRAKE.CanCollide = false
FLBRAKEU.CanCollide = false
end
end
else
FLBRAKE.CanCollide = true
FLBRAKEU.CanCollide = true
end
end
|
--[[Engine]]
|
local fFD = _Tune.FinalDrive*_Tune.FDMult
local fFDr = fFD*30/math.pi
local cGrav = workspace.Gravity*_Tune.InclineComp/32.2
local wDRatio = wDia*math.pi/60
local cfWRot = CFrame.Angles(math.pi/2,-math.pi/2,0)
local cfYRot = CFrame.Angles(0,math.pi,0)
local rtTwo = (2^.5)/2
|
------------------------------------------------------------------
|
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Plane = Character.Plane
local AutoCrash = Plane.AutoCrash
local Crashed = Plane.Crashed
local Weapons = Plane.Weapons
local MainParts = Plane.MainParts
local Gear = MainParts.Gear
local Engine = MainParts.Engine
local Thrust = Engine.Thrust
local Direction = Engine.Direction
local Customize = Plane.Customize
local Tool = script.Parent
local GUI = Tool.PlaneGui
local ToolSelect = Tool.ToolSelect
local Deselect0 = Tool.Deselect0
local FireMain = Tool.FireMain
local Camera = game.Workspace.CurrentCamera
local RunService = game:GetService("RunService")
|
--!strict
--[=[
@function unshift
@within Array
@param array {T} -- The array to insert the values to.
@param ... ...T -- The values to insert.
@return {T} -- The array with the values inserted.
Inserts values to the beginning of an array.
#### Aliases
`prepend`
```lua
local array = { 1, 2, 3 }
local new = Unshift(array, 4, 5) -- { 4, 5, 1, 2, 3 }
```
]=]
|
local function unshift<T>(array: { T }, ...: T): { T }
local result = { ... }
for _, value in ipairs(array) do
table.insert(result, value)
end
return result
end
return unshift
|
-- Initialize collision tool
|
local CollisionTool = require(CoreTools:WaitForChild 'Collision')
Core.AssignHotkey('K', Core.Support.Call(Core.EquipTool, CollisionTool));
Core.Dock.AddToolButton(Core.Assets.CollisionIcon, 'K', CollisionTool, 'CollisionInfo');
|
-- @specs https://developer.microsoft.com/en-us/fabric#/styles/web/motion#basic-animations
|
local FabricStandard = Bezier(0.8, 0, 0.2, 1) -- used for moving.
local FabricAccelerate = Bezier(0.9, 0.1, 1, 0.2) -- used for exiting.
local FabricDecelerate = Bezier(0.1, 0.9, 0.2, 1) -- used for entering.
|
--[[**
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, keyErrMsg = arrayKeysCheck(value)
if keySuccess == false then
return false, string.format("[array] %s", keyErrMsg or "")
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 value do
if key < 1 or key > arraySize then
return false, string.format("[array] key %s must be sequential", tostring(key))
end
end
local valueSuccess, valueErrMsg = valuesCheck(value)
if not valueSuccess then
return false, string.format("[array] %s", valueErrMsg or "")
end
return true
end
end
|
--edit the below function to execute code when this response is chosen OR this prompt is shown
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
--[[game.ReplicatedStorage.Events.Character.BuyWeapon:Fire(player,dialogueFolder.Parent.Name)]]
end
|
-- string stm_lstring(Stream S)
-- @S - Stream object to read from
|
local function stm_lstring(S)
local len = S:s_szt()
local str
if len ~= 0 then str = string.sub(stm_string(S, len), 1, -2) end
return str
end
|
--[[ _______
___ _______ _ [________)
/ _ |____/ ___/ / ___ ____ ___ (_)__ __ / /
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< /__/ / /
/_/ |_| \___/_//_/\_,_/___/___/_/___/ /__/
SecondLogic @ Inspare
TougeZila @ HomeDepot
]]
|
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_Sounds")
local _Tune = require(car["A-Chassis Tune"])
local on = 0
local throt=0
local redline=0
script:WaitForChild("Turbo")
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
handler:FireServer("newSound","Turbo",car.DriveSeat,script.Turbo.SoundId,0,script.Turbo.Volume,true)
handler:FireServer("playSound","Turbo")
car.DriveSeat:WaitForChild("Turbo")
while wait() do
local _RPM = script.Parent.Values.RPM.Value
local _Turbo = script.Parent.Values.Boost.Value
if script.Parent.Values.Throttle.Value <= _Tune.IdleThrottle/100 then
throt = math.max(.3,throt-.2)
else
throt = math.min(1,throt+.1)
end
if script.Parent.Values.RPM.Value > _Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value > _Tune.IdleThrottle/100 then
redline=.5
else
redline=1
end
if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
local Pitch = math.max((((script.Turbo.SetPitch.Value + script.Turbo.SetRev.Value*_RPM/_Tune.Redline))*on^2),script.Turbo.SetPitch.Value)
if FE then
handler:FireServer("updateSound","Turbo",script.Turbo.SoundId,Pitch,script.Turbo.Volume)
else
car.DriveSeat.Turbo.Pitch = Pitch
end
end
|
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
return plrData.Character.Stats.HasMana.Value ~= true
end
|
--[=[
@class TaskQueue
A queue that flushes all objects at the end of the current
execution step. This works by scheduling all tasks with
`task.defer`.
A possible use-case is to batch all requests being sent through
a RemoteEvent to help prevent calling it too many times on
the same frame.
```lua
local bulletQueue = TaskQueue.new(function(bullets)
bulletRemoteEvent:FireAllClients(bullets)
end)
-- Add 3 bullets. Because they're all added on the same
-- execution step, they will all be grouped together on
-- the next queue flush, which the above function will
-- handle.
bulletQueue:Add(someBullet)
bulletQueue:Add(someBullet)
bulletQueue:Add(someBullet)
```
]=]
|
local TaskQueue = {}
TaskQueue.__index = TaskQueue
|
--[=[
Takes the first entry and terminates the observable. Equivalent to the following:
```lua
Rx.take(1)
```
https://reactivex.io/documentation/operators/first.html
@return (source: Observable<T>) -> Observable<T>
]=]
|
function Rx.first()
return Rx.take(1)
end
|
--Wait until humanoid dies
|
script.Parent.HumanoidRootPart.Velocity = Vector3.new(math.random(negflng,flng),75,math.random(negflng,flng))
script.Parent.HumanoidRootPart.RotVelocity = Vector3.new(math.random(negflng,flng),math.random(negflng,flng),math.random(negflng,flng))
|
--edit the below function to execute code when this response is chosen OR this prompt is shown
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
plrData.Money.Gold.Value = plrData.Money.Gold.Value - 70 -- TODO Track payment for dissertation
local ClassInformationTable = require(game.ReplicatedStorage.Source.Modules.CharacterScripts.Classes.ClassInformation)
ClassInformationTable:GetClassFolder(player,"Warlock").PocketStep.Value = true
end
|
--SparkleBomb
|
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local Humanoid = character:WaitForChild("Humanoid")
Humanoid.Died:connect(function()
if player.SparkleBomb.Value == 2 then
player.SparkleBomb.Value = 1
end
end)
end)
end)
game.Players.PlayerRemoving:Connect(function(player)
if player.SparkleBomb.Value == 2 then
player.SparkleBomb.Value = 1
end
end)
|
--// Handling Settings
|
Firerate = 60 / 350; -- 60 = 1 Minute, 350 = Rounds per that 60 seconds. DO NOT TOUCH THE 60!
FireMode = 1; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive
|
-- Apply the settings
|
ChatService:SetBubbleChatSettings(bubbleChatSettings)
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__VRService__1 = game:GetService("VRService");
local l__UserInputService__2 = game:GetService("UserInputService");
local l__RunService__3 = game:GetService("RunService");
local l__PathfindingService__4 = game:GetService("PathfindingService");
local l__ContextActionService__5 = game:GetService("ContextActionService");
local l__StarterGui__6 = game:GetService("StarterGui");
local l__LocalPlayer__7 = game:GetService("Players").LocalPlayer;
local v8 = Vector3.new(0, 0, 0);
local v9 = Vector3.new(1, 0, 1);
local function u1(p1)
local v10 = false;
if p1 == p1 then
v10 = false;
if p1 ~= (1 / 0) then
v10 = p1 ~= (-1 / 0);
end;
end;
return v10;
end;
local v11 = Instance.new("BindableEvent");
v11.Name = "MovementUpdate";
v11.Parent = script;
local u2 = nil;
coroutine.wrap(function()
local l__PathDisplay__12 = script.Parent:WaitForChild("PathDisplay");
if l__PathDisplay__12 then
u2 = require(l__PathDisplay__12);
end;
end)();
local v13 = require(script.Parent:WaitForChild("BaseCharacterController"));
local v14 = setmetatable({}, v13);
v14.__index = v14;
function v14.new(p2)
local v15 = setmetatable(v13.new(), v14);
v15.CONTROL_ACTION_PRIORITY = p2;
v15.navigationRequestedConn = nil;
v15.heartbeatConn = nil;
v15.currentDestination = nil;
v15.currentPath = nil;
v15.currentPoints = nil;
v15.currentPointIdx = 0;
v15.expectedTimeToNextPoint = 0;
v15.timeReachedLastPoint = tick();
v15.moving = false;
v15.isJumpBound = false;
v15.moveLatch = false;
v15.userCFrameEnabledConn = nil;
return v15;
end;
function v14.SetLaserPointerMode(p3, p4)
pcall(function()
l__StarterGui__6:SetCore("VRLaserPointerMode", p4);
end);
end;
function v14.GetLocalHumanoid(p5)
local l__Character__16 = l__LocalPlayer__7.Character;
if not l__Character__16 then
return;
end;
for v17, v18 in pairs(l__Character__16:GetChildren()) do
if v18:IsA("Humanoid") then
return v18;
end;
end;
return nil;
end;
function v14.HasBothHandControllers(p6)
return l__VRService__1:GetUserCFrameEnabled(Enum.UserCFrame.RightHand) and l__VRService__1:GetUserCFrameEnabled(Enum.UserCFrame.LeftHand);
end;
function v14.HasAnyHandControllers(p7)
return l__VRService__1:GetUserCFrameEnabled(Enum.UserCFrame.RightHand) or l__VRService__1:GetUserCFrameEnabled(Enum.UserCFrame.LeftHand);
end;
function v14.IsMobileVR(p8)
return l__UserInputService__2.TouchEnabled;
end;
function v14.HasGamepad(p9)
return l__UserInputService__2.GamepadEnabled;
end;
function v14.ShouldUseNavigationLaser(p10)
if p10:IsMobileVR() then
return true;
end;
if p10:HasBothHandControllers() then
return false;
end;
if p10:HasAnyHandControllers() then
return true;
end;
return not p10:HasGamepad();
end;
function v14.StartFollowingPath(p11, p12)
currentPath = p12;
currentPoints = currentPath:GetPointCoordinates();
currentPointIdx = 1;
moving = true;
timeReachedLastPoint = tick();
local v19 = p11:GetLocalHumanoid();
if v19 and v19.Torso and #currentPoints >= 1 then
expectedTimeToNextPoint = (currentPoints[1] - v19.Torso.Position).magnitude / v19.WalkSpeed;
end;
v11:Fire("targetPoint", p11.currentDestination);
end;
function v14.GoToPoint(p13, p14)
currentPath = true;
currentPoints = { p14 };
currentPointIdx = 1;
moving = true;
local v20 = p13:GetLocalHumanoid();
timeReachedLastPoint = tick();
expectedTimeToNextPoint = (v20.Torso.Position - p14).magnitude / v20.WalkSpeed;
v11:Fire("targetPoint", p14);
end;
function v14.StopFollowingPath(p15)
currentPath = nil;
currentPoints = nil;
currentPointIdx = 0;
moving = false;
p15.moveVector = v8;
end;
function v14.TryComputePath(p16, p17, p18)
local v21 = nil;
while not v21 and 0 < 5 do
local v22 = l__PathfindingService__4:ComputeSmoothPathAsync(p17, p18, 200);
if v22.Status == Enum.PathStatus.ClosestNoPath then
return nil;
end;
if v22.Status == Enum.PathStatus.ClosestOutOfRange then
return nil;
end;
if v22 and v22.Status == Enum.PathStatus.FailStartNotEmpty then
p17 = p17 + (p18 - p17).unit;
v22 = nil;
end;
if v21 and v21.Status == Enum.PathStatus.FailFinishNotEmpty then
p18 = p18 + Vector3.new(0, 1, 0);
v21 = nil;
end;
end;
return v21;
end;
local function u3(p19)
return u1(p19.x) and (u1(p19.y) and u1(p19.z));
end;
function v14.OnNavigationRequest(p20, p21, p22)
local l__p__23 = p21.p;
local l__currentDestination__24 = p20.currentDestination;
if not u3(l__p__23) then
return;
end;
p20.currentDestination = l__p__23;
local v25 = p20:GetLocalHumanoid();
if not v25 or not v25.Torso then
return;
end;
local l__Position__26 = v25.Torso.Position;
if (p20.currentDestination - l__Position__26).magnitude < 12 then
p20:GoToPoint(p20.currentDestination);
return;
end;
if not l__currentDestination__24 or (p20.currentDestination - l__currentDestination__24).magnitude > 4 then
local v27 = p20:TryComputePath(l__Position__26, p20.currentDestination);
if v27 then
p20:StartFollowingPath(v27);
if u2 then
u2.setCurrentPoints(p20.currentPoints);
u2.renderPath();
return;
end;
else
p20:StopFollowingPath();
if u2 then
u2.clearRenderedPath();
return;
end;
end;
else
if moving then
p20.currentPoints[#currentPoints] = p20.currentDestination;
return;
end;
p20:GoToPoint(p20.currentDestination);
end;
end;
function v14.OnJumpAction(p23, p24, p25, p26)
if p25 == Enum.UserInputState.Begin then
p23.isJumping = true;
end;
return Enum.ContextActionResult.Sink;
end;
function v14.BindJumpAction(p27, p28)
if p28 then
if p27.isJumpBound then
return;
end;
else
if p27.isJumpBound then
p27.isJumpBound = false;
l__ContextActionService__5:UnbindAction("VRJumpAction");
end;
return;
end;
p27.isJumpBound = true;
l__ContextActionService__5:BindActionAtPriority("VRJumpAction", function()
return p27:OnJumpAction();
end, false, p27.CONTROL_ACTION_PRIORITY, Enum.KeyCode.ButtonA);
end;
function v14.ControlCharacterGamepad(p29, p30, p31, p32)
if p32.KeyCode ~= Enum.KeyCode.Thumbstick1 then
return;
end;
if p31 == Enum.UserInputState.Cancel then
p29.moveVector = v8;
return;
end;
if p31 ~= Enum.UserInputState.End then
p29:StopFollowingPath();
if u2 then
u2.clearRenderedPath();
end;
if p29:ShouldUseNavigationLaser() then
p29:BindJumpAction(true);
p29:SetLaserPointerMode("Hidden");
end;
if p32.Position.magnitude > 0.22 then
p29.moveVector = Vector3.new(p32.Position.X, 0, -p32.Position.Y);
if p29.moveVector.magnitude > 0 then
p29.moveVector = p29.moveVector.unit * math.min(1, p32.Position.magnitude);
end;
p29.moveLatch = true;
end;
else
p29.moveVector = v8;
if p29:ShouldUseNavigationLaser() then
p29:BindJumpAction(false);
p29:SetLaserPointerMode("Navigation");
end;
if p29.moveLatch then
p29.moveLatch = false;
v11:Fire("offtrack");
end;
end;
return Enum.ContextActionResult.Sink;
end;
function v14.OnHeartbeat(p33, p34)
local v28 = p33.moveVector;
local v29 = p33:GetLocalHumanoid();
if not v29 or not v29.Torso then
return;
end;
if p33.moving and p33.currentPoints then
local l__Position__30 = v29.Torso.Position;
local v31 = (currentPoints[1] - l__Position__30) * v9;
local l__magnitude__32 = v31.magnitude;
local v33 = v31 / l__magnitude__32;
if l__magnitude__32 < 1 then
local v34 = 0;
local v35 = currentPoints[1];
for v36, v37 in pairs(currentPoints) do
if v36 ~= 1 then
v35 = v37;
v34 = v34 + (v37 - v35).magnitude / v29.WalkSpeed;
end;
end;
table.remove(currentPoints, 1);
currentPointIdx = currentPointIdx + 1;
if #currentPoints == 0 then
p33:StopFollowingPath();
if u2 then
u2.clearRenderedPath();
end;
return;
end;
if u2 then
u2.setCurrentPoints(currentPoints);
u2.renderPath();
end;
expectedTimeToNextPoint = (currentPoints[1] - l__Position__30).magnitude / v29.WalkSpeed;
timeReachedLastPoint = tick();
else
local v38 = { game.Players.LocalPlayer.Character, workspace.CurrentCamera };
local v39, v40, v41 = workspace:FindPartOnRayWithIgnoreList(Ray.new(l__Position__30 - Vector3.new(0, 1, 0), v33 * 3), v38);
if v39 then
local v42 = Vector3.new(0, 100, 0);
local v43, v44, v45 = workspace:FindPartOnRayWithIgnoreList(Ray.new(v40 + v33 * 0.5 + v42, -v42), v38);
local v46 = v44.Y - l__Position__30.Y;
if v46 < 6 and v46 > -2 then
v29.Jump = true;
end;
end;
if expectedTimeToNextPoint + 2 < tick() - timeReachedLastPoint then
p33:StopFollowingPath();
if u2 then
u2.clearRenderedPath();
end;
v11:Fire("offtrack");
end;
v28 = p33.moveVector:Lerp(v33, p34 * 10);
end;
end;
if u3(v28) then
p33.moveVector = v28;
end;
end;
function v14.OnUserCFrameEnabled(p35)
if p35:ShouldUseNavigationLaser() then
p35:BindJumpAction(false);
p35:SetLaserPointerMode("Navigation");
return;
end;
p35:BindJumpAction(true);
p35:SetLaserPointerMode("Hidden");
end;
function v14.Enable(p36, p37)
p36.moveVector = v8;
p36.isJumping = false;
if p37 then
p36.navigationRequestedConn = l__VRService__1.NavigationRequested:Connect(function(p38, p39)
p36:OnNavigationRequest(p38, p39);
end);
p36.heartbeatConn = l__RunService__3.Heartbeat:Connect(function(p40)
p36:OnHeartbeat(p40);
end);
l__ContextActionService__5:BindAction("MoveThumbstick", function(p41, p42, p43)
return p36:ControlCharacterGamepad(p41, p42, p43);
end, false, p36.CONTROL_ACTION_PRIORITY, Enum.KeyCode.Thumbstick1);
l__ContextActionService__5:BindActivate(Enum.UserInputType.Gamepad1, Enum.KeyCode.ButtonR2);
p36.userCFrameEnabledConn = l__VRService__1.UserCFrameEnabled:Connect(function()
p36:OnUserCFrameEnabled();
end);
p36:OnUserCFrameEnabled();
l__VRService__1:SetTouchpadMode(Enum.VRTouchpad.Left, Enum.VRTouchpadMode.VirtualThumbstick);
l__VRService__1:SetTouchpadMode(Enum.VRTouchpad.Right, Enum.VRTouchpadMode.ABXY);
p36.enabled = true;
return;
end;
p36:StopFollowingPath();
l__ContextActionService__5:UnbindAction("MoveThumbstick");
l__ContextActionService__5:UnbindActivate(Enum.UserInputType.Gamepad1, Enum.KeyCode.ButtonR2);
p36:BindJumpAction(false);
p36:SetLaserPointerMode("Disabled");
if p36.navigationRequestedConn then
p36.navigationRequestedConn:Disconnect();
p36.navigationRequestedConn = nil;
end;
if p36.heartbeatConn then
p36.heartbeatConn:Disconnect();
p36.heartbeatConn = nil;
end;
if p36.userCFrameEnabledConn then
p36.userCFrameEnabledConn:Disconnect();
p36.userCFrameEnabledConn = nil;
end;
p36.enabled = false;
end;
return v14;
|
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
|
local BulletModel = ACS_Storage.Server
game.Players.PlayerAdded:connect(function(SKP_001)
SKP_001.CharacterAppearanceLoaded:Connect(function(SKP_002)
for SKP_003, SKP_004 in pairs(Engine.Essential:GetChildren()) do
if SKP_004 then
local SKP_005 = SKP_004:clone()
SKP_005.Parent = SKP_001.PlayerGui
SKP_005.Disabled = false
end
end
if SKP_001.Character:FindFirstChild('Head') then
Evt.TeamTag:FireAllClients(SKP_001, SKP_002)
end
end)
SKP_001.Changed:connect(function()
Evt.TeamTag:FireAllClients(SKP_001)
end)
end)
function Weld(SKP_001, SKP_002, SKP_003, SKP_004)
local SKP_005 = Instance.new("Motor6D", SKP_001)
SKP_005.Part0 = SKP_001
SKP_005.Part1 = SKP_002
SKP_005.Name = SKP_001.Name
SKP_005.C0 = SKP_003 or SKP_001.CFrame:inverse() * SKP_002.CFrame
SKP_005.C1 = SKP_004 or CFrame.new()
return SKP_005
end
Evt.Recarregar.OnServerEvent:Connect(function(Player, StoredAmmo,Arma)
Arma.ACS_Modulo.Variaveis.StoredAmmo.Value = StoredAmmo
end)
Evt.Treino.OnServerEvent:Connect(function(Player, Vitima)
if Vitima.Parent:FindFirstChild("Saude") ~= nil then
local saude = Vitima.Parent.Saude
saude.Variaveis.HitCount.Value = saude.Variaveis.HitCount.Value + 1
end
end)
Evt.SVFlash.OnServerEvent:Connect(function(Player,Mode,Arma,Angle,Bright,Color,Range)
if ServerConfig.ReplicatedFlashlight then
Evt.SVFlash:FireAllClients(Player,Mode,Arma,Angle,Bright,Color,Range)
end
end)
Evt.SVLaser.OnServerEvent:Connect(function(Player,Position,Modo,Cor,Arma,IRmode)
if ServerConfig.ReplicatedLaser then
Evt.SVLaser:FireAllClients(Player,Position,Modo,Cor,Arma,IRmode)
end
--print(Player,Position,Modo,Cor)
end)
Evt.Breach.OnServerEvent:Connect(function(Player,Mode,BreachPlace,Pos,Norm,Hit)
if Mode == 1 then
Player.Character.Saude.Kit.BreachCharges.Value = Player.Character.Saude.Kit.BreachCharges.Value - 1
BreachPlace.Destroyed.Value = true
local C4 = Engine.FX.BreachCharge:Clone()
C4.Parent = BreachPlace.Destroyable
C4.Center.CFrame = CFrame.new(Pos, Pos + Norm) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(0))
C4.Center.Place:play()
local weld = Instance.new("WeldConstraint")
weld.Parent = C4
weld.Part0 = BreachPlace.Destroyable.Charge
weld.Part1 = C4.Center
wait(1)
C4.Center.Beep:play()
wait(4)
local Exp = Instance.new("Explosion")
Exp.ExplosionType = "NoCraters"
Exp.BlastPressure = 0
Exp.BlastRadius = 0
Exp.DestroyJointRadiusPercent = 0
Exp.Position = C4.Center.Position
Exp.Parent = workspace
local S = Instance.new("Sound")
S.EmitterSize = 50
S.MaxDistance = 1500
S.SoundId = "rbxassetid://".. Explosion[math.random(1, 7)]
S.PlaybackSpeed = math.random(30,55)/40
S.Volume = 2
S.Parent = Exp
S.PlayOnRemove = true
S:Destroy()
--[[for SKP_001, SKP_002 in pairs(game.Players:GetChildren()) do
if SKP_002:IsA('Player') and SKP_002.Character and SKP_002.Character:FindFirstChild('Head') and (SKP_002.Character.Head.Position - C4.Center.Position).magnitude <= 15 then
local DistanceMultiplier = (((SKP_002.Character.Head.Position - C4.Center.Position).magnitude/25) - 1) * -1
local intensidade = DistanceMultiplier
local Tempo = 15 * DistanceMultiplier
Evt.Suppression:FireClient(SKP_002,2,intensidade,Tempo)
end
end ]]
Debris:AddItem(BreachPlace.Destroyable,0)
elseif Mode == 2 then
Player.Character.Saude.Kit.BreachCharges.Value = Player.Character.Saude.Kit.BreachCharges.Value - 1
BreachPlace.Destroyed.Value = true
local C4 = Engine.FX.BreachCharge:Clone()
C4.Parent = BreachPlace
C4.Center.CFrame = CFrame.new(Pos, Pos + Norm) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(0))
C4.Center.Place:play()
local weld = Instance.new("WeldConstraint")
weld.Parent = C4
weld.Part0 = BreachPlace.Door.Door
weld.Part1 = C4.Center
wait(1)
C4.Center.Beep:play()
wait(4)
local Exp = Instance.new("Explosion")
Exp.ExplosionType = "NoCraters"
Exp.BlastPressure = 0
Exp.BlastRadius = 0
Exp.DestroyJointRadiusPercent = 0
Exp.Position = C4.Center.Position
Exp.Parent = workspace
local S = Instance.new("Sound")
S.EmitterSize = 50
S.MaxDistance = 1500
S.SoundId = "rbxassetid://".. Explosion[math.random(1, 7)]
S.PlaybackSpeed = math.random(30,55)/40
S.Volume = 2
S.Parent = Exp
S.PlayOnRemove = true
S:Destroy()
--[[for SKP_001, SKP_002 in pairs(game.Players:GetChildren()) do
if SKP_002:IsA('Player') and SKP_002.Character and SKP_002.Character:FindFirstChild('Head') and (SKP_002.Character.Head.Position - C4.Center.Position).magnitude <= 15 then
local DistanceMultiplier = (((SKP_002.Character.Head.Position - C4.Center.Position).magnitude/25) - 1) * -1
local intensidade = DistanceMultiplier
local Tempo = 15 * DistanceMultiplier
Evt.Suppression:FireClient(SKP_002,2,intensidade,Tempo)
end
end]]
Debris:AddItem(BreachPlace,0)
elseif Mode == 3 then
Player.Character.Saude.Kit.Fortifications.Value = Player.Character.Saude.Kit.Fortifications.Value - 1
BreachPlace.Fortified.Value = true
local C4 = Instance.new('Part')
C4.Parent = BreachPlace.Destroyable
C4.Size = Vector3.new(Hit.Size.X + .05,Hit.Size.Y + .05,Hit.Size.Z + 0.5)
C4.Material = Enum.Material.DiamondPlate
C4.Anchored = true
C4.CFrame = Hit.CFrame
local S = Engine.FX.FortFX:Clone()
S.PlaybackSpeed = math.random(30,55)/40
S.Volume = 1
S.Parent = C4
S.PlayOnRemove = true
S:Destroy()
end
end)
Evt.Hit.OnServerEvent:Connect(function(Player, Position, HitPart, Normal, Material, Settings)
Evt.Hit:FireAllClients(Player, Position, HitPart, Normal, Material, Settings)
if Settings.ExplosiveHit == true then
local Hitmark = Instance.new("Attachment")
Hitmark.CFrame = CFrame.new(Position, Position + Normal)
Hitmark.Parent = workspace.Terrain
Debris:AddItem(Hitmark, 5)
local Exp = Instance.new("Explosion")
Exp.ExplosionType = "NoCraters"
Exp.BlastPressure = Settings.ExPressure
Exp.BlastRadius = Settings.ExpRadius
Exp.DestroyJointRadiusPercent = Settings.DestroyJointRadiusPercent
Exp.Position = Hitmark.Position
Exp.Parent = Hitmark
local S = Instance.new("Sound")
S.EmitterSize = 50
S.MaxDistance = 1500
S.SoundId = "rbxassetid://".. Explosion[math.random(1, 7)]
S.PlaybackSpeed = math.random(30,55)/40
S.Volume = 2
S.Parent = Exp
S.PlayOnRemove = true
S:Destroy()
Exp.Hit:connect(function(hitPart, partDistance)
local humanoid = hitPart.Parent and hitPart.Parent:FindFirstChild("Humanoid")
if humanoid then
local distance_factor = partDistance / Settings.ExpRadius -- get the distance as a value between 0 and 1
distance_factor = 1 - distance_factor -- flip the amount, so that lower == closer == more damage
if distance_factor > 0 then
humanoid:TakeDamage(Settings.ExplosionDamage*distance_factor) -- 0: no damage; 1: max damage
end
end
end)
end
--[[for SKP_001, SKP_002 in pairs(game.Players:GetChildren()) do
if SKP_002:IsA('Player') and SKP_002 ~= Player and SKP_002.Character and SKP_002.Character:FindFirstChild('Head') and (SKP_002.Character.Head.Position - Hitmark.WorldPosition).magnitude <= Settings.SuppressMaxDistance then
Evt.Suppression:FireClient(SKP_002,1,10,5)
end
end ]]
end)
Evt.LauncherHit.OnServerEvent:Connect(function(Player, Position, HitPart, Normal)
Evt.LauncherHit:FireAllClients(Player, Position, HitPart, Normal)
end)
Evt.Whizz.OnServerEvent:Connect(function(Player, Vitima)
Evt.Whizz:FireClient(Vitima)
end)
Evt.Suppression.OnServerEvent:Connect(function(Player, Vitima)
Evt.Suppression:FireClient(Vitima,1,10,5)
end)
Evt.ServerBullet.OnServerEvent:connect(function(Player, BulletCF, Tracer, Force, BSpeed, Direction, TracerColor,Ray_Ignore,BulletFlare,BulletFlareColor)
Evt.ServerBullet:FireAllClients(Player, BulletCF, Tracer, Force, BSpeed, Direction, TracerColor,Ray_Ignore,BulletFlare,BulletFlareColor)
end)
Evt.Equipar.OnServerEvent:Connect(function(Player,Arma)
local Torso = Player.Character:FindFirstChild('Torso')
local Head = Player.Character:FindFirstChild('Head')
local HumanoidRootPart = Player.Character:FindFirstChild('HumanoidRootPart')
if Player.Character:FindFirstChild('Holst' .. Arma.Name) then
Player.Character['Holst' .. Arma.Name]:Destroy()
end
local ServerGun = GunModelServer:FindFirstChild(Arma.Name):clone()
ServerGun.Name = 'S' .. Arma.Name
local Settings = require(Arma.ACS_Modulo.Variaveis:WaitForChild("Settings"))
Arma.ACS_Modulo.Variaveis.BType.Value = Settings.BulletType
AnimBase = Instance.new("Part", Player.Character)
AnimBase.FormFactor = "Custom"
AnimBase.CanCollide = false
AnimBase.Transparency = 1
AnimBase.Anchored = false
AnimBase.Name = "AnimBase"
AnimBase.Size = Vector3.new(0.1, 0.1, 0.1)
AnimBaseW = Instance.new("Motor6D")
AnimBaseW.Part0 = AnimBase
AnimBaseW.Part1 = Head
AnimBaseW.Parent = AnimBase
AnimBaseW.Name = "AnimBaseW"
RA = Player.Character['Right Arm']
LA = Player.Character['Left Arm']
RightS = Player.Character.Torso:WaitForChild("Right Shoulder")
LeftS = Player.Character.Torso:WaitForChild("Left Shoulder")
Right_Weld = Instance.new("Motor6D")
Right_Weld.Name = "RAW"
Right_Weld.Part0 = RA
Right_Weld.Part1 = AnimBase
Right_Weld.Parent = AnimBase
Right_Weld.C0 = Settings.RightArmPos
Player.Character.Torso:WaitForChild("Right Shoulder").Part1 = nil
Left_Weld = Instance.new("Motor6D")
Left_Weld.Name = "LAW"
Left_Weld.Part0 = LA
Left_Weld.Part1 = AnimBase
Left_Weld.Parent = AnimBase
Left_Weld.C0 = Settings.LeftArmPos
Player.Character.Torso:WaitForChild("Left Shoulder").Part1 = nil
ServerGun.Parent = Player.Character
for SKP_001, SKP_002 in pairs(ServerGun:GetChildren()) do
if SKP_002:IsA('BasePart') and SKP_002.Name ~= 'Grip' then
local SKP_003 = Instance.new('WeldConstraint')
SKP_003.Parent = SKP_002
SKP_003.Part0 = SKP_002
SKP_003.Part1 = ServerGun.Grip
end;
end
local SKP_004 = Instance.new('Motor6D')
SKP_004.Name = 'GripW'
SKP_004.Parent = ServerGun.Grip
SKP_004.Part0 = ServerGun.Grip
SKP_004.Part1 = Player.Character['Right Arm']
SKP_004.C1 = Settings.ServerGunPos
for L_74_forvar1, L_75_forvar2 in pairs(ServerGun:GetChildren()) do
if L_75_forvar2:IsA('BasePart') then
L_75_forvar2.Anchored = false
L_75_forvar2.CanCollide = false
end
end
end)
Evt.SilencerEquip.OnServerEvent:Connect(function(Player,Arma,Silencer)
local Arma = Player.Character['S' .. Arma.Name]
local Fire
if Silencer then
Arma.Silenciador.Transparency = 0
else
Arma.Silenciador.Transparency = 1
end
end)
Evt.Desequipar.OnServerEvent:Connect(function(Player,Arma,Settings)
if Settings.EnableHolster and Player.Character and Player.Character.Humanoid and Player.Character.Humanoid.Health > 0 then
if Player.Backpack:FindFirstChild(Arma.Name) then
local SKP_001 = GunModelServer:FindFirstChild(Arma.Name):clone()
SKP_001.PrimaryPart = SKP_001.Grip
SKP_001.Parent = Player.Character
SKP_001.Name = 'Holst' .. Arma.Name
for SKP_002, SKP_003 in pairs(SKP_001:GetDescendants()) do
if SKP_003:IsA('BasePart') and SKP_003.Name ~= 'Grip' then
Weld(SKP_003, SKP_001.Grip)
end
if SKP_003:IsA('BasePart') and SKP_003.Name == 'Grip' then
Weld(SKP_003, Player.Character[Settings.HolsterTo], CFrame.new(), Settings.HolsterPos)
end
end
for SKP_004, SKP_005 in pairs(SKP_001:GetDescendants()) do
if SKP_005:IsA('BasePart') then
SKP_005.Anchored = false
SKP_005.CanCollide = false
end
end
end
end
if Player.Character:FindFirstChild('S' .. Arma.Name) ~= nil then
Player.Character['S' .. Arma.Name]:Destroy()
Player.Character.AnimBase:Destroy()
end
if Player.Character.Torso:FindFirstChild("Right Shoulder") ~= nil then
Player.Character.Torso:WaitForChild("Right Shoulder").Part1 = Player.Character['Right Arm']
end
if Player.Character.Torso:FindFirstChild("Left Shoulder") ~= nil then
Player.Character.Torso:WaitForChild("Left Shoulder").Part1 = Player.Character['Left Arm']
end
if Player.Character.Torso:FindFirstChild("Neck") ~= nil then
Player.Character.Torso:WaitForChild("Neck").C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
Player.Character.Torso:WaitForChild("Neck").C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
end
end)
Evt.Holster.OnServerEvent:Connect(function(Player,Arma)
if Player.Character:FindFirstChild('Holst' .. Arma.Name) then
Player.Character['Holst' .. Arma.Name]:Destroy()
end
end)
Evt.HeadRot.OnServerEvent:connect(function(Player, Rotacao, Offset, Equipado)
Evt.HeadRot:FireAllClients(Player, Rotacao, Offset, Equipado)
end)
local TS = game:GetService('TweenService')
Evt.Atirar.OnServerEvent:Connect(function(Player,FireRate,Anims,Arma)
Evt.Atirar:FireAllClients(Player,FireRate,Anims,Arma)
end)
Evt.Stance.OnServerEvent:Connect(function(Player,stance,Settings,Anims)
if Player.Character.Humanoid.Health > 0 and Player.Character.AnimBase:FindFirstChild("RAW") ~= nil and Player.Character.AnimBase:FindFirstChild("LAW") ~= nil then
local Right_Weld = Player.Character.AnimBase:WaitForChild("RAW")
local Left_Weld = Player.Character.AnimBase:WaitForChild("LAW")
if stance == 0 then
TS:Create(Right_Weld, TweenInfo.new(.3), {C0 = Settings.RightArmPos} ):Play()
TS:Create(Left_Weld, TweenInfo.new(.3), {C0 = Settings.LeftArmPos} ):Play()
elseif stance == 2 then
TS:Create(Right_Weld, TweenInfo.new(.3), {C0 = Anims.RightAim} ):Play()
TS:Create(Left_Weld, TweenInfo.new(.3), {C0 = Anims.LeftAim} ):Play()
elseif stance == 1 then
TS:Create(Right_Weld, TweenInfo.new(.3), {C0 = Anims.RightHighReady} ):Play()
TS:Create(Left_Weld, TweenInfo.new(.3), {C0 = Anims.LeftHighReady} ):Play()
elseif stance == -1 then
TS:Create(Right_Weld, TweenInfo.new(.3), {C0 = Anims.RightLowReady} ):Play()
TS:Create(Left_Weld, TweenInfo.new(.3), {C0 = Anims.LeftLowReady} ):Play()
elseif stance == -2 then
TS:Create(Right_Weld, TweenInfo.new(.3), {C0 = Anims.RightPatrol} ):Play()
TS:Create(Left_Weld, TweenInfo.new(.3), {C0 = Anims.LeftPatrol} ):Play()
elseif stance == 3 then
TS:Create(Right_Weld, TweenInfo.new(.3), {C0 = Anims.RightSprint} ):Play()
TS:Create(Left_Weld, TweenInfo.new(.3), {C0 = Anims.LeftSprint} ):Play()
end
end
end)
Evt.Damage.OnServerEvent:Connect(function(Player,VitimaHuman,Dano,DanoColete,DanoCapacete)
if VitimaHuman ~= nil then
if VitimaHuman.Parent:FindFirstChild("Saude") ~= nil then
local Colete = VitimaHuman.Parent.Saude.Protecao.VestVida
local Capacete = VitimaHuman.Parent.Saude.Protecao.HelmetVida
Colete.Value = Colete.Value - DanoColete
Capacete.Value = Capacete.Value - DanoCapacete
end
VitimaHuman:TakeDamage(Dano)
end
end)
Evt.CreateOwner.OnServerEvent:Connect(function(Player,VitimaHuman)
local c = Instance.new("ObjectValue")
c.Name = "creator"
c.Value = Player
game.Debris:AddItem(c, 3)
c.Parent = VitimaHuman
end)
|
--[[
How it'll work
client sends "Place" req
server gets "Place" req
server checks spot to place, overlapping note, ratelimiting of notes, etc
if success then
server sends back "Good" to client
else
server sends back "Bad" to client
end
]]
|
local _RunServ = game:GetService("RunService")
local _Players = game:GetService("Players")
local Replicated = game:GetService("ReplicatedStorage")
local PlacedNotes = workspace.PlacedNotes
local BaseNoteGhost = workspace.BaseNote:Clone()
local SharedBridges = require(Replicated.SharedBridges)
local Bridges = SharedBridges.Bridges
local Identifiers = SharedBridges.Identifiers
local PlaceBridge = Bridges.PlaceNote
local ServerParams = OverlapParams.new()
ServerParams.FilterType = Enum.RaycastFilterType.Whitelist
ServerParams.FilterDescendantsInstances = { PlacedNotes, workspace.Baseplate }
local noteCount = 0
local function CheckOverLap(Note: Part, CF: CFrame)
local overlaps = workspace:GetPartBoundsInBox(CF, Note.Size, ServerParams)
return #overlaps > 0 and true or false
end
local function OnPlace(Player: Player, CF: CFrame)
local Note = BaseNoteGhost:Clone()
if CheckOverLap(Note, CF) then
PlaceBridge:FireTo(Player, Identifiers.Bad)
Note:Destroy()
return
end
noteCount += 1
Note.CFrame = CF
Note.Name = tostring(noteCount)
Note.Parent = PlacedNotes
PlaceBridge:FireTo(Player, Identifiers.Good)
end
PlaceBridge:Connect(OnPlace)
|
-----------------
--| Constants |--
-----------------
|
local SHOT_SPEED = 100
local SHOT_TIME = 1
local NOZZLE_OFFSET = Vector3.new(0, 0.4, -1.1)
local DEBOUNCE_TAG_NAME = 'Busy'
local GLib = require(206209239)
|
--Tune
|
local _Select = "Slicks" --(AllSeason, Slicks, SemiSlicks, AllTerrain, DragRadials, Custom) Caps and space sensitive
local _Custom = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .2 , --How fast your tires will degrade (Front)
FTargetFriction = 1.23 , --Friction in optimal conditions (Front)
FMinFriction = 0.35 , --Friction in worst conditions (Front)
RWearSpeed = .2 , --How fast your tires will degrade (Rear)
RTargetFriction = 1.23 , --Friction in optimal conditions (Rear)
RMinFriction = 0.35 , --Friction in worst conditions (Rear)
--Tire Slip
TCSOffRatio = 1/1.7 , --How much optimal grip your car will lose with TCS off, set to 1 if you dont want any losses.
WheelLockRatio = 1/6 , --How much grip your car will lose when locking the wheels
WheelspinRatio = 1/1.2 , --How much grip your car will lose when spinning the wheels
--Wheel Properties
FFrictionWeight = 2 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Front) (PGS)
RFrictionWeight = 2 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Rear) (PGS)
FLgcyFrWeight = 0 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Front)
RLgcyFrWeight = 0 , --Ratio of friction between wheel and terrain, the higher it is, the more true to target friction your grip wil be (Rear)
FElasticity = 0 , --How much your wheel will bounce (Front) (PGS)
RElasticity = 0 , --How much your wheel will bounce (Rear) (PGS)
FLgcyElasticity = 0 , --How much your wheel will bounce (Front)
RLgcyElasticity = 0 , --How much your wheel will bounce (Rear)
FElastWeight = 1 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Front) (PGS)
RElastWeight = 1 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Rear) (PGS)
FLgcyElWeight = 10 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Front)
RLgcyElWeight = 10 , --Ratio of elasticity between wheel and terrain, the higher it is, the more true to the wheel elasticity it will be (Rear)
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _AllSeason = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .2 , --Don't change this
FTargetFriction = .6 , -- .58 to .63
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .2 , --Don't change this
RTargetFriction = .6 , -- .58 to .63
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 2 , --Don't change this
RFrictionWeight = 2 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _Slicks = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .6 , --Don't change this
FTargetFriction = .93 , -- .88 to .93
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .6 , --Don't change this
RTargetFriction = .93 , -- .88 to .93
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 0.6 , --Don't change this
RFrictionWeight = 0.6 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _SemiSlicks = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .5 , --Don't change this
FTargetFriction = .78 , -- .73 to .78
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .5 , --Don't change this
RTargetFriction = .78 , -- .73 to .78
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 0.6 , --Don't change this
RFrictionWeight = 0.6 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _AllTerrain = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .3 , --Don't change this
FTargetFriction = .5 , -- .48 to .53
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .3 , --Don't change this
RTargetFriction = .5 , -- .48 to .53
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 10 , --Don't change this
RFrictionWeight = 10 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _DragRadials = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = 30 , --Don't change this
FTargetFriction = 1.2 , -- 1.18 to 1.23
FMinFriction = 0.35 , --Don't change this
RWearSpeed = 30 , --Don't change this
RTargetFriction = 1.2 , -- 1.18 to 1.23
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 1 , --Don't change this
RFrictionWeight = 1 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 20 , --Don't change this
}
local car = script.Parent.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local cValues = script.Parent.Parent:WaitForChild("Values")
local _WHEELTUNE = _AllSeason
if _Select == "DragRadials" then
_WHEELTUNE = _DragRadials
elseif _Select == "Custom" then
_WHEELTUNE = _Custom
elseif _Select == "AllTerrain" then
_WHEELTUNE = _AllTerrain
elseif _Select == "Slicks" then
_WHEELTUNE = _Slicks
elseif _Select == "SemiSlicks" then
_WHEELTUNE = _SemiSlicks
else
_WHEELTUNE = _AllSeason
end
car.DriveSeat.TireStats.Fwear.Value = _WHEELTUNE.FWearSpeed
car.DriveSeat.TireStats.Ffriction.Value = _WHEELTUNE.FTargetFriction
car.DriveSeat.TireStats.Fminfriction.Value = _WHEELTUNE.FMinFriction
car.DriveSeat.TireStats.Ffweight.Value = _WHEELTUNE.FFrictionWeight
car.DriveSeat.TireStats.Rwear.Value = _WHEELTUNE.RWearSpeed
car.DriveSeat.TireStats.Rfriction.Value = _WHEELTUNE.RTargetFriction
car.DriveSeat.TireStats.Rminfriction.Value = _WHEELTUNE.RMinFriction
car.DriveSeat.TireStats.Rfweight.Value = _WHEELTUNE.RFrictionWeight
car.DriveSeat.TireStats.TCS.Value = _WHEELTUNE.TCSOffRatio
car.DriveSeat.TireStats.Lock.Value = _WHEELTUNE.WheelLockRatio
car.DriveSeat.TireStats.Spin.Value = _WHEELTUNE.WheelspinRatio
car.DriveSeat.TireStats.Reg.Value = _WHEELTUNE.RegenSpeed
|
-- MODULES --
|
local debrisModule = require(Modules.Debris)
|
-- Container for temporary connections (disconnected automatically)
|
local Connections = {};
function NewPartTool.Equip()
-- Enables the tool's equipped functionality
-- Start up our interface
ShowUI();
EnableClickCreation();
-- Set our current type
SetType(NewPartTool.Type);
end;
function NewPartTool.Unequip()
-- Disables the tool's equipped functionality
-- Clear unnecessary resources
HideUI();
ClearConnections();
end;
function ClearConnections()
-- Clears out temporary connections
for ConnectionKey, Connection in pairs(Connections) do
Connection:disconnect();
Connections[ConnectionKey] = nil;
end;
end;
function ShowUI()
-- Creates and reveals the UI
-- Reveal UI if already created
if UI then
-- Reveal the UI
UI.Visible = true;
-- Skip UI creation
return;
end;
-- Create the UI
UI = Core.Tool.Interfaces.BTNewPartToolGUI:Clone();
UI.Parent = Core.UI;
UI.Visible = true;
-- Creatable part types
Types = { 'Normal', 'Truss', 'Wedge', 'Corner', 'Cylinder', 'Ball', 'Seat', 'Vehicle Seat', 'Spawn' };
-- Create the type selection dropdown
TypeDropdown = Core.Cheer(UI.TypeOption.Dropdown).Start(Types, '', function (Type)
SetType(Type);
end);
end;
function HideUI()
-- Hides the tool UI
-- Make sure there's a UI
if not UI then
return;
end;
-- Hide the UI
UI.Visible = false;
end;
function SetType(Type)
-- Update the tool option
NewPartTool.Type = Type;
-- Update the UI
TypeDropdown.SetOption(Type);
end;
function EnableClickCreation()
-- Allows the user to click anywhere and create a new part
-- Listen for clicks
Connections.ClickCreationListener = UserInputService.InputBegan:connect(function (Input, GameProcessedEvent)
-- Make sure this is an intentional event
if GameProcessedEvent then
return;
end;
-- Make sure this was button 1 being released
if Input.UserInputType ~= Enum.UserInputType.MouseButton1 then
return;
end;
-- Enable new part dragging
DragNewParts = true;
Core.Targeting.CancelSelecting();
-- Create the part
CreatePart(NewPartTool.Type);
end);
-- Listen for click releases
Connections.ClickReleaseListener = Support.AddUserInputListener('Ended', 'MouseButton1', true, function ()
-- Cancel dragging new parts if mouse button is released
DragNewParts = false;
end);
end;
function CreatePart(Type)
-- Send the creation request to the server
local Part = Core.SyncAPI:Invoke('CreatePart', Type, CFrame.new(Core.Mouse.Hit.p));
-- Make sure the part creation succeeds
if not Part then
return;
end;
-- Put together the history record
local HistoryRecord = {
Part = Part;
Unapply = function (HistoryRecord)
-- Reverts this change
-- Remove the part
Core.SyncAPI:Invoke('Remove', { HistoryRecord.Part });
end;
Apply = function (HistoryRecord)
-- Reapplies this change
-- Restore the part
Core.SyncAPI:Invoke('UndoRemove', { HistoryRecord.Part });
end;
};
-- Register the history record
Core.History.Add(HistoryRecord);
-- Select the part
Selection.Replace({ Part });
-- Switch to the move tool
local MoveTool = require(Core.Tool.Tools.MoveTool);
Core.EquipTool(MoveTool);
-- Enable dragging to allow easy positioning of the created part
if DragNewParts then
MoveTool.SetUpDragging(Part);
end;
end;
|
--- Same as indexing, but uses an incremented number as a key.
-- @param task An item to clean
-- @treturn number taskId
|
function Maid:GiveTask(task)
assert(task, "Task cannot be false or nil")
local taskId = (#self._tasks + 1)
self[taskId] = task
if (type(task) == "table" and (not task.Destroy) and (not Promise.Is(task))) then
warn("[Maid.GiveTask] - Gave table task without .Destroy\n\n" .. debug.traceback())
end
return taskId
end
function Maid:GivePromise(promise)
assert(Promise.Is(promise), "Expected promise")
if (promise:GetStatus() ~= Promise.Status.Started) then
return promise
end
local newPromise = Promise.Resolve(promise)
local id = self:GiveTask(newPromise)
newPromise:Finally(function()
self[id] = nil
end)
return newPromise
end
|
-- Number
|
local function Round(number, decimalPlaces)
return tonumber(string.format("%." .. (decimalPlaces or 0) .. "f", number))
end
|
---
|
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Black",Paint)
end)
|
--local UserInput = game:GetService("UserInputService")
|
local AvatarEditor = ReplicatedStorage.AvatarEditor
local remoteEvent = AvatarEditor.RemoteEvent
local Maid = require(AvatarEditor.Shared.Util.Maid)
local TableUtil = require(AvatarEditor.Shared.Util.TableUtil)
local Spring = require(AvatarEditor.Shared.Util.Spring)
local Signal = require(AvatarEditor.Shared.Util.Signal)
local QueryMap = require(AvatarEditor.Shared.QueryMap)
local CatalogData = require(AvatarEditor.Shared.CatalogData)
local Colors = require(AvatarEditor.Shared.Colors)
local Settings = require(AvatarEditor.Shared.Settings)
local UserCanUse = require(AvatarEditor.Shared.UserCanUse)
local TabButton = require(AvatarEditor.Client.TabButton)
local Search = require(AvatarEditor.Client.Search)
local CatalogList = require(AvatarEditor.Client.CatalogList)
local Wearing = require(AvatarEditor.Client.Wearing)
local PromptOverlay = require(AvatarEditor.Client.PromptOverlay)
local ColorList = require(AvatarEditor.Client.ColorList)
local Scale = require(AvatarEditor.Client.Scale)
local Costume = require(AvatarEditor.Client.Costume)
local Theme = require(AvatarEditor.Client.Theme)
local Config = require(AvatarEditor.Client.Config)
local player = Players.LocalPlayer
local mainGui = AvatarEditor.AvatarEditorGui
local editorFrame = mainGui.Frame.Editor
local bodyFrame = editorFrame.Body
local footer = editorFrame.Footer
local viewportFrame = mainGui.Frame.Viewport
local expandButton = viewportFrame.Footer.Expand
local mainFrame = bodyFrame.Main
local mainHeader = mainFrame.Header
local mainContainer = mainFrame.Container
local bodyPageLayout = bodyFrame.UIPageLayout
local subcategoryPageLayout = mainHeader.SubTabs.UIPageLayout
local bodyPageIndex = 1
local categoryPageIndex = 1
local subcategoryPageIndex = 0
local categoryButtons = {}
local subcategoryButtons = {}
local tweenSpring = Spring.new(0)
tweenSpring.Damper = 1
tweenSpring.Speed = 20
local maid = Maid.new()
local search, catalogList, promptOverlay, colorList, scale, costume, config
local searchState = {
search = "",
assetType = 8,
wearing = false,
uid = "",
}
local module = {}
module.Started = Signal.new()
module.Loaded = Signal.new()
module.PermissionFailed = Signal.new()
module.Destroyed = Signal.new()
|
----------------------------------------------------------------------------------------------------
--------------------=[ OUTROS ]=--------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,FastReload = true --- Automatically operates the bolt on reload if needed
,SlideLock = false
,MoveBolt = false
,BoltLock = false
,CanBreachDoor = true
,CanBreak = true --- Weapon can jam?
,JamChance = 1000 --- This old piece of brick doesn't work fine >;c
,IncludeChamberedBullet = true --- Include the chambered bullet on next reload
,Chambered = true --- Start with the gun chambered?
,LauncherReady = false --- Start with the GL ready?
,CanCheckMag = false --- You can check the magazine
,ArcadeMode = true
,RainbowMode = false --- Operation: Party Time xD
,ModoTreino = false --- Surrender enemies instead of killing them
,GunSize = 5
,GunFOVReduction = 5.5
,BoltExtend = Vector3.new(0, 0, 0.4)
,SlideExtend = Vector3.new(0, 0, 0.2)
|
--Move this script to Workspace.
|
function onPlayerEntered(player)
player.Chatted:connect(function(msg)
if msg == "!rejoin" then
game:GetService("TeleportService"):Teleport(game.PlaceId, player)
if player.Character ~= nil then
player.Character:remove()
end
end
end)
end
game.Players.PlayerAdded:connect(onPlayerEntered)
|
--- Event handler for text box focus lost
|
function Window:LoseFocus(submit)
local text = Entry.TextBox.Text
self:ClearHistoryState()
if Gui.Visible and not GuiService.MenuIsOpen then
-- self:SetEntryText("")
Entry.TextBox:CaptureFocus()
elseif GuiService.MenuIsOpen and Gui.Visible then
self:Hide()
end
if submit and self.Valid then
wait()
self:SetEntryText("")
self.ProcessEntry(text)
elseif submit then
self:AddLine(self._errorText, Color3.fromRGB(255, 153, 153))
end
end
function Window:TraverseHistory(delta)
local history = self.Cmdr.Dispatcher:GetHistory()
if self.HistoryState == nil then
self.HistoryState = {
Position = #history + 1,
InitialText = self:GetEntryText(),
}
end
self.HistoryState.Position = math.clamp(self.HistoryState.Position + delta, 1, #history + 1)
self:SetEntryText(
self.HistoryState.Position == #history + 1 and self.HistoryState.InitialText
or history[self.HistoryState.Position]
)
end
function Window:ClearHistoryState()
self.HistoryState = nil
end
function Window:SelectVertical(delta)
if self.AutoComplete:IsVisible() and not self.HistoryState then
self.AutoComplete:Select(delta)
else
self:TraverseHistory(delta)
end
end
local lastPressTime = 0
local pressCount = 0
|
--[[ Public API ]]
|
--
function MasterControl:Init()
local renderStepFunc = function()
if LocalPlayer and LocalPlayer.Character then
local humanoid = getHumanoid()
if not humanoid then return end
if humanoid and not humanoid.PlatformStand and isJumping then
humanoid.Jump = isJumping
end
moveFunc(LocalPlayer, moveValue, true)
end
end
local success = pcall(function() RunService:BindToRenderStep("MasterControlStep", Enum.RenderPriority.Input.Value, renderStepFunc) end)
if not success then
if RenderSteppedCon then return end
RenderSteppedCon = RunService.RenderStepped:connect(renderStepFunc)
end
end
function MasterControl:Disable()
local success = pcall(function() RunService:UnbindFromRenderStep("MasterControlStep") end)
if not success then
if RenderSteppedCon then
RenderSteppedCon:disconnect()
RenderSteppedCon = nil
end
end
moveValue = Vector3.new(0,0,0)
isJumping = false
end
function MasterControl:AddToPlayerMovement(playerMoveVector)
moveValue = Vector3.new(moveValue.X + playerMoveVector.X, moveValue.Y + playerMoveVector.Y, moveValue.Z + playerMoveVector.Z)
end
function MasterControl:GetMoveVector()
return moveValue
end
function MasterControl:SetIsJumping(jumping)
isJumping = jumping
end
function MasterControl:DoJump()
local humanoid = getHumanoid()
if humanoid then
humanoid.Jump = true
end
end
return MasterControl
|
--[[
Returns the enums.PrimaryButtonModes that is reflective of the ownership and
equip status from the specified `assetId` and `assetType` of a MerchBooth
accessory.
Default mode is Purchase. Ownership is checked through
MarketplaceService:PlayerOwnsAsset; if the accessory is owned, then equip
status is then checked through the player's HumanoidDescription first and
the humanoid's accessories second.
This function is called when the MerchBooth is opened.
]]
|
local MarketplaceService = game:GetService("MarketplaceService")
local MerchBooth = script:FindFirstAncestor("MerchBooth")
local enums = require(MerchBooth.enums)
local types = require(MerchBooth.types)
local isItemEquipped = require(MerchBooth.Modules.isItemEquipped)
return function(mockMarketplaceService: MarketplaceService)
MarketplaceService = mockMarketplaceService or MarketplaceService
local function getButtonModeAsync(player: Player, itemInfo: types.ItemInfo): string
local character = player and player.Character
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
local mode = enums.PrimaryButtonModes.Purchase
if humanoid and itemInfo.isOwned then
mode = enums.PrimaryButtonModes.Owned
if itemInfo.assetType then
mode = enums.PrimaryButtonModes.CanEquip
local description = humanoid:GetAppliedDescription()
if isItemEquipped(description, itemInfo) then
mode = enums.PrimaryButtonModes.Equipped
end
end
end
return mode
end
return getButtonModeAsync
end
|
--[[**
ensures Roblox RBXScriptSignal type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
t.RBXScriptSignal = t.typeof("RBXScriptSignal")
|
-- Arm the rocket and save the touch connection so we can disconnect it later
|
Connection = Rocket.Touched:connect(OnTouched)
|
-- Returns a part to the cache.
|
function PartCacheStatic:ReturnPart(part: BasePart)
assert(getmetatable(self) == PartCacheStatic, ERR_NOT_INSTANCE:format("ReturnPart", "PartCache.new"))
local index = table.indexOf(self.InUse, part)
if index ~= nil then
for _, v in ipairs(self.Trails) do
part[v].Enabled = false
end
table.remove(self.InUse, index)
table.insert(self.Open, part)
part.CFrame = CF_REALLY_FAR_AWAY
part.Anchored = true
else
error("Attempted to return part \"" .. part.Name .. "\" (" .. part:GetFullName() .. ") to the cache, but it's not in-use! Did you call this on the wrong part?")
end
end
|
-- Permissions
-- You can set the admin power required to use a command
-- COMMANDNAME=ADMINPOWER;
|
Permissions={
};
}
return {Settings,{Owners,SuperAdmins,Admins,Mods,VIP,Banned}}
|
-- Initialize material tool
|
local MaterialTool = require(CoreTools:WaitForChild 'Material')
Core.AssignHotkey('N', Core.Support.Call(Core.EquipTool, MaterialTool));
Core.AddToolButton(Core.Assets.MaterialIcon, 'N', MaterialTool)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.