prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
--On line 10, change the currency name 'Points' to the name of the currency you're using. Make it all ONE WORD.
local RankP = {'1'} local Randoms = math.random(.001,#RankP) local Humanoid = script.Parent.Humanoid function pp() local tag = Humanoid:findFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local Leaderstats = tag.Value:findFirstChild("leaderstats") if Leaderstats ~= nil then Leaderstats.Money.Value = Leaderstats.Money.Value + 700000 Leaderstats.Ranks.Value = Leaderstats.Ranks.Value + Randoms --How much recieved after killing. (Erase number and put your own set amount) wait(0.1) script:remove() end end end end Humanoid.Died:connect(pp)
-- VERTICE INDEX ARRAYS
local BLOCK = {1, 2, 3, 4, 5, 6, 7, 8} local WEDGE = {1, 2, 5, 6, 7, 8} local CORNERWEDGE = {4, 5, 6, 7, 8}
------------
Player.Character.Torso["Right Hip"]:destroy() glue1 = Instance.new("Glue", Player.Character.Torso) glue1.Part0 = Player.Character.Torso glue1.Part1 = rightleg glue1.Name = "Right leg" collider1 = Instance.new("Part", rightleg) collider1.Position = Vector3.new(0,9999,0) collider1.Size = Vector3.new(1.5, 1, 1) collider1.Shape = "Cylinder" local weld1 = Instance.new("Weld", collider1) weld1.Part0 = rightleg weld1.Part1 = collider1 weld1.C0 = CFrame.new(0,-0.2,0) * CFrame.fromEulerAnglesXYZ(0, 0, math.pi/2) collider1.TopSurface = "Smooth" collider1.BottomSurface = "Smooth" collider1.formFactor = "Symmetric" glue1.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) glue1.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) collider1.Transparency = 1
-- / Settings / --
local Settings = { TweenTime = 1 } while true do for _, Color in pairs(Colors) do TweenService:Create( Highlight, TweenInfo.new( Settings.TweenTime, Enum.EasingStyle.Linear ), { FillColor = Color } ):Play() task.wait(Settings.TweenTime + 0.5) end end
-- Update position of all confetti.
svcRun.RenderStepped:Connect(function() for _,val in pairs(confetti) do if (confettiColors) then val:SetColors(confettiColors); end; val.Enabled = confettiActive; val:Update(); end; end); local fire = function(paramColors) confettiColors = paramColors; spawn(function() confettiActive = true; wait(tick); confettiActive = false; end); end; while wait(5) do fire({Color3.fromRGB(255,0,0), Color3.fromRGB(0,255,0), Color3.fromRGB(0,0,255)}); end;
--Listen for new seat
CollectionService:GetInstanceAddedSignal(SeatTag):Connect(function(seat) Seats[seat] = seat end) CollectionService:GetInstanceRemovedSignal(SeatTag):Connect(function(seat) Seats[seat] = nil end)
--[[ Pickup visualizer implementation ]]
local pickupVisualizer = {} function pickupVisualizer.start() for _, instance in pairs(CollectionService:GetTagged(PICKUP_SPAWNER_TAG)) do pickupAdded(instance) end maid.pickupAddedConnection = CollectionService:GetInstanceAddedSignal(PICKUP_SPAWNER_TAG):Connect(pickupAdded) maid.pickupRemovedConnection = CollectionService:GetInstanceRemovedSignal(PICKUP_SPAWNER_TAG):Connect(pickupRemoved) maid.actionActivatedConnection = ActionPrompts.actionActivated:connect(actionActivated) end function pickupVisualizer.stop() for _, instance in pairs(CollectionService:GetTagged(PICKUP_SPAWNER_TAG)) do pickupRemoved(instance) end maid:clean() end return pickupVisualizer
--[[Engine]]
--Torque Curve Tune.Horsepower = 1825 -- [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 = 1.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)
------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------- -- STATE CHANGE HANDLERS
function onRunning(speed) if speed > 0.5 then local scale = 16.0 playAnimation("walk", 0.2, Humanoid) setAnimationSpeed(speed / scale) pose = "Running" else if emoteNames[currentAnim] == nil then playAnimation("idle", 0.2, Humanoid) pose = "Standing" end end end function onDied() pose = "Dead" end function onJumping() playAnimation("jump", 0.1, Humanoid) jumpAnimTime = jumpAnimDuration pose = "Jumping" end function onClimbing(speed) local scale = 5.0 playAnimation("climb", 0.1, Humanoid) setAnimationSpeed(speed / scale) pose = "Climbing" end function onGettingUp() pose = "GettingUp" end function onFreeFall() if jumpAnimTime <= 0 then playAnimation("fall", fallTransitionTime, Humanoid) end pose = "FreeFall" end function onFallingDown() pose = "FallingDown" end function onSeated() pose = "Seated" end function onPlatformStanding() pose = "PlatformStanding" end
--!strict --[[ Symbols have the type 'userdata', but when printed or coerced to a string, the symbol will turn into the string given as its name. **This implementation provides only the `Symbol()` constructor and the global registry via `Symbol.for_`.** Other behaviors, including the ability to find all symbol properties on objects, are not implemented. ]]
export type Symbol = typeof(newproxy(true)) & { [string]: any } return { new = function(name: string?): Symbol local self = newproxy(true) :: any local wrappedName = "Symbol()" if name then wrappedName = ("Symbol(%s)"):format(name) end getmetatable(self).__tostring = function() return wrappedName end return (self :: any) :: Symbol end, }
--Made by Luckymaxer
Tool = script.Parent Handle = Tool:WaitForChild("Handle") Light = Handle:WaitForChild("Light") Players = game:GetService("Players") Debris = game:GetService("Debris") CastLaser = Tool:WaitForChild("CastLaser"):Clone() Modules = Tool:WaitForChild("Modules") Functions = require(Modules:WaitForChild("Functions")) BaseUrl = "http://www.roblox.com/asset/?id=" ConfigurationBin = Tool:WaitForChild("Configuration") Configuration = {} Configuration = Functions.CreateConfiguration(ConfigurationBin, Configuration) ToolEquipped = false Remotes = Tool:WaitForChild("Remotes") Sounds = { Fire = Handle:WaitForChild("Fire"), } BasePart = Instance.new("Part") BasePart.Shape = Enum.PartType.Block BasePart.Material = Enum.Material.Plastic BasePart.TopSurface = Enum.SurfaceType.Smooth BasePart.BottomSurface = Enum.SurfaceType.Smooth BasePart.FormFactor = Enum.FormFactor.Custom BasePart.Size = Vector3.new(0.2, 0.2, 0.2) BasePart.CanCollide = true BasePart.Locked = true BasePart.Anchored = false BaseRay = BasePart:Clone() BaseRay.Name = "Ray" BaseRay.BrickColor = BrickColor.new("CGA Brown") BaseRay.Material = Enum.Material.SmoothPlastic BaseRay.Size = Vector3.new(0.2, 0.2, 0.2) BaseRay.Anchored = true BaseRay.CanCollide = false BaseRayMesh = Instance.new("SpecialMesh") BaseRayMesh.Name = "Mesh" BaseRayMesh.MeshType = Enum.MeshType.Brick BaseRayMesh.Scale = Vector3.new(0.2, 0.2, 1) BaseRayMesh.Offset = Vector3.new(0, 0, 0) BaseRayMesh.VertexColor = Vector3.new(1, 1, 1) BaseRayMesh.Parent = BaseRay ServerControl = (Remotes:FindFirstChild("ServerControl") or Instance.new("RemoteFunction")) ServerControl.Name = "ServerControl" ServerControl.Parent = Remotes ClientControl = (Remotes:FindFirstChild("ClientControl") or Instance.new("RemoteFunction")) ClientControl.Name = "ClientControl" ClientControl.Parent = Remotes Light.Enabled = false Tool.Enabled = true function RayTouched(Hit, Position) if not Hit or not Hit.Parent then return end local character = Hit.Parent if character:IsA("Hat") then character = character.Parent end if character == Character then return end local humanoid = character:FindFirstChild("Humanoid") if not humanoid or humanoid.Health == 0 then return end local player = Players:GetPlayerFromCharacter(character) if player and Functions.IsTeamMate(Player, player) then return end local DeterminedDamage = math.random(Configuration.Damage.MinValue, Configuration.Damage.MaxValue) Functions.UntagHumanoid(humanoid) Functions.TagHumanoid(humanoid, Player) humanoid:TakeDamage(DeterminedDamage) end function CheckIfAlive() return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0) and true) or false) end function Equipped() Character = Tool.Parent Player = Players:GetPlayerFromCharacter(Character) Humanoid = Character:FindFirstChild("Humanoid") if not CheckIfAlive() then return end ToolEquipped = true end function Unequipped() ToolEquipped = false end function InvokeClient(Mode, Value) local ClientReturn = nil pcall(function() ClientReturn = ClientControl:InvokeClient(Player, Mode, Value) end) return ClientReturn end ServerControl.OnServerInvoke = (function(player, Mode, Value) if player ~= Player or not ToolEquipped or not CheckIfAlive() or not Mode or not Value then return end if Mode == "Fire" then Sounds.Fire:Play() elseif Mode == "RayHit" then local RayHit = Value.Hit local RayPosition = Value.Position if RayHit and RayPosition then RayTouched(RayHit, RayPosition) end Light.Color = BaseRay.BrickColor.Color if not Light.Enabled then Light.Enabled = true Delay(0.1, function() Light.Enabled = false end) end elseif Mode == "CastLaser" then local StartPosition = Value.StartPosition local TargetPosition = Value.TargetPosition local RayHit = Value.RayHit if not StartPosition or not TargetPosition or not RayHit then return end for i, v in pairs(Players:GetPlayers()) do if v:IsA("Player") and v ~= Player then local Backpack = v:FindFirstChild("Backpack") if Backpack then local LaserScript = CastLaser:Clone() local StartPos = Instance.new("Vector3Value") StartPos.Name = "StartPosition" StartPos.Value = StartPosition StartPos.Parent = LaserScript local TargetPos = Instance.new("Vector3Value") TargetPos.Name = "TargetPosition" TargetPos.Value = TargetPosition TargetPos.Parent = LaserScript local RayHit = Instance.new("BoolValue") RayHit.Name = "RayHit" RayHit.Value = RayHit RayHit.Parent = LaserScript LaserScript.Disabled = false Debris:AddItem(LaserScript, 1.5) LaserScript.Parent = Backpack end end end end end) Tool.Equipped:connect(Equipped) Tool.Unequipped:connect(Unequipped)
-------------------------
function onClicked() R.Function1.Disabled = true R.Function2.Disabled = false R.BrickColor = BrickColor.new("Institutional white") N.One1.BrickColor = BrickColor.new("Really black") N.One2.BrickColor = BrickColor.new("Really black") N.One4.BrickColor = BrickColor.new("Really black") N.One8.BrickColor = BrickColor.new("Really black") N.Three4.BrickColor = BrickColor.new("Really black") N.Two1.BrickColor = BrickColor.new("Really black") end script.Parent.ClickDetector.MouseClick:connect(onClicked)
--[[ This is a simple signal implementation that has a dead-simple API. local signal = createSignal() local disconnect = signal:subscribe(function(foo) print("Cool foo:", foo) end) signal:fire("something") disconnect() ]]
local function createSignal() local connections = {} local suspendedConnections = {} local firing = false local function subscribe(_self, callback) assert(typeof(callback) == "function", "Can only subscribe to signals with a function.") local connection = { callback = callback, disconnected = false, } -- If the callback is already registered, don't add to the suspendedConnection. Otherwise, this will disable -- the existing one. if firing and not connections[callback] then suspendedConnections[callback] = connection end connections[callback] = connection local function disconnect() assert(not connection.disconnected, "Listeners can only be disconnected once.") connection.disconnected = true connections[callback] = nil suspendedConnections[callback] = nil end return disconnect end local function fire(_self, ...) firing = true for callback, connection in pairs(connections) do if not connection.disconnected and not suspendedConnections[callback] then callback(...) end end firing = false for callback, _ in pairs(suspendedConnections) do suspendedConnections[callback] = nil end end return { subscribe = subscribe, fire = fire, } end return createSignal
-- Reparents an instance and outputs helpful logging information so we can see -- where instances are going at runtime.
local function move(instance: Instance, newParent: Instance) instance.Parent = newParent log("move", ("%s -> %s"):format(instance.Name, instance:GetFullName())) end
--- Shows Cmdr window
function Cmdr:Show () if not self.Enabled then return end Interface.Window:Show() end
--------RIGHT DOOR 7--------
game.Workspace.doorright.l73.BrickColor = BrickColor.new(135) game.Workspace.doorright.l72.BrickColor = BrickColor.new(135) game.Workspace.doorright.l71.BrickColor = BrickColor.new(135) game.Workspace.doorright.l63.BrickColor = BrickColor.new(135) game.Workspace.doorright.l62.BrickColor = BrickColor.new(135) game.Workspace.doorright.l61.BrickColor = BrickColor.new(135) game.Workspace.doorright.l53.BrickColor = BrickColor.new(135) game.Workspace.doorright.l52.BrickColor = BrickColor.new(135) game.Workspace.doorright.l51.BrickColor = BrickColor.new(135) game.Workspace.doorright.l43.BrickColor = BrickColor.new(135) game.Workspace.doorright.l42.BrickColor = BrickColor.new(135) game.Workspace.doorright.l41.BrickColor = BrickColor.new(135) game.Workspace.doorright.l33.BrickColor = BrickColor.new(135) game.Workspace.doorright.l32.BrickColor = BrickColor.new(135) game.Workspace.doorright.l31.BrickColor = BrickColor.new(135) game.Workspace.doorright.l22.BrickColor = BrickColor.new(135) game.Workspace.doorright.l21.BrickColor = BrickColor.new(135) game.Workspace.doorright.l11.BrickColor = BrickColor.new(135) game.Workspace.doorright.l12.BrickColor = BrickColor.new(102) game.Workspace.doorright.l13.BrickColor = BrickColor.new(102) game.Workspace.doorright.l23.BrickColor = BrickColor.new(102)
-- ScreenSize -> WorldSize
function ScreenSpace.ScreenWidthToWorldWidth(screenWidth, depth) local aspectRatio = ScreenSpace.AspectRatio() local hfactor = math.tan(math.rad(workspace.CurrentCamera.FieldOfView)/2) local wfactor = aspectRatio*hfactor local sx = ScreenSpace.ViewSizeX() -- return -(screenWidth / sx) * 2 * wfactor * depth end function ScreenSpace.ScreenHeightToWorldHeight(screenHeight, depth) local hfactor = math.tan(math.rad(workspace.CurrentCamera.FieldOfView)/2) local sy = ScreenSpace.ViewSizeY() -- return -(screenHeight / sy) * 2 * hfactor * depth end
--[[ Package link auto-generated by Rotriever ]]
local PackageIndex = script.Parent._Index return require(PackageIndex["roact-fit-components-d6c8b1ec-a4a29eae"].Packages["roact-fit-components"])
--------RIGHT DOOR 3--------
game.Workspace.doorright.l71.BrickColor = BrickColor.new(135) game.Workspace.doorright.l72.BrickColor = BrickColor.new(135) game.Workspace.doorright.l73.BrickColor = BrickColor.new(135) game.Workspace.doorright.l61.BrickColor = BrickColor.new(135) game.Workspace.doorright.l62.BrickColor = BrickColor.new(135) game.Workspace.doorright.l51.BrickColor = BrickColor.new(135) game.Workspace.doorright.l11.BrickColor = BrickColor.new(102) game.Workspace.doorright.l12.BrickColor = BrickColor.new(102) game.Workspace.doorright.l13.BrickColor = BrickColor.new(102) game.Workspace.doorright.l41.BrickColor = BrickColor.new(102) game.Workspace.doorright.l42.BrickColor = BrickColor.new(102) game.Workspace.doorright.l43.BrickColor = BrickColor.new(102) game.Workspace.doorright.l21.BrickColor = BrickColor.new(102) game.Workspace.doorright.l22.BrickColor = BrickColor.new(102) game.Workspace.doorright.l23.BrickColor = BrickColor.new(102) game.Workspace.doorright.l51.BrickColor = BrickColor.new(102) game.Workspace.doorright.l52.BrickColor = BrickColor.new(102) game.Workspace.doorright.l31.BrickColor = BrickColor.new(102) game.Workspace.doorright.l32.BrickColor = BrickColor.new(102) game.Workspace.doorright.l33.BrickColor = BrickColor.new(102) game.Workspace.doorright.l63.BrickColor = BrickColor.new(102)
------------------- --rootpart.Touched:Connect(function(hit) -- if hit.Parent and not hit.Parent:FindFirstChild("Humanoid") and hit.CanCollide == true then -- humanoid.Jump = true -- end --end) -- 벽 닿으면 점프하는 단락
--CHANGE THE NAME, COPY ALL BELOW, AND PAST INTO COMMAND BAR
local TycoonName = "Batman tycoon" if game.Workspace:FindFirstChild(TycoonName) then local s = nil local bTycoon = game.Workspace:FindFirstChild(TycoonName) local zTycoon = game.Workspace:FindFirstChild("Zednov's Tycoon Kit") local new_Collector = zTycoon['READ ME'].Script:Clone() local Gate = zTycoon.Tycoons:GetChildren()[1].Entrance['Touch to claim!'].GateControl:Clone() if zTycoon then for i,v in pairs(zTycoon.Tycoons:GetChildren()) do --Wipe current tycoon 'demo' if v then s = v.PurchaseHandler:Clone() v:Destroy() end end -- Now make it compatiable if s ~= nil then for i,v in pairs(bTycoon.Tycoons:GetChildren()) do local New_Tycoon = v:Clone() New_Tycoon:FindFirstChild('PurchaseHandler'):Destroy() s:Clone().Parent = New_Tycoon local Team_C = Instance.new('BrickColorValue',New_Tycoon) Team_C.Value = BrickColor.new(tostring(v.Name)) Team_C.Name = "TeamColor" New_Tycoon.Name = v.TeamName.Value New_Tycoon.Cash.Name = "CurrencyToCollect" New_Tycoon.Parent = zTycoon.Tycoons New_Tycoon.TeamName:Destroy() v:Destroy() New_Tycoon.Essentials:FindFirstChild('Cash to collect: $0').NameUpdater:Destroy() local n = new_Collector:Clone() n.Parent = New_Tycoon.Essentials:FindFirstChild('Cash to collect: $0') n.Disabled = false New_Tycoon.Gate['Touch to claim ownership!'].GateControl:Destroy() local g = Gate:Clone() g.Parent = New_Tycoon.Gate['Touch to claim ownership!'] end else error("Please don't tamper with script names or this won't work!") end else error("Please don't change the name of our tycoon kit or it won't work!") end bTycoon:Destroy() Gate:Destroy() new_Collector:Destroy() print('Transfer complete! :)') else error("Check if you spelt the kit's name wrong!") end
-------------------------------------------------------------------------
local function IsInBottomLeft(pt) local joystickHeight = math_min(Utility.ViewSizeY() * 0.33, 250) local joystickWidth = joystickHeight return pt.X <= joystickWidth and pt.Y > Utility.ViewSizeY() - joystickHeight end local function IsInBottomRight(pt) local joystickHeight = math_min(Utility.ViewSizeY() * 0.33, 250) local joystickWidth = joystickHeight return pt.X >= Utility.ViewSizeX() - joystickWidth and pt.Y > Utility.ViewSizeY() - joystickHeight end local function CheckAlive(character) local humanoid = findPlayerHumanoid(Player) return humanoid ~= nil and humanoid.Health > 0 end local function GetEquippedTool(character) if character ~= nil then for _, child in pairs(character:GetChildren()) do if child:IsA('Tool') then return child end end end end local ExistingPather = nil local ExistingIndicator = nil local PathCompleteListener = nil local PathFailedListener = nil local function CleanupPath() DrivingTo = nil if ExistingPather then ExistingPather:Cancel() end if PathCompleteListener then PathCompleteListener:disconnect() PathCompleteListener = nil end if PathFailedListener then PathFailedListener:disconnect() PathFailedListener = nil end if ExistingIndicator then local obj = ExistingIndicator local tween = obj:TweenOut() local tweenCompleteEvent = nil tweenCompleteEvent = tween.Completed:connect(function() tweenCompleteEvent:disconnect() obj.Model:Destroy() end) ExistingIndicator = nil end end local function getExtentsSize(Parts) local maxX,maxY,maxZ = -math.huge,-math.huge,-math.huge local minX,minY,minZ = math.huge,math.huge,math.huge for i = 1, #Parts do maxX,maxY,maxZ = math_max(maxX, Parts[i].Position.X), math_max(maxY, Parts[i].Position.Y), math_max(maxZ, Parts[i].Position.Z) minX,minY,minZ = math_min(minX, Parts[i].Position.X), math_min(minY, Parts[i].Position.Y), math_min(minZ, Parts[i].Position.Z) end return Region3.new(Vector3_new(minX, minY, minZ), Vector3_new(maxX, maxY, maxZ)) end local function inExtents(Extents, Position) if Position.X < (Extents.CFrame.p.X - Extents.Size.X/2) or Position.X > (Extents.CFrame.p.X + Extents.Size.X/2) then return false end if Position.Z < (Extents.CFrame.p.Z - Extents.Size.Z/2) or Position.Z > (Extents.CFrame.p.Z + Extents.Size.Z/2) then return false end --ignoring Y for now return true end local FailCount = 0 local function OnTap(tapPositions, goToPoint) -- Good to remember if this is the latest tap event local camera = workspace.CurrentCamera local character = Player.Character if not CheckAlive(character) then return end -- This is a path tap position if #tapPositions == 1 or goToPoint then if camera then local unitRay = camera:ScreenPointToRay(tapPositions[1].x, tapPositions[1].y) local ray = Ray.new(unitRay.Origin, unitRay.Direction*400) -- inivisicam stuff local initIgnore = getIgnoreList() local invisicamParts = InvisicamModule:GetObscuredParts() local ignoreTab = {} -- add to the ignore list for i, v in pairs(invisicamParts) do ignoreTab[#ignoreTab+1] = i end for i = 1, #initIgnore do ignoreTab[#ignoreTab+1] = initIgnore[i] end -- local myHumanoid = findPlayerHumanoid(Player) local hitPart, hitPt, hitNormal, hitMat = Utility.Raycast(ray, true, ignoreTab) local hitChar, hitHumanoid = Utility.FindChacterAncestor(hitPart) local torso = GetTorso() local startPos = torso.CFrame.p if goToPoint then hitPt = goToPoint hitChar = nil end if hitChar and hitHumanoid and hitHumanoid.Torso and (hitHumanoid.Torso.CFrame.p - torso.CFrame.p).magnitude < 7 then CleanupPath() if myHumanoid then myHumanoid:MoveTo(hitPt) end -- Do shoot local currentWeapon = GetEquippedTool(character) if currentWeapon then currentWeapon:Activate() LastFired = tick() end elseif hitPt and character and not CurrentSeatPart then local thisPather = Pather(character, hitPt, hitNormal) if thisPather:IsValidPath() then FailCount = 0 thisPather:Start() if BindableEvent_OnFailStateChanged then BindableEvent_OnFailStateChanged:Fire(false) end CleanupPath() local destinationPopup = createNewPopup("DestinationPopup") destinationPopup:Place(hitPt, Vector3_new(0,hitPt.y,0)) local failurePopup = createNewPopup("FailurePopup") local currentTween = destinationPopup:TweenIn() ExistingPather = thisPather ExistingIndicator = destinationPopup PathCompleteListener = thisPather.Finished:connect(function() if destinationPopup then if ExistingIndicator == destinationPopup then ExistingIndicator = nil end local tween = destinationPopup:TweenOut() local tweenCompleteEvent = nil tweenCompleteEvent = tween.Completed:connect(function() tweenCompleteEvent:disconnect() destinationPopup.Model:Destroy() destinationPopup = nil end) end if hitChar then local humanoid = findPlayerHumanoid(Player) local currentWeapon = GetEquippedTool(character) if currentWeapon then currentWeapon:Activate() LastFired = tick() end if humanoid then humanoid:MoveTo(hitPt) end end end) PathFailedListener = thisPather.PathFailed:connect(function() if failurePopup then failurePopup:Place(hitPt, Vector3_new(0,hitPt.y,0)) local failTweenIn = failurePopup:TweenIn() failTweenIn.Completed:wait() local failTweenOut = failurePopup:TweenOut() failTweenOut.Completed:wait() failurePopup.Model:Destroy() failurePopup = nil end end) else if hitPt then -- Feedback here for when we don't have a good path local foundDirectPath = false if (hitPt-startPos).Magnitude < 25 and (startPos.y-hitPt.y > -3) then -- move directly here if myHumanoid then if myHumanoid.Sit then myHumanoid.Jump = true end local currentPosition myHumanoid:MoveTo(hitPt) foundDirectPath = true end end spawn(function() local directPopup = createNewPopup(foundDirectPath and "DirectWalkPopup" or "FailurePopup") directPopup:Place(hitPt, Vector3_new(0,hitPt.y,0)) local directTweenIn = directPopup:TweenIn() directTweenIn.Completed:wait() local directTweenOut = directPopup:TweenOut() directTweenOut.Completed:wait() directPopup.Model:Destroy() directPopup = nil end) end end elseif hitPt and character and CurrentSeatPart then local destinationPopup = createNewPopup("DestinationPopup") ExistingIndicator = destinationPopup destinationPopup:Place(hitPt, Vector3_new(0,hitPt.y,0)) destinationPopup:TweenIn() DrivingTo = hitPt local ConnectedParts = CurrentSeatPart:GetConnectedParts(true) while wait() do if CurrentSeatPart and ExistingIndicator == destinationPopup then local ExtentsSize = getExtentsSize(ConnectedParts) if inExtents(ExtentsSize, hitPt) then local popup = destinationPopup spawn(function() local tweenOut = popup:TweenOut() tweenOut.Completed:wait() popup.Model:Destroy() end) destinationPopup = nil DrivingTo = nil break end else if CurrentSeatPart == nil and destinationPopup == ExistingIndicator then DrivingTo = nil OnTap(tapPositions, hitPt) end local popup = destinationPopup spawn(function() local tweenOut = popup:TweenOut() tweenOut.Completed:wait() popup.Model:Destroy() end) destinationPopup = nil break end end end end elseif #tapPositions >= 2 then if camera then -- Do shoot local avgPoint = Utility.AveragePoints(tapPositions) local unitRay = camera:ScreenPointToRay(avgPoint.x, avgPoint.y) local currentWeapon = GetEquippedTool(character) if currentWeapon then currentWeapon:Activate() LastFired = tick() end end end end local function CreateClickToMoveModule() local this = {} local LastStateChange = 0 local LastState = Enum.HumanoidStateType.Running local FingerTouches = {} local NumUnsunkTouches = 0 -- PC simulation local mouse1Down = tick() local mouse1DownPos = Vector2_new() local mouse2Down = tick() local mouse2DownPos = Vector2_new() local mouse2Up = tick() local movementKeys = { [Enum.KeyCode.W] = true; [Enum.KeyCode.A] = true; [Enum.KeyCode.S] = true; [Enum.KeyCode.D] = true; [Enum.KeyCode.Up] = true; [Enum.KeyCode.Down] = true; } local TapConn = nil local InputBeganConn = nil local InputChangedConn = nil local InputEndedConn = nil local HumanoidDiedConn = nil local CharacterChildAddedConn = nil local OnCharacterAddedConn = nil local CharacterChildRemovedConn = nil local RenderSteppedConn = nil local HumanoidSeatedConn = nil local function disconnectEvent(event) if event then event:disconnect() end end local function DisconnectEvents() disconnectEvent(TapConn) disconnectEvent(InputBeganConn) disconnectEvent(InputChangedConn) disconnectEvent(InputEndedConn) disconnectEvent(HumanoidDiedConn) disconnectEvent(CharacterChildAddedConn) disconnectEvent(OnCharacterAddedConn) disconnectEvent(RenderSteppedConn) disconnectEvent(CharacterChildRemovedConn) pcall(function() RunService:UnbindFromRenderStep("ClickToMoveRenderUpdate") end) disconnectEvent(HumanoidSeatedConn) end local function IsFinite(num) return num == num and num ~= 1/0 and num ~= -1/0 end local function findAngleBetweenXZVectors(vec2, vec1) return math_atan2(vec1.X*vec2.Z-vec1.Z*vec2.X, vec1.X*vec2.X + vec1.Z*vec2.Z) end -- Setup the camera CameraModule = OrbitalCamModule() local function OnTouchBegan(input, processed) if FingerTouches[input] == nil and not processed then NumUnsunkTouches = NumUnsunkTouches + 1 end FingerTouches[input] = processed end local function OnTouchChanged(input, processed) if FingerTouches[input] == nil then FingerTouches[input] = processed if not processed then NumUnsunkTouches = NumUnsunkTouches + 1 end end end local function OnTouchEnded(input, processed) if FingerTouches[input] ~= nil and FingerTouches[input] == false then NumUnsunkTouches = NumUnsunkTouches - 1 end FingerTouches[input] = nil end local function OnCharacterAdded(character) DisconnectEvents() InputBeganConn = UIS.InputBegan:connect(function(input, processed) if input.UserInputType == Enum.UserInputType.Touch then OnTouchBegan(input, processed) -- Give back controls when they tap both sticks local wasInBottomLeft = IsInBottomLeft(input.Position) local wasInBottomRight = IsInBottomRight(input.Position) if wasInBottomRight or wasInBottomLeft then for otherInput, _ in pairs(FingerTouches) do if otherInput ~= input then local otherInputInLeft = IsInBottomLeft(otherInput.Position) local otherInputInRight = IsInBottomRight(otherInput.Position) if otherInput.UserInputState ~= Enum.UserInputState.End and ((wasInBottomLeft and otherInputInRight) or (wasInBottomRight and otherInputInLeft)) then if BindableEvent_OnFailStateChanged then BindableEvent_OnFailStateChanged:Fire(true) end return end end end end end -- Cancel path when you use the keyboard controls. if processed == false and input.UserInputType == Enum.UserInputType.Keyboard and movementKeys[input.KeyCode] then CleanupPath() end if input.UserInputType == Enum.UserInputType.MouseButton1 then mouse1Down = tick() mouse1DownPos = input.Position end if input.UserInputType == Enum.UserInputType.MouseButton2 then mouse2Down = tick() mouse2DownPos = input.Position end end) InputChangedConn = UIS.InputChanged:connect(function(input, processed) if input.UserInputType == Enum.UserInputType.Touch then OnTouchChanged(input, processed) end end) InputEndedConn = UIS.InputEnded:connect(function(input, processed) if input.UserInputType == Enum.UserInputType.Touch then OnTouchEnded(input, processed) end if input.UserInputType == Enum.UserInputType.MouseButton2 then mouse2Up = tick() local currPos = input.Position if mouse2Up - mouse2Down < 0.25 and (currPos - mouse2DownPos).magnitude < 5 then local positions = {currPos} OnTap(positions) end end end) TapConn = UIS.TouchTap:connect(function(touchPositions, processed) if not processed then OnTap(touchPositions) end end) local function computeThrottle(dist) if dist > .2 then return 0.5+(dist^2)/2 else return 0 end end local function getThrottleAndSteer(object, point) local throttle, steer = 0, 0 local oCF = object.CFrame local relativePosition = oCF:pointToObjectSpace(point) local relativeZDirection = -relativePosition.z local relativeDistance = relativePosition.magnitude -- throttle quadratically increases from 0-1 as distance from the selected point goes from 0-50, after 50, throttle is 1. -- this allows shorter distance travel to have more fine-tuned control. throttle = computeThrottle(math_min(1,relativeDistance/50))*math.sign(relativeZDirection) local steerAngle = -math_atan2(-relativePosition.x, -relativePosition.z) steer = steerAngle/(math_pi/4) return throttle, steer end local function Update() if CameraModule then CameraModule.UserPanningTheCamera = true if CameraModule.UserPanningTheCamera then CameraModule.UpdateTweenFunction = nil else if CameraModule.UpdateTweenFunction then local done = CameraModule.UpdateTweenFunction() if done then CameraModule.UpdateTweenFunction = nil end end end CameraModule:Update() end if CurrentSeatPart then if DrivingTo then local throttle, steer = getThrottleAndSteer(CurrentSeatPart, DrivingTo) CurrentSeatPart.ThrottleFloat = throttle CurrentSeatPart.SteerFloat = steer else CurrentSeatPart.ThrottleFloat = 0 CurrentSeatPart.SteerFloat = 0 end end end RunService:BindToRenderStep("ClickToMoveRenderUpdate",Enum.RenderPriority.Camera.Value - 1,Update) local function onSeated(child, active, currentSeatPart) if active then if TouchJump and UIS.TouchEnabled then TouchJump:Enable() end if currentSeatPart and currentSeatPart.ClassName == "VehicleSeat" then CurrentSeatPart = currentSeatPart end else CurrentSeatPart = nil if TouchJump and UIS.TouchEnabled then TouchJump:Disable() end end end local function OnCharacterChildAdded(child) if UIS.TouchEnabled then if child:IsA('Tool') then child.ManualActivationOnly = true end end if child:IsA('Humanoid') then disconnectEvent(HumanoidDiedConn) HumanoidDiedConn = child.Died:connect(function() if ExistingIndicator then DebrisService:AddItem(ExistingIndicator.Model, 1) end end) HumanoidSeatedConn = child.Seated:connect(function(active, seat) onSeated(child, active, seat) end) if child.SeatPart then onSeated(child, true, child.SeatPart) end end end CharacterChildAddedConn = character.ChildAdded:connect(function(child) OnCharacterChildAdded(child) end) CharacterChildRemovedConn = character.ChildRemoved:connect(function(child) if UIS.TouchEnabled then if child:IsA('Tool') then child.ManualActivationOnly = false end end end) for _, child in pairs(character:GetChildren()) do OnCharacterChildAdded(child) end end local Running = false function this:Stop() if Running then DisconnectEvents() CleanupPath() if CameraModule then CameraModule.UpdateTweenFunction = nil CameraModule:SetEnabled(false) end -- Restore tool activation on shutdown if UIS.TouchEnabled then local character = Player.Character if character then for _, child in pairs(character:GetChildren()) do if child:IsA('Tool') then child.ManualActivationOnly = false end end end end DrivingTo = nil Running = false end end function this:Start() if not Running then if Player.Character then -- retro-listen OnCharacterAdded(Player.Character) end OnCharacterAddedConn = Player.CharacterAdded:connect(OnCharacterAdded) if CameraModule then CameraModule:SetEnabled(true) end Running = true end end return this end return CreateClickToMoveModule
-- Right Legs
character.RagdollRig.ConstraintRightUpperLeg.Attachment0 = RUL character.RagdollRig.ConstraintRightUpperLeg.Attachment1 = RULRig character.RagdollRig.ConstraintRightLowerLeg.Attachment0 = RLL character.RagdollRig.ConstraintRightLowerLeg.Attachment1 = RLLRig character.RagdollRig.ConstraintRightFoot.Attachment0 = RF character.RagdollRig.ConstraintRightFoot.Attachment1 = RFRig wait(0.1)
--Disable script if car is removed from workspace
Car.AncestryChanged:Connect(function() if not Car:IsDescendantOf(Workspace) then unbindActions() LocalVehicleSeating.ExitSeat() LocalVehicleSeating.DisconnectFromSeatExitEvent(onExitSeat) -- stop seated anim --print("car removed from workspace") script.Disabled = true ProximityPromptService.Enabled = true end end) local function exitVehicle(action, inputState, inputObj) if inputState == Enum.UserInputState.Begin then LocalVehicleSeating.ExitSeat() -- stop seated anim end end local function _updateRawInput(_, inputState, inputObj) local key = inputObj.KeyCode local data = Keymap.getData(key) if not data then return end local axis = data.Axis local val = 0 if axis then val = inputObj.Position:Dot(axis) else val = (inputState == Enum.UserInputState.Begin or inputState == Enum.UserInputState.Change) and 1 or 0 end val = val * (data.Sign or 1) _rawInput[key] = val if data.Pass then return Enum.ContextActionResult.Pass end end local function _calculateInput(action) -- Loop through all mappings for this action and calculate a resultant value from the raw input local mappings = Keymap[action] local val = 0 local absVal = val for _, data in ipairs(mappings) do local thisVal = _rawInput[data.KeyCode] if math.abs(thisVal) > absVal then val = thisVal absVal = math.abs(val) end end return val end ContextActionService:BindAction( EXIT_ACTION_NAME, exitVehicle, false, Keymap.EnterVehicleGamepad, Keymap.EnterVehicleKeyboard ) ContextActionService:BindActionAtPriority( RAW_INPUT_ACTION_NAME, _updateRawInput, false, Enum.ContextActionPriority.High.Value, unpack(Keymap.allKeys()))
--[[ To make another trader, duplicate a trader and change the proximity prompt text in their UpperTorso ActionText: "FinalItemName" ObjectText = "ItemRequired: 0/AmountRequired" ]]
local function trade(PP) local char = plr.Character if not char then return end local tool = char:FindFirstChildWhichIsA("Tool") if not tool or not tool:FindFirstChild("Handle") then return end local args = string.split(PP.ObjectText, ": ") local required, amount = args[1], args[2] if not required or not amount then return end args = string.split(amount, "/") local given,max = args[1], args[2] given = tonumber(given) if tool.Name == required then given +=1 local final = given >= tonumber(max) events.TradeItem:FireServer(PP, final) if final then PP.ObjectText = "Finished!" else PP.ObjectText = required .. ": " .. tostring(given) .. "/" .. max end end end NPCs.Seller.UpperTorso.ProximityPrompt.Triggered:Connect(function(plr) local char = plr.Character if not char then return end local tool = char:FindFirstChildWhichIsA("Tool") if not tool or not tool:FindFirstChild("Handle") then return end local res = tool.Handle:FindFirstChild("Price") if res then tool:Destroy() plr.Wallet.Value += res.Value end end) for i,trader in NPCs.Traders:GetChildren() do local PP = trader.UpperTorso.ProximityPrompt PP.Triggered:Connect(function() trade(PP) end) end
--------------------[ FIRING FUNCTIONS ]----------------------------------------------
function lowerSpread() if (not loweringSpread) then loweringSpread = true local Connection = nil Connection = RS.Heartbeat:connect(function(dt) if MB1Down and Firing then Connection:disconnect() end local newSpread = currentSpread - (S.spreadSettings.Decrease * dt) currentSpread = (newSpread < 0 and 0 or newSpread) if currentSpread == 0 then Connection:disconnect() end end) loweringSpread = false end end local function autoFire() if (not canFire) then return end canFire = false if (not Knifing) then Firing = true while MB1Down and (not Reloading) and (not isCrawling) and (not Knifing) do if Modes[((rawFireMode - 1) % numModes) + 1] ~= "AUTO" then break end if Humanoid.Health == 0 then break end if Ammo.Value > 0 then Ammo.Value = Ammo.Value - 1 if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then steadyKeyPressed = false currentSteadyTime = 0 end newMag = false fireGun() end if S.reloadSettings.magIsBullet then for _, Mag in pairs(Gun:GetChildren()) do if Mag.Name:sub(1, 3) == "Mag" then Mag.Transparency = 1 end end end if Ammo.Value == 0 and S.reloadSettings.autoReload then wait(0.2) Reload() end wait(60 / S.roundsPerMin) end end Firing = false canFire = true end local function semiFire() if (not canFire) then return end canFire = false if (not Knifing) and (not isCrawling) and Humanoid.Health ~= 0 then Firing = true if Ammo.Value > 0 then Ammo.Value = Ammo.Value - 1 if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then steadyKeyPressed = false currentSteadyTime = 0 end newMag = false fireGun() end if S.reloadSettings.magIsBullet then for _, Mag in pairs(Gun:GetChildren()) do if Mag.Name:sub(1, 3) == "Mag" then Mag.Transparency = 1 end end end if Ammo.Value == 0 and S.reloadSettings.autoReload then wait(0.2) Reload() end wait(60 / S.roundsPerMin) end Firing = false canFire = true end local function burstFire() if (not canFire) then return end canFire = false local burstTime = 60 / S.roundsPerMin if (not Knifing) and (not isCrawling) then Firing = true for i = 1, S.burstSettings.Amount do if Ammo.Value > 0 then Ammo.Value = Ammo.Value - 1 if Humanoid.Health ~= 0 then if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then steadyKeyPressed = false currentSteadyTime = 0 end newMag = false fireGun() end end if Ammo.Value == 0 and S.reloadSettings.autoReload then wait(0.2) Reload() break end wait(S.burstSettings.fireRateBurst and burstTime or S.burstSettings.Time / S.burstSettings.Amount) end end if S.reloadSettings.magIsBullet then for _, Mag in pairs(Gun:GetChildren()) do if Mag.Name:sub(1, 3) == "Mag" then Mag.Transparency = 1 end end end Firing = false wait(S.burstSettings.fireRateBurst and burstTime or S.burstSettings.Wait) canFire = true end function fireGun() local fireSound = Handle:FindFirstChild("FireSound") if fireSound then fireSound:Play() end ---------------------------------------------------------------------------------- for _ = 1, (S.gunType.Shot and S.ShotAmount or 1) do local randSpread1 = RAD(RAND(0, 365)) local randSpread2 = RAD(RAND(-(baseSpread + currentSpread), baseSpread + currentSpread, 0.01)) local spreadDir = CFrame.fromAxisAngle(V3(0, 0, 1), randSpread1) * CFANG(randSpread2, 0, 0) local originCF = ((Aimed and S.guiScope) and Head.CFrame or Handle.CFrame) * spreadDir local bulletDirection = CF(originCF.p, originCF.p + originCF.lookVector).lookVector if S.bulletSettings.instantHit then local newRay = Ray.new(Main.CFrame.p, bulletDirection * S.bulletSettings.Range) local H, P, N = workspace:FindPartOnRayWithIgnoreList(newRay, Ignore) local finalP = P if H then if S.gunType.Explosive then if S.explosionSettings.soundId ~= "" then local soundPart = Instance.new("Part") soundPart.Transparency = 1 soundPart.Anchored = true soundPart.CanCollide = false soundPart.Size = V3(1, 1, 1) soundPart.CFrame = CFrame.new(P) soundPart.Parent = gunIgnore local Sound = Instance.new("Sound") Sound.Pitch = S.explosionSettings.Pitch Sound.SoundId = S.explosionSettings.soundId Sound.Volume = S.explosionSettings.Volume Sound.Parent = soundPart Sound:Play() DS:AddItem(soundPart, Sound.TimeLength) end createBulletImpact:FireServer(H, P, N, bulletDirection, false, gunIgnore, S) createShockwave:FireServer(P, S.explosionSettings.Radius, gunIgnore, S) local E = Instance.new("Explosion") E.BlastPressure = S.explosionSettings.Pressure E.BlastRadius = S.explosionSettings.Radius E.DestroyJointRadiusPercent = (S.explosionSettings.rangeBasedDamage and 0 or 1) E.ExplosionType = S.explosionSettings.Type E.Position = P E.Hit:connect(function(Obj, Dist) if Obj.Name == "Torso" and (not Obj:IsDescendantOf(Char)) then if S.explosionSettings.rangeBasedDamage then local Dir = (Obj.Position - P).unit local expH, _ = workspace:FindPartOnRayWithIgnoreList( Ray.new(P - Dir * 0.1, Dir * 999), Ignore ) local rayHitHuman = expH:IsDescendantOf(Obj.Parent) if (S.explosionSettings.rayCastExplosions and rayHitHuman) or (not S.explosionSettings.rayCastExplosions) then local hitHumanoid = findFirstClass(Obj.Parent, "Humanoid") if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then local distFactor = Dist / S.explosionSettings.Radius local distInvert = math.max(1 - distFactor,0) local newDamage = distInvert * getBaseDamage((P - Main.CFrame.p).magnitude) local Tag = Instance.new("ObjectValue") Tag.Value = Player Tag.Name = "creator" Tag.Parent = hitHumanoid DS:AddItem(Tag, 0.3) hitHumanoid:TakeDamage(newDamage) markHit() end end else local hitHumanoid = findFirstClass(Obj.Parent, "Humanoid") if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then local Tag = Instance.new("ObjectValue") Tag.Value = Player Tag.Name = "creator" Tag.Parent = hitHumanoid DS:AddItem(Tag, 0.3) markHit() end end end end) E.Parent = game.Workspace else _, finalP = penetrateWall(H, P, bulletDirection, N, {Char, ignoreModel}, 0, (P - Main.CFrame.p).magnitude, nil) end end if S.bulletTrail and S.trailSettings.Transparency ~= 1 then createTrail:FireServer(Main.CFrame.p, finalP, gunIgnore, S) end else local shell = Instance.new("Part") shell.CFrame = Gun.Chamber.CFrame * CFrame.fromEulerAnglesXYZ(-1.5,0,0) shell.Size = Vector3.new(1,1,1) shell.BrickColor = BrickColor.new(24) shell.Reflectance = .5 shell.CanCollide = false shell.BottomSurface = 0 shell.TopSurface = 0 shell.Name = "Shell" shell.Velocity = Gun.Chamber.CFrame.lookVector * 30 + Vector3.new(math.random(-10,10),20,math.random(-10,10)) shell.RotVelocity = Vector3.new(0,200,0) local shellmesh = Instance.new("CylinderMesh") shellmesh.Scale = Vector3.new(0.1, 0.8, 0.1) shellmesh.Parent = shell shell.Parent = game.Workspace game:GetService("Debris"):addItem(shell,2) local shellmesh = Instance.new("SpecialMesh") shellmesh.Scale = Vector3.new(0.9,0.9,3) shellmesh.MeshId = "http://www.roblox.com/asset/?id=95387759" shellmesh.TextureId = "http://www.roblox.com/asset/?id=95387789" shellmesh.MeshType = "FileMesh" shellmesh.Parent = shell end end function MarkHit() spawn(function() if Gui_Clone:IsDescendantOf(game) then Gui_Clone.HitMarker.Visible = true local StartMark = tick() LastMark = StartMark wait(0.5) if LastMark <= StartMark then Gui_Clone.HitMarker.Visible = false end end end) end ---------------------------------------------------------------------------------- currentSpread = currentSpread + S.spreadSettings.Increase for _, Plugin in pairs(Plugins.Firing) do spawn(function() Plugin() end) end local backRecoil = RAND(S.recoilSettings.Recoil.Back.Min, S.recoilSettings.Recoil.Back.Max, 0.01) --Get the kickback recoil local upRecoil = RAND(S.recoilSettings.Recoil.Up.Min, S.recoilSettings.Recoil.Up.Max, 0.01) --Get the up recoil local sideRecoilAlpha = 0 if lastSideRecoil[1] < 0 and lastSideRecoil[2] < 0 then --This conditional basically makes sure the gun tilt isn't in the same direction for more than 2 shots sideRecoilAlpha = RAND(0, 1, 0.1) elseif lastSideRecoil[1] > 0 and lastSideRecoil[2] > 0 then sideRecoilAlpha = RAND(-1, 0, 0.1) else sideRecoilAlpha = RAND(-1, 1, 0.1) end local sideRecoil = numLerp(S.recoilSettings.Recoil.Side.Left, S.recoilSettings.Recoil.Side.Right, sideRecoilAlpha / 2 + 0.5) --Get the side recoil local tiltRecoil = numLerp(S.recoilSettings.Recoil.Tilt.Left, S.recoilSettings.Recoil.Tilt.Right, sideRecoilAlpha / 2 + 0.5) --Get the tilt recoil local recoilPos = V3( 0,---sideRecoil, 0, -backRecoil ) * (Aimed and S.recoilSettings.aimedMultiplier or 1) local recoilRot = V3( (Aimed and 0 or (-RAD(upRecoil * 10) * (firstShot and S.recoilSettings.firstShotMultiplier or 1))), RAD(sideRecoil * 10), RAD(tiltRecoil * 10) ) * (Aimed and S.recoilSettings.aimedMultiplier or 1) local camRecoilRot = V3( -RAD(sideRecoil * 10), RAD(upRecoil * 10) * (firstShot and S.recoilSettings.firstShotMultiplier or 1) * S.recoilSettings.camMultiplier, 0 ) * (Aimed and S.recoilSettings.aimedMultiplier or 1) * stanceSway tweenRecoil(recoilPos, recoilRot, Sine, 0.2) tweenCam("Recoil", camRecoilRot, Sine, 0.15 * (firstShot and S.recoilSettings.firstShotMultiplier or 1)) for _, v in pairs(Main:GetChildren()) do if v.Name:sub(1, 7) == "FlashFX" then v.Enabled = true end end local shell = Instance.new("Part") shell.CFrame = Gun.Chamber.CFrame * CFrame.fromEulerAnglesXYZ(-1.5,0,0) shell.Size = Vector3.new(0.2,0.5,0.2) shell.CanCollide = true shell.Name = "Shell" shell.Velocity = Gun.Chamber.CFrame.lookVector * 30 + Vector3.new(math.random(-10,10),20,math.random(-10,10)) shell.RotVelocity = Vector3.new(0,200,0) shell.Parent = game.Workspace game:GetService("Debris"):addItem(shell,2) local shellmesh = Instance.new("SpecialMesh") shellmesh.Scale = Vector3.new(0.5,0.5,0.5) shellmesh.MeshId = "http://www.roblox.com/asset/?id=94248124" shellmesh.TextureId = "http://www.roblox.com/asset/?id=94219470" shellmesh.MeshType = "FileMesh" shellmesh.Parent = shell delay(1 / 20, function() tweenRecoil(V3(), V3(), Sine, 0.2) tweenCam("Recoil", V3(), Sine, 0.2) for _, v in pairs(Main:GetChildren()) do if v.Name:sub(1, 7) == "FlashFX" then v.Enabled = false end end end) updateClipAmmo() firstShot = false shotCount = shotCount + 1 lastSideRecoil[(shotCount % 2) + 1] = sideRecoilAlpha end function markHit() spawn(function() if mainGUI:IsDescendantOf(game) then hitMarker.Visible = true local startMark = tick() hitMarker.lastMark.Value = startMark wait(0.5) if hitMarker.lastMark.Value <= startMark then hitMarker.Visible = false end end end) end
--[[ update_settings = { ExistingProfileHandle = function(latest_data), MissingProfileHandle = function(latest_data), EditProfile = function(lastest_data), } --]]
local function StandardProfileUpdateAsyncDataStore(profile_store, profile_key, update_settings, is_user_mock, is_get_call, version) --> loaded_data, key_info local loaded_data, key_info local success, error_message = pcall(function() local transform_function = function(latest_data) local missing_profile = false local data_corrupted = false local global_updates_data = {0, {}} if latest_data == nil then missing_profile = true elseif type(latest_data) ~= "table" then missing_profile = true data_corrupted = true end if type(latest_data) == "table" then -- Case #1: Profile was loaded if type(latest_data.Data) == "table" and type(latest_data.MetaData) == "table" and type(latest_data.GlobalUpdates) == "table" then latest_data.WasCorrupted = false -- Must be set to false if set previously global_updates_data = latest_data.GlobalUpdates if update_settings.ExistingProfileHandle ~= nil then update_settings.ExistingProfileHandle(latest_data) end -- Case #2: Profile was not loaded but GlobalUpdate data exists elseif latest_data.Data == nil and latest_data.MetaData == nil and type(latest_data.GlobalUpdates) == "table" then latest_data.WasCorrupted = false -- Must be set to false if set previously global_updates_data = latest_data.GlobalUpdates or global_updates_data missing_profile = true else missing_profile = true data_corrupted = true end end -- Case #3: Profile was not created or corrupted and no GlobalUpdate data exists if missing_profile == true then latest_data = { -- Data = nil, -- MetaData = nil, GlobalUpdates = global_updates_data, } if update_settings.MissingProfileHandle ~= nil then update_settings.MissingProfileHandle(latest_data) end end -- Editing profile: if update_settings.EditProfile ~= nil then update_settings.EditProfile(latest_data) end -- Data corruption handling (Silently override with empty profile) (Also run Case #1) if data_corrupted == true then latest_data.WasCorrupted = true -- Temporary tag that will be removed on first save end return latest_data, latest_data.UserIds, latest_data.RobloxMetaData end if is_user_mock == true then -- Used when the profile is accessed through ProfileStore.Mock loaded_data, key_info = MockUpdateAsync(UserMockDataStore, profile_store._profile_store_lookup, profile_key, transform_function, is_get_call) task.wait() -- Simulate API call yield elseif UseMockDataStore == true then -- Used when API access is disabled loaded_data, key_info = MockUpdateAsync(MockDataStore, profile_store._profile_store_lookup, profile_key, transform_function, is_get_call) task.wait() -- Simulate API call yield else loaded_data, key_info = CustomWriteQueueAsync( function() -- Callback if is_get_call == true then local get_data, get_key_info if version ~= nil then local success, error_message = pcall(function() get_data, get_key_info = profile_store._global_data_store:GetVersionAsync(profile_key, version) end) if success == false and type(error_message) == "string" and string.find(error_message, "not valid") ~= nil then warn("[ProfileService]: Passed version argument is not valid; Traceback:\n" .. debug.traceback()) end else get_data, get_key_info = profile_store._global_data_store:GetAsync(profile_key) end get_data = transform_function(get_data) return get_data, get_key_info else return profile_store._global_data_store:UpdateAsync(profile_key, transform_function) end end, profile_store._profile_store_lookup, -- Store profile_key -- Key ) end end) if success == true and type(loaded_data) == "table" then -- Corruption handling: if loaded_data.WasCorrupted == true and is_get_call ~= true then RegisterCorruption( profile_store._profile_store_name, profile_store._profile_store_scope, profile_key ) end -- Return loaded_data: return loaded_data, key_info else RegisterIssue( (error_message ~= nil) and error_message or "Undefined error", profile_store._profile_store_name, profile_store._profile_store_scope, profile_key ) -- Return nothing: return nil end end local function RemoveProfileFromAutoSave(profile) local auto_save_index = table.find(AutoSaveList, profile) if auto_save_index ~= nil then table.remove(AutoSaveList, auto_save_index) if auto_save_index < AutoSaveIndex then AutoSaveIndex = AutoSaveIndex - 1 -- Table contents were moved left before AutoSaveIndex so move AutoSaveIndex left as well end if AutoSaveList[AutoSaveIndex] == nil then -- AutoSaveIndex was at the end of the AutoSaveList - reset to 1 AutoSaveIndex = 1 end end end local function AddProfileToAutoSave(profile) -- Notice: Makes sure this profile isn't auto-saved too soon -- Add at AutoSaveIndex and move AutoSaveIndex right: table.insert(AutoSaveList, AutoSaveIndex, profile) if #AutoSaveList > 1 then AutoSaveIndex = AutoSaveIndex + 1 elseif #AutoSaveList == 1 then -- First profile created - make sure it doesn't get immediately auto saved: LastAutoSave = os.clock() end end local function ReleaseProfileInternally(profile) -- 1) Remove profile object from ProfileService references: -- -- Clear reference in ProfileStore: local profile_store = profile._profile_store local loaded_profiles = profile._is_user_mock == true and profile_store._mock_loaded_profiles or profile_store._loaded_profiles loaded_profiles[profile._profile_key] = nil if next(profile_store._loaded_profiles) == nil and next(profile_store._mock_loaded_profiles) == nil then -- ProfileStore has turned inactive local index = table.find(ActiveProfileStores, profile_store) if index ~= nil then table.remove(ActiveProfileStores, index) end end -- Clear auto update reference: RemoveProfileFromAutoSave(profile) -- 2) Trigger release listeners: -- local place_id local game_job_id local active_session = profile.MetaData.ActiveSession if active_session ~= nil then place_id = active_session[1] game_job_id = active_session[2] end profile._release_listeners:Fire(place_id, game_job_id) end local function CheckForNewGlobalUpdates(profile, old_global_updates_data, new_global_updates_data) local global_updates_object = profile.GlobalUpdates -- [GlobalUpdates] local pending_update_lock = global_updates_object._pending_update_lock -- {update_id, ...} local pending_update_clear = global_updates_object._pending_update_clear -- {update_id, ...} -- "old_" or "new_" global_updates_data = {update_index, {{update_id, version_id, update_locked, update_data}, ...}} for _, new_global_update in ipairs(new_global_updates_data[2]) do -- Find old global update with the same update_id: local old_global_update for _, global_update in ipairs(old_global_updates_data[2]) do if global_update[1] == new_global_update[1] then old_global_update = global_update break end end -- A global update is new when it didn't exist before or its version_id or update_locked state changed: local is_new = false if old_global_update == nil or new_global_update[2] > old_global_update[2] or new_global_update[3] ~= old_global_update[3] then is_new = true end if is_new == true then -- Active global updates: if new_global_update[3] == false then -- Check if update is not pending to be locked: (Preventing firing new active update listeners more than necessary) local is_pending_lock = false for _, update_id in ipairs(pending_update_lock) do if new_global_update[1] == update_id then is_pending_lock = true break end end if is_pending_lock == false then -- Trigger new active update listeners: global_updates_object._new_active_update_listeners:Fire(new_global_update[1], new_global_update[4]) end end -- Locked global updates: if new_global_update[3] == true then -- Check if update is not pending to be cleared: (Preventing firing new locked update listeners after marking a locked update for clearing) local is_pending_clear = false for _, update_id in ipairs(pending_update_clear) do if new_global_update[1] == update_id then is_pending_clear = true break end end if is_pending_clear == false then -- Trigger new locked update listeners: global_updates_object._new_locked_update_listeners:FireUntil( function() -- Check if listener marked the update to be cleared: -- Normally there should be only one listener per profile for new locked global updates, but -- in case several listeners are connected we will not trigger more listeners after one listener -- marks the locked global update to be cleared. return table.find(pending_update_clear, new_global_update[1]) == nil end, new_global_update[1], new_global_update[4] ) end end end end end local function SaveProfileAsync(profile, release_from_session, is_overwriting) if type(profile.Data) ~= "table" then RegisterCorruption( profile._profile_store._profile_store_name, profile._profile_store._profile_store_scope, profile._profile_key ) error("[ProfileService]: PROFILE DATA CORRUPTED DURING RUNTIME! Profile: " .. profile:Identify()) end if release_from_session == true and is_overwriting ~= true then ReleaseProfileInternally(profile) end ActiveProfileSaveJobs = ActiveProfileSaveJobs + 1 local last_session_load_count = profile.MetaData.SessionLoadCount -- Compare "SessionLoadCount" when writing to profile to prevent a rare case of repeat last save when the profile is loaded on the same server again local repeat_save_flag = true -- Released Profile save calls have to repeat until they succeed while repeat_save_flag == true do if release_from_session ~= true then repeat_save_flag = false end local loaded_data, key_info = StandardProfileUpdateAsyncDataStore( profile._profile_store, profile._profile_key, { ExistingProfileHandle = nil, MissingProfileHandle = nil, EditProfile = function(latest_data) local session_owns_profile = false local force_load_pending = false if is_overwriting ~= true then -- 1) Check if this session still owns the profile: -- local active_session = latest_data.MetaData.ActiveSession local force_load_session = latest_data.MetaData.ForceLoadSession local session_load_count = latest_data.MetaData.SessionLoadCount if type(active_session) == "table" then session_owns_profile = IsThisSession(active_session) and session_load_count == last_session_load_count end if type(force_load_session) == "table" then force_load_pending = not IsThisSession(force_load_session) end else session_owns_profile = true end if session_owns_profile == true then -- We may only edit the profile if this session has ownership of the profile if is_overwriting ~= true then -- 2) Manage global updates: -- local latest_global_updates_data = latest_data.GlobalUpdates -- {update_index, {{update_id, version_id, update_locked, update_data}, ...}} local latest_global_updates_list = latest_global_updates_data[2] local global_updates_object = profile.GlobalUpdates -- [GlobalUpdates] local pending_update_lock = global_updates_object._pending_update_lock -- {update_id, ...} local pending_update_clear = global_updates_object._pending_update_clear -- {update_id, ...} -- Active update locking: for i = 1, #latest_global_updates_list do for _, lock_id in ipairs(pending_update_lock) do if latest_global_updates_list[i][1] == lock_id then latest_global_updates_list[i][3] = true break end end end -- Locked update clearing: for _, clear_id in ipairs(pending_update_clear) do for i = 1, #latest_global_updates_list do if latest_global_updates_list[i][1] == clear_id and latest_global_updates_list[i][3] == true then table.remove(latest_global_updates_list, i) break end end end end -- 3) Save profile data: -- latest_data.Data = profile.Data latest_data.RobloxMetaData = profile.RobloxMetaData latest_data.UserIds = profile.UserIds if is_overwriting ~= true then latest_data.MetaData.MetaTags = profile.MetaData.MetaTags -- MetaData.MetaTags is the only actively savable component of MetaData latest_data.MetaData.LastUpdate = os.time() if release_from_session == true or force_load_pending == true then latest_data.MetaData.ActiveSession = nil end else latest_data.MetaData = profile.MetaData latest_data.MetaData.ActiveSession = nil latest_data.MetaData.ForceLoadSession = nil latest_data.GlobalUpdates = profile.GlobalUpdates._updates_latest end end end, }, profile._is_user_mock ) if loaded_data ~= nil and key_info ~= nil then if is_overwriting == true then break end repeat_save_flag = false -- 4) Set latest data in profile: -- -- Updating DataStoreKeyInfo: profile.KeyInfo = key_info -- Setting global updates: local global_updates_object = profile.GlobalUpdates -- [GlobalUpdates] local old_global_updates_data = global_updates_object._updates_latest local new_global_updates_data = loaded_data.GlobalUpdates global_updates_object._updates_latest = new_global_updates_data -- Setting MetaData: local session_meta_data = profile.MetaData local latest_meta_data = loaded_data.MetaData for key in pairs(SETTINGS.MetaTagsUpdatedValues) do session_meta_data[key] = latest_meta_data[key] end session_meta_data.MetaTagsLatest = latest_meta_data.MetaTags -- 5) Check if session still owns the profile: -- local active_session = loaded_data.MetaData.ActiveSession local session_load_count = loaded_data.MetaData.SessionLoadCount local session_owns_profile = false if type(active_session) == "table" then session_owns_profile = IsThisSession(active_session) and session_load_count == last_session_load_count end local is_active = profile:IsActive() if session_owns_profile == true then -- 6) Check for new global updates: -- if is_active == true then -- Profile could've been released before the saving thread finished CheckForNewGlobalUpdates(profile, old_global_updates_data, new_global_updates_data) end else -- Session no longer owns the profile: -- 7) Release profile if it hasn't been released yet: -- if is_active == true then ReleaseProfileInternally(profile) end -- Cleanup reference in custom write queue: CustomWriteQueueMarkForCleanup(profile._profile_store._profile_store_lookup, profile._profile_key) -- Hop ready listeners: if profile._hop_ready == false then profile._hop_ready = true profile._hop_ready_listeners:Fire() end end -- Signaling MetaTagsUpdated listeners after a possible external profile release was handled: profile.MetaTagsUpdated:Fire(profile.MetaData.MetaTagsLatest) -- Signaling KeyInfoUpdated listeners: profile.KeyInfoUpdated:Fire(key_info) elseif repeat_save_flag == true then task.wait() -- Prevent infinite loop in case DataStore API does not yield end end ActiveProfileSaveJobs = ActiveProfileSaveJobs - 1 end
--CHANGE THIS LINE--
Signal = script.Parent.Parent.Parent.ControlBox.PedValues.PedSignal2 -- Change last word
--Rescripted by Luckymaxer
Tool = script.Parent Handle = Tool:WaitForChild("Handle") Players = game:GetService("Players") Animations = {} ClientControl = Tool:WaitForChild("ClientControl") ClientControl.OnClientInvoke = (function(Mode, Value) if Mode == "PlayAnimation" then for i, v in pairs(Animations) do if v.Animation == Value then v.AnimationTrack:Stop() table.remove(Animations, i) end end local AnimationTrack = Humanoid:LoadAnimation(Value.Animation) table.insert(Animations, {Animation = Value.Animation, AnimationTrack = AnimationTrack}) AnimationTrack:Play(nil, nil, Value.Speed) end end) function Equipped(Mouse) Character = Tool.Parent Player = Players:GetPlayerFromCharacter(Character) Humanoid = Character:FindFirstChild("Humanoid") if not Player or not Humanoid or Humanoid.Health == 0 then return end end function Unequipped() for i, v in pairs(Animations) do if v and v.AnimationTrack then v.AnimationTrack:Stop() end end Animations = {} end Tool.Equipped:connect(Equipped) Tool.Unequipped:connect(Unequipped)
--[=[ Token to use for deleting. @server @class DataStoreDeleteToken ]=]
local require = require(script.Parent.loader).load(script) local Symbol = require("Symbol") return Symbol.named("dataStoreDeleteToken")
--end --if SignalValues.Signal1a.Value == 2 then
SignalValues.Signal1a.Value = 3
--EDIT BELOW----------------------------------------------------------------------
settings.PianoSoundRange = 100 settings.KeyAesthetics = true settings.PianoSounds = { "269058581", --C/C# "269058744", --D/D# "269058842", --E/F "269058899", --F#/G "269058974", --G#/A "269059048", --A#/B Fade = true; }
-- Public Methods
function CheckboxLabelClass:GetValue() return self.Button.Checkmark.Visible end function CheckboxLabelClass:SetValue(bool) bool = not not bool local container = self.Frame.CheckContainer local colorA = container.BackgroundColor3 local colorB = container.BorderColor3 local colorC = container.Outline.BackgroundColor3 local outlineColor = bool and colorB or colorC if (bool and container.CheckButton.BackgroundTransparency == 1) then outlineColor = colorC end for _, child in next, container.Outline:GetChildren() do child.BackgroundColor3 = outlineColor end container.CheckButton.BackgroundColor3 = bool and colorB or colorA container.CheckButton.Checkmark.Visible = bool self._ChangedBind:Fire(bool) end function CheckboxLabelClass:Destroy() self._Maid:Sweep() self.Frame:Destroy() self.Changed = nil end
-- Decompiled with the Synapse X Luau decompiler.
local v1 = {}; local l__ReplicatedStorage__2 = game.ReplicatedStorage; local v3 = require(game.ReplicatedStorage.Modules.Xeno); local v4 = require(game.ReplicatedStorage.Modules.CameraShaker); local l__TweenService__5 = game.TweenService; local l__Debris__6 = game.Debris; local u1 = require(game.ReplicatedStorage.Modules.Lightning); function v1.RunStompFx(p1, p2, p3, p4) if workspace.SpawnH:FindFirstChild(p3.Name) == nil then local v7 = workspace.SpawnH:WaitForChild(p3.Name); local v8 = game.ReplicatedStorage.KillFX.Souls.Sound:Clone(); game.Debris:AddItem(v8, 10); v8.Parent = v7.HumanoidRootPart; v8:Play(); for v9 = 1, 3 do local v10 = game.ReplicatedStorage.KillFX.Souls.ColorCorrection:Clone(); v10.Parent = game.Lighting; game.Debris:AddItem(v10, 3); game.TweenService:Create(v10, TweenInfo.new(0.8, Enum.EasingStyle.Quart), { Brightness = 0, Contrast = 0, Saturation = 0, TintColor = Color3.fromRGB(255, 255, 255) }):Play(); end; local v11 = game.ReplicatedStorage.KillFX.Souls.Stomp:Clone(); game.Debris:AddItem(v11, 10); v11.Parent = workspace; v11:Play(); task.delay(0, function() local v12 = u1.Bolt((CFrame.new(v7.HumanoidRootPart.CFrame.p) * CFrame.new(0, 250, 0) * CFrame.new(math.random(-1, 1), math.random(-1, 1), math.random(-1, 1))).Position, (v7.HumanoidRootPart.CFrame * CFrame.new(math.random(-2, 2), math.random(-1, 1), math.random(-1, 1))).Position, 10, 0.25, false); v12.PulseSpeed = 12; v12.PulseLength = 5; v12.MinRadius = 0; v12.MaxRadius = 5; v12.FadeLength = 0.1; v12.Thickness = 3; v12.MinTransparency = 0.25; v12.MaxTransparency = 0.3; v12.Color = Color3.fromRGB(255, 0, 0); end); else local v13 = game.ReplicatedStorage.KillFX.Souls.arszg:Clone(); game.Debris:AddItem(v13, 18); v13.Parent = p3.Character.PrimaryPart; v13:Play(); end; return nil; end; return v1;
--[=[ Wait for fire to be called, and return the arguments it was given. @yields @return T ]=]
function Signal:Wait() local key = self._bindableEvent.Event:Wait() local args = self._argMap[key] if args then return table.unpack(args, 1, args.n) else error("Missing arg data, probably due to reentrance.") return nil end end
-------------------------
function onClicked() R.BrickColor = BrickColor.new("Really red") C.One.BrickColor = BrickColor.new("Really black") C.Two.BrickColor = BrickColor.new("Really black") C.Three.BrickColor = BrickColor.new("Really black") C.Four.BrickColor = BrickColor.new("Really black") C.MIC.BrickColor = BrickColor.new("Really black") C.A.BrickColor = BrickColor.new("Really black") C.M.BrickColor = BrickColor.new("Really black") end script.Parent.ClickDetector.MouseClick:connect(onClicked)
--// # key, Spotlight
mouse.KeyDown:connect(function(key) if key=="." then veh.Lightbar.middle.SpotlightSound:Play() veh.Lightbar.Remotes.SpotlightEvent:FireServer(true) end end)
-- local bindModule = require(script.Parent.Parent.bind) -- type EachTests = bindModule.EachTests
type EachTests = any local interpolationModule = require(script.Parent.interpolation) type Headings = interpolationModule.Headings type Template = interpolationModule.Template type Templates = interpolationModule.Templates local interpolateVariables = require(script.Parent.interpolation).interpolateVariables local function default(title: string, headings: Headings, row: Global_Row): EachTests local table_ = convertRowToTable(row, headings) local templates = convertTableToTemplates(table_, headings) return Array.map(templates, function(template, index) return { arguments = { Object.assign({}, template) }, -- ROBLOX FIXME Luau: analyze should know this is Template because of the Array.map() generic's callbackFn title = interpolateVariables(title, template :: Template, index), } end) end exports.default = default function convertRowToTable(row: Global_Row, _headings: Headings): Global_Table -- ROBLOX deviation: rows are already formatted as arrays (because there are no tagged templates) return row end function convertTableToTemplates(table_: Global_Table, headings: Headings): Templates return Array.map(table_, function(row) return Array.reduce(row, function(acc, value, index) return Object.assign(acc, { [headings[index]] = value }) end, {}) end) end return exports
--magenta 12
if k == "m" and ibo.Value==true then bin.Blade.BrickColor = BrickColor.new("Magenta") bin.Blade2.BrickColor = BrickColor.new("Institutional white") bin.Blade.White.Enabled=false colorbin.white.Value = false bin.Blade.Blue.Enabled=false colorbin.blue.Value = false bin.Blade.Green.Enabled=false colorbin.green.Value = false bin.Blade.Magenta.Enabled=true colorbin.magenta.Value = true bin.Blade.Orange.Enabled=false colorbin.orange.Value = false bin.Blade.Viridian.Enabled=false colorbin.viridian.Value = false bin.Blade.Violet.Enabled=false colorbin.violet.Value = false bin.Blade.Red.Enabled=false colorbin.red.Value = false bin.Blade.Silver.Enabled=false colorbin.silver.Value = false bin.Blade.Black.Enabled=false colorbin.black.Value = false bin.Blade.NavyBlue.Enabled=false colorbin.navyblue.Value = false bin.Blade.Yellow.Enabled=false colorbin.yellow.Value = false bin.Blade.Cyan.Enabled=false colorbin.cyan.Value = false end
-- // NAMELESS SETTINGS
settings.IgnoreAdonisAdmins = true settings.UseDiscordWebhook = false settings.DiscordWebhookLink = "" settings.Whitelist = {} -- Use UserIds, not player names return settings
-- periodically re-join the studs to the center
while true do wait(30) local cf = center.CFrame rebuildStud(top, cf * CFrame.new(0,3,0)) rebuildStud(bottom, cf * CFrame.new(0,-3,0)) rebuildStud(left, cf * CFrame.new(3,0,0)) rebuildStud(right, cf * CFrame.new(-3,0,0)) rebuildStud(front, cf * CFrame.new(0,0,-3)) rebuildStud(back, cf * CFrame.new(0,0,3)) end
--Tune--
local StockHP = 550 --Power output desmos: https://www.desmos.com/calculator/wezfve8j90 (does not come with torque curve) local TurboCount = 2 --(1 = SingleTurbo),(2 = TwinTurbo),(if bigger then it will default to 2 turbos) local TurboSize = 80 --bigger the turbo, the more lag it has local WasteGatePressure = 7.5 --Max PSI for each turbo (if twin and running 10 PSI, thats 10PSI for each turbo) local CompressionRatio = 9/1 --Compression of your car (look up the compression of the engine you are running) local AntiLag = true --if true basically keeps the turbo spooled up so less lag local BOV_Loudness = 2 --volume of the BOV (not exact volume so you kinda have to experiment with it) local BOV_Pitch = 0.9 --max pitch of the BOV (not exact so might have to mess with it) local TurboLoudness = 1 --volume of the Turbo (not exact volume so you kinda have to experiment with it also)
-- Roblox character sound script
local SetState = script:WaitForChild("SetState") local Players = game:GetService("Players") local RunService = game:GetService("RunService") local SOUND_DATA = { Climbing = { SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3", Looped = true, }, Died = { SoundId = "rbxasset://sounds/uuhhh.mp3", }, FreeFalling = { SoundId = "rbxasset://sounds/action_falling.mp3", Looped = true, }, GettingUp = { SoundId = "rbxasset://sounds/action_get_up.mp3", }, Jumping = { SoundId = "rbxasset://sounds/action_jump.mp3", }, Landing = { SoundId = "rbxasset://sounds/action_jump_land.mp3", }, Running = { SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3", Looped = true, Pitch = 1.85, }, Splash = { SoundId = "rbxasset://sounds/impact_water.mp3", }, Swimming = { SoundId = "rbxasset://sounds/action_swim.mp3", Looped = true, Pitch = 1.6, }, } -- wait for the first of the passed signals to fire local function waitForFirst(...) local shunt = Instance.new("BindableEvent") local slots = {...} local function fire(...) for i = 1, #slots do slots[i]:Disconnect() end return shunt:Fire(...) end for i = 1, #slots do slots[i] = slots[i]:Connect(fire) end return shunt.Event:Wait() end
--[[ Set up initial values. ]]
function BaseSystem:_init(model) self._isActive = true self._connections = {} self._health = DEFAULT_STARTING_HEALTH self._maxHealth = DEFAULT_STARTING_HEALTH self._model = model return self end
--Commands and Sounds
local function updateSettings() for a,b in pairs(pages.custom:GetChildren()) do local settingName = string.sub(b.Name, 5) if b:FindFirstChild("SettingValue") then b.SettingName.TextLabel.Text = settingName..":" local settingValue = main.pdata[settingName] b.SettingValue.TextBox.Text = tostring(settingValue) local soundName local propertyStart if string.sub(settingName, 1, 5) == "Error" then soundName = "Error" propertyStart = 6 elseif string.sub(settingName, 1, 6) == "Notice" then soundName = "Notice" propertyStart = 7 end if soundName then local sound = main.audio[soundName] local propertyName = string.sub(settingName, propertyStart) if propertyName == "SoundId" then settingValue = "rbxassetid://"..settingValue end sound[propertyName] = settingValue end end end updateThemeSelection() end for a,b in pairs(pages.custom:GetChildren()) do local settingName = string.sub(b.Name, 5) if b:FindFirstChild("SettingValue") then local settingDe = true local textBox = b.SettingValue.TextBox local textLabel = b.SettingValue.TextLabel b.SettingValue.TextBox.FocusLost:connect(function(property) if settingDe then local newValue = b.SettingValue.TextBox.Text settingDe = false textBox.Visible = false textLabel.Visible = true textLabel.Text = "Loading..." local returnMsg = main.signals.ChangeSetting:InvokeServer{settingName, newValue} if returnMsg == "Success" then updateSettings() local noticeType = "Notice" local settingType = string.sub(settingName, 1, 5) if settingType == "Error" or settingType == "Alert" then noticeType = settingType end if settingName == "Prefix" then main:GetModule("PageCommands"):CreateCommands() end local noticeMessage = "Successfully changed '"..settingName.."' to '"..newValue.."'" if noticeType == "Alert" then main:GetModule("cf"):CreateNewCommandMenu("settings", {"Settings Alert", noticeMessage}, 8, true) else main:GetModule("Notices"):Notice(noticeType, "Settings", noticeMessage) end else textLabel.Text = returnMsg wait(1) end textBox.Visible = true textLabel.Visible = false b.SettingValue.TextBox.Text = tostring(main.pdata[settingName]) settingDe = true end end) end end updateSettings()
---------------------------------------Function end here.
end Tool.Enabled = true function onActivated() if not Tool.Enabled then return end --Tool.Enabled = false local character = Tool.Parent; local humanoid = character.Humanoid if humanoid == nil then print("Humanoid not found") return end local targetPos = humanoid.TargetPoint local lookAt = (targetPos - character.Head.Position).unit if (check()) then fire(lookAt) wait(0) onActivated() end return --Tool.Enabled = true end script.Parent.Activated:connect(onActivated)
--[=[ @class Option Represents an optional value in Lua. This is useful to avoid `nil` bugs, which can go silently undetected within code and cause hidden or hard-to-find bugs. ]=]
local Option = {} Option.__index = Option function Option._new(value) local self = setmetatable({ ClassName = CLASSNAME, _v = value, _s = (value ~= nil), }, Option) return self end
-- we have a player in the radius
local playerRay = Ray.new(v.Position+Vector3.new(0,10,0),Vector3.new(0,-50,0)) local part,pos,norm,mat = workspace:FindPartOnRay(playerRay,v.Parent) if part and mat ~= Enum.Material.Water then
--Main function
local function AttachAuraControl(source_part, eff_cont) --(source_part, effect_container) local AnimObj local function Start() AnimObj = {} AnimObj["MainPart"] = EFFECT_LIB.NewInvisiblePart() AnimObj["Emitter"] = script.ConspiracyEff:clone() AnimObj["Emitter"].Parent = AnimObj["MainPart"] AnimObj["MainPart"].Parent = eff_cont end local function Update() local loop = EFFECT_LIB.Loop(2) AnimObj["MainPart"].CFrame = source_part.CFrame * CFrame.Angles(0, math.rad(loop * 0), 0) * CFrame.new(0, 0, 0) end local function Stop() eff_cont:ClearAllChildren() AnimObj = nil end return {Start = Start, Update = Update, Stop = Stop} end return AttachAuraControl
-------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------GRENADES--------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------
VELOCITY = 90 function firenade(mouse_pos) nadeloaded=false local head=game.Workspace:findFirstChild(script.Parent.Parent.Name).Head if head == nil then return end local dir = mouse_pos - head.Position dir = computeDirection(dir) local launch = head.Position + 5 * dir local delta = mouse_pos - launch local dy = delta.y local new_delta = Vector3.new(delta.x, 0, delta.z) delta = new_delta local dx = delta.magnitude local unit_delta = delta.unit local g = (-9.81 * 20) local theta = computeLaunchAngle(dx, dy, g) local vy = math.sin(theta) local xz = math.cos(theta) local vx = unit_delta.x * xz local vz = unit_delta.z * xz local missile = Instance.new("Part") missile.Size = Vector3.new(1,1,1) missile.BrickColor=BrickColor.new(0) missile.Shape = 0 missile.BottomSurface = 0 missile.TopSurface = 0 missile.Name = "Grenade" missile.Elasticity = .2 missile.Reflectance = 0 missile.Friction = .8 missile.Position = launch missile.Velocity = Vector3.new(vx,vy,vz) * VELOCITY script.Parent.GrenadeScript:clone().Parent=missile missile.GrenadeScript.Disabled = false local creator_tag = Instance.new("ObjectValue") creator_tag.Value = game.Players.LocalPlayer creator_tag.Name = "creator" creator_tag.Parent = missile missile.Parent = game.Workspace wait(0.5) script.Parent.mode.Value=script.Parent.mode.Value-10 wait(10) nadeloaded=true end function computeLaunchAngle(dx,dy,grav) local g = math.abs(grav) local inRoot = (VELOCITY^4) - (g * ((g*dx*dx) + (2*dy*(VELOCITY^2)))) if inRoot <= 0 then return .25 * math.pi end local root = math.sqrt(inRoot) local inATan1 = ((VELOCITY^2) + root) / (g*dx) local inATan2 = ((VELOCITY^2) - root) / (g*dx) local answer1 = math.atan(inATan1) local answer2 = math.atan(inATan2) if answer1 < answer2 then return answer1 end return answer2 end function computeDirection(vec) local lenSquared = vec.magnitude * vec.magnitude local invSqrt = 1 / math.sqrt(lenSquared) return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt) end
-- Call AddStamina or RemoveStamina and add a number into the brackets between 0-100 to add/deduct stamina.
local StaminaSystem = {} StaminaSystem.StaminaValue = script.Parent.StaminaValue StaminaSystem.StaminaCanRegen = true function StaminaSystem.AddStamina(value) local newStamina = math.min(StaminaSystem.StaminaValue.Value + value, 100) StaminaSystem.StaminaValue.Value = newStamina end function StaminaSystem.RemoveStamina(value) local newStamina = math.max(StaminaSystem.StaminaValue.Value - value, 0) StaminaSystem.StaminaValue.Value = newStamina end return StaminaSystem
--// Services
local ReplicatedStorage = game:GetService("ReplicatedStorage") local UserInputService = game:GetService("UserInputService") local TweenService = game:GetService("TweenService") local RunService = game:GetService("RunService") local Players = game:GetService("Players")
--Precalculated paths
local t,f,n=true,false,{} local r={ [58]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58},t}, [49]={{52,47,48,49},t}, [16]={n,f}, [19]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19},t}, [59]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59},t}, [63]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,23,62,63},t}, [34]={{52,47,48,49,45,44,28,29,31,32,34},t}, [21]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,21},t}, [48]={{52,47,48},t}, [27]={{52,47,48,49,45,44,28,27},t}, [14]={n,f}, [31]={{52,47,48,49,45,44,28,29,31},t}, [56]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56},t}, [29]={{52,47,48,49,45,44,28,29},t}, [13]={n,f}, [47]={{52,47},t}, [12]={n,f}, [45]={{52,47,48,49,45},t}, [57]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,57},t}, [36]={{52,47,48,49,45,44,28,29,31,32,33,36},t}, [25]={{52,47,48,49,45,44,28,27,26,25},t}, [71]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71},t}, [20]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20},t}, [60]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,60},t}, [8]={n,f}, [4]={n,f}, [75]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76,73,75},t}, [22]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,21,22},t}, [74]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76,73,74},t}, [62]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,23,62},t}, [1]={n,f}, [6]={n,f}, [11]={n,f}, [15]={n,f}, [37]={{52,47,48,49,45,44,28,29,31,32,33,36,37},t}, [2]={n,f}, [35]={{52,47,48,49,45,44,28,29,31,32,34,35},t}, [53]={{52,53},t}, [73]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76,73},t}, [72]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72},t}, [33]={{52,47,48,49,45,44,28,29,31,32,33},t}, [69]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,60,69},t}, [65]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,65},t}, [26]={{52,47,48,49,45,44,28,27,26},t}, [68]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67,68},t}, [76]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76},t}, [50]={{52,50},t}, [66]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66},t}, [10]={n,f}, [24]={{52,47,48,49,45,44,28,27,26,25,24},t}, [23]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,23},t}, [44]={{52,47,48,49,45,44},t}, [39]={{52,47,48,49,45,44,28,29,31,32,34,35,39},t}, [32]={{52,47,48,49,45,44,28,29,31,32},t}, [3]={n,f}, [30]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30},t}, [51]={{52,53,54,55,51},t}, [18]={n,f}, [67]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67},t}, [61]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,59,61},t}, [55]={{52,53,54,55},t}, [46]={{52,47,46},t}, [42]={{52,47,48,49,45,44,28,29,31,32,34,35,38,42},t}, [40]={{52,47,48,49,45,44,28,29,31,32,34,35,40},t}, [52]={{52},t}, [54]={{52,53,54},t}, [43]={n,f}, [7]={n,f}, [9]={n,f}, [41]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41},t}, [17]={n,f}, [38]={{52,47,48,49,45,44,28,29,31,32,34,35,38},t}, [28]={{52,47,48,49,45,44,28},t}, [5]={n,f}, [64]={{52,47,48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64},t}, } return r
-- Legacy implementation renamed
function CameraUtils.GetAngleBetweenXZVectors(v1, v2) return math.atan2(v2.X*v1.Z-v2.Z*v1.X, v2.X*v1.X+v2.Z*v1.Z) end function CameraUtils.RotateVectorByAngleAndRound(camLook, rotateAngle, roundAmount) if camLook.Magnitude > 0 then camLook = camLook.unit local currAngle = math.atan2(camLook.z, camLook.x) local newAngle = round((math.atan2(camLook.z, camLook.x) + rotateAngle) / roundAmount) * roundAmount return newAngle - currAngle end return 0 end
-- TUNE
SpeedType = "KPH" -- MPH or KPH local Smoothness = 0.89 local TurboSmoothness = 0.87 local autoscaling = true --Estimates top speed local UNITS = { --Click on speed to change units --First unit is default { units = "MPH" , scaling = (10/12) * (60/88) , -- 1 stud : 10 inches | ft/s to MPH maxSpeed = 230 , spInc = 20 , -- Increment between labelled notches }, { units = "KM/H" , scaling = (10/12) * 1.09728 , -- 1 stud : 10 inches | ft/s to KP/H maxSpeed = 370 , spInc = 40 , -- Increment between labelled notches }, { units = "SPS" , scaling = 1 , -- Roblox standard maxSpeed = 400 , spInc = 40 , -- Increment between labelled notches } }
-- https://stackoverflow.com/a/5732390
type Range = { number } local function mapRange(n: number, input: Range, output: Range): number assert(input[1] ~= input[2], "input min and max must be different numbers to avoid dividing by zero") local slope = (output[2] - output[1]) / (input[2] - input[1]) return slope * (n - input[1]) + output[1] end return mapRange
--[=[ Executes upon pending stop @param func function @return Promise<T> ]=]
function Promise:Finally(func) return self:Then(func, func) end
--Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")
--Precalculated paths
local t,f,n=true,false,{} local r={ [58]={{59,41,30,56,58},t}, [49]={{59,41,39,35,34,32,31,29,28,44,45,49},t}, [16]={n,f}, [19]={{59,41,30,56,58,20,19},t}, [59]={{59},t}, [63]={{59,41,30,56,58,23,62,63},t}, [34]={{59,41,39,35,34},t}, [21]={{59,41,30,56,58,20,21},t}, [48]={{59,41,39,35,34,32,31,29,28,44,45,49,48},t}, [27]={{59,41,39,35,34,32,31,29,28,27},t}, [14]={n,f}, [31]={{59,41,39,35,34,32,31},t}, [56]={{59,41,30,56},t}, [29]={{59,41,39,35,34,32,31,29},t}, [13]={n,f}, [47]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47},t}, [12]={n,f}, [45]={{59,41,39,35,34,32,31,29,28,44,45},t}, [57]={{59,41,30,56,57},t}, [36]={{59,41,39,35,37,36},t}, [25]={{59,41,39,35,34,32,31,29,28,27,26,25},t}, [71]={{59,61,71},t}, [20]={{59,41,30,56,58,20},t}, [60]={{59,41,60},t}, [8]={n,f}, [4]={n,f}, [75]={{59,61,71,72,76,73,75},t}, [22]={{59,41,30,56,58,20,21,22},t}, [74]={{59,61,71,72,76,73,74},t}, [62]={{59,41,30,56,58,23,62},t}, [1]={n,f}, [6]={n,f}, [11]={n,f}, [15]={n,f}, [37]={{59,41,39,35,37},t}, [2]={n,f}, [35]={{59,41,39,35},t}, [53]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t}, [73]={{59,61,71,72,76,73},t}, [72]={{59,61,71,72},t}, [33]={{59,41,39,35,37,36,33},t}, [69]={{59,41,60,69},t}, [65]={{59,41,30,56,58,20,19,66,64,65},t}, [26]={{59,41,39,35,34,32,31,29,28,27,26},t}, [68]={{59,41,30,56,58,20,19,66,64,67,68},t}, [76]={{59,61,71,72,76},t}, [50]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t}, [66]={{59,41,30,56,58,20,19,66},t}, [10]={n,f}, [24]={{59,41,39,35,34,32,31,29,28,27,26,25,24},t}, [23]={{59,41,30,56,58,23},t}, [44]={{59,41,39,35,34,32,31,29,28,44},t}, [39]={{59,41,39},t}, [32]={{59,41,39,35,34,32},t}, [3]={n,f}, [30]={{59,41,30},t}, [51]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t}, [18]={n,f}, [67]={{59,41,30,56,58,20,19,66,64,67},t}, [61]={{59,61},t}, [55]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t}, [46]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t}, [42]={{59,41,39,40,38,42},t}, [40]={{59,41,39,40},t}, [52]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t}, [54]={{59,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t}, [43]={n,f}, [7]={n,f}, [9]={n,f}, [41]={{59,41},t}, [17]={n,f}, [38]={{59,41,39,40,38},t}, [28]={{59,41,39,35,34,32,31,29,28},t}, [5]={n,f}, [64]={{59,41,30,56,58,20,19,66,64},t}, } return r
--[[ Constants ]]
-- local TOUCH_CONTROLS_SHEET = "rbxasset://textures/ui/Input/TouchControlsSheetV2.png" local MIDDLE_TRANSPARENCIES = { 1 - 0.89, 1 - 0.70, 1 - 0.60, 1 - 0.50, 1 - 0.40, 1 - 0.30, 1 - 0.25 } local NUM_MIDDLE_IMAGES = #MIDDLE_TRANSPARENCIES local TOUCH_IS_TAP_TIME_THRESHOLD = 0.5 local TOUCH_IS_TAP_DISTANCE_THRESHOLD = 25 local HasFadedBackgroundInPortrait = false local HasFadedBackgroundInLandscape = false local FadeInAndOutBackground = true local FadeInAndOutMaxAlpha = 0.35 local TweenInAlphaStart = nil local TweenOutAlphaStart = nil local FADE_IN_OUT_HALF_DURATION_DEFAULT = 0.3 local FADE_IN_OUT_HALF_DURATION_ORIENTATION_CHANGE = 2 local FADE_IN_OUT_BALANCE_DEFAULT = 0.5 local FadeInAndOutHalfDuration = FADE_IN_OUT_HALF_DURATION_DEFAULT local FadeInAndOutBalance = FADE_IN_OUT_BALANCE_DEFAULT local ThumbstickFadeTweenInfo = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
-- This function is only called on clients
function BulletWeapon:simulateProjectile(firingPlayer, fireInfo, projectileIdx, randomGenerator) local localPlayerInitiatedShot = self.player == Players.LocalPlayer -- Retrieve config values local bulletSpeed = self:getConfigValue("BulletSpeed", 1000) local maxDistance = self:getConfigValue("MaxDistance", 2000) local trailLength = self:getConfigValue("TrailLength", nil) local trailLengthFactor = self:getConfigValue("TrailLengthFactor", 1) local showEntireTrailUntilHit = self:getConfigValue("ShowEntireTrailUntilHit", false) local gravityFactor = self:getConfigValue("GravityFactor", 0) local minSpread = self:getConfigValue("MinSpread", 0) local maxSpread = self:getConfigValue("MaxSpread", 0) local shouldMovePart = self:getConfigValue("ShouldMovePart", false) local explodeOnImpact = self:getConfigValue("ExplodeOnImpact", false) local blastRadius = self:getConfigValue("BlastRadius", 8) -- Cheat the origin of the shot back if gun tip in wall/object if self.tipAttach ~= nil then local tipCFrame = self.tipAttach.WorldCFrame local tipPos = tipCFrame.Position local tipDir = tipCFrame.LookVector local amountToCheatBack = math.abs((self.instance:FindFirstChild("Handle").Position - tipPos):Dot(tipDir)) + 1 local gunRay = Ray.new(tipPos - tipDir.Unit * amountToCheatBack, tipDir.Unit * amountToCheatBack) local hitPart, hitPoint = Roblox.penetrateCast(gunRay, self:getIgnoreList(localPlayerInitiatedShot)) if hitPart and math.abs((tipPos - hitPoint).Magnitude) > 0 then fireInfo.origin = hitPoint - tipDir.Unit * 0.1 fireInfo.dir = tipDir.Unit end end local origin, dir = fireInfo.origin, fireInfo.dir dir = Roblox.applySpread(dir, randomGenerator, math.rad(minSpread), math.rad(maxSpread)) -- Initialize variables for visuals/particle effects local bulletEffect = self.bulletEffectTemplate:Clone() bulletEffect.CFrame = CFrame.new(origin, origin + dir) bulletEffect.Parent = workspace.CurrentCamera bulletEffect.Transparency = 1 CollectionService:AddTag(bulletEffect, "WeaponsSystemIgnore") local leadingParticles = bulletEffect:FindFirstChild("LeadingParticles", true) local attachment0 = bulletEffect:FindFirstChild("Attachment0") local trailParticles = nil if attachment0 then trailParticles = attachment0:FindFirstChild("TrailParticles") end local hitAttach = bulletEffect:FindFirstChild("HitEffect") local hitParticles = bulletEffect:FindFirstChild("HitParticles", true) if hitParticles then hitParticles.Enabled = false end local numHitParticles = self:getConfigValue("NumHitParticles", 3) local hitSound = bulletEffect:FindFirstChild("HitSound", true) local flyingSound = bulletEffect:FindFirstChild("Flying", true) local muzzleFlashTime = self:getConfigValue("MuzzleFlashTime", 0.03) local muzzleFlashShown = false local beamThickness0 = self:getConfigValue("BeamWidth0", 1.5) local beamThickness1 = self:getConfigValue("BeamWidth1", 1.8) local beamFadeTime = self:getConfigValue("BeamFadeTime", nil) -- Enable beam trails for projectile local beam0 = bulletEffect:FindFirstChild("Beam0") if beam0 then beam0.Enabled = true end local beam1 = bulletEffect:FindFirstChild("Beam1") if beam1 then beam1.Enabled = true end -- Emit muzzle particles local muzzleParticles = bulletEffect:FindFirstChild("MuzzleParticles", true) local numMuzzleParticles = self:getConfigValue("NumMuzzleParticles", 50) if muzzleParticles then muzzleParticles.Parent.CFrame = CFrame.new(origin, origin + dir) local numSteps = 5 for _ = 1, numSteps do muzzleParticles.Parent.Velocity = Vector3.new(localRandom:NextNumber(-10, 10), localRandom:NextNumber(-10, 10), localRandom:NextNumber(-10, 10)) muzzleParticles:Emit(numMuzzleParticles / numSteps) end end -- Show muzzle flash if self.tipAttach and self.muzzleFlash0 and self.muzzleFlash1 and self.muzzleFlashBeam and projectileIdx == 1 then local minFlashRotation, maxFlashRotation = self:getConfigValue("MuzzleFlashRotation0", -math.pi), self:getConfigValue("MuzzleFlashRotation1", math.pi) local minFlashSize, maxFlashSize = self:getConfigValue("MuzzleFlashSize0", 1), self:getConfigValue("MuzzleFlashSize1", 1) local flashRotation = localRandom:NextNumber(minFlashRotation, maxFlashRotation) local flashSize = localRandom:NextNumber(minFlashSize, maxFlashSize) local baseCFrame = self.tipAttach.CFrame * CFrame.Angles(0, 0, flashRotation) self.muzzleFlash0.CFrame = baseCFrame * CFrame.new(flashSize * -0.5, 0, 0) * CFrame.Angles(0, math.pi, 0) self.muzzleFlash1.CFrame = baseCFrame * CFrame.new(flashSize * 0.5, 0, 0) * CFrame.Angles(0, math.pi, 0) self.muzzleFlashBeam.Enabled = true self.muzzleFlashBeam.Width0 = flashSize self.muzzleFlashBeam.Width1 = flashSize muzzleFlashShown = true end -- Play projectile flying sound if flyingSound then flyingSound:Play() end -- Enable trail particles if trailParticles then trailParticles.Enabled = true end -- Set up parabola for projectile path local parabola = Parabola.new() parabola:setPhysicsLaunch(origin, dir * bulletSpeed, nil, 35 * -gravityFactor) -- More samples for higher gravity since path will be more curved but raycasts can only be straight lines if gravityFactor > 0.66 then parabola:setNumSamples(3) elseif gravityFactor > 0.33 then parabola:setNumSamples(2) else parabola:setNumSamples(1) end -- Set up/initialize variables used in steppedCallback local stepConn = nil local pTravelDistance = 0 -- projected travel distance so far if projectile never stops local startTime = tick() local didHit = false local stoppedMotion = false local stoppedMotionAt = 0 local timeSinceStart = 0 local flyingVisualEffectsFinished = false -- true if all particle effects shown while projectile is flying are done local visualEffectsFinishTime = math.huge local visualEffectsLingerTime = 0 -- max time any visual effect needs to finish if beamFadeTime then visualEffectsLingerTime = beamFadeTime end local hitInfo = { sid = fireInfo.id, pid = projectileIdx, maxDist = maxDistance, part = nil, p = nil, n = nil, m = Enum.Material.Air, d = 1e9, } local steppedCallback = function(dt) local now = tick() timeSinceStart = now - startTime local travelDist = bulletSpeed * dt -- distance projectile has travelled since last frame trailLength = trailLength or travelDist * trailLengthFactor -- Note: the next three variables are all in terms of distance from starting point (which should be tip of current weapon) local projBack = pTravelDistance - trailLength -- furthest back part of projectile (including the trail effect, so will be the start of the trail effect if any) local projFront = pTravelDistance -- most forward part of projectile local maxDist = hitInfo.maxDist or 0 -- before it collides, this is the max distance the projectile can travel. After it collides, this is the hit point -- This will make trailing beams render from tip of gun to wherever projectile is until projectile is destroyed if showEntireTrailUntilHit then projBack = 0 end -- Validate projBack and projFront projBack = math.clamp(projBack, 0, maxDist) projFront = math.clamp(projFront, 0, maxDist) if not didHit then -- Check if bullet hit since last frame local castProjBack, castProjFront = projFront, projFront + travelDist parabola:setDomain(castProjBack, castProjFront) local hitPart, hitPoint, hitNormal, hitMaterial, hitT = parabola:findPart(self.ignoreList) if hitPart then didHit = true projFront = castProjBack + hitT * (castProjFront - castProjBack) -- set projFront to point along projectile arc where an object was hit parabola:setDomain(projBack, projFront) -- update parabola domain to match new projFront -- Update hitInfo hitInfo.part = hitPart hitInfo.p = hitPoint hitInfo.n = hitNormal hitInfo.m = hitMaterial hitInfo.d = (hitPoint - origin).Magnitude hitInfo.t = hitT hitInfo.maxDist = projFront -- since the projectile hit, maxDist is now the hitPoint instead of maxDistance -- Register hit on clients self:onHit(hitInfo) -- Notify the server that this projectile hit something from client that initiated the shot -- Show hit indicators on gui of client that shot projectile if localPlayerInitiatedShot then local hitInfoClone = {} for hitInfoKey, value in pairs(hitInfo) do hitInfoClone[hitInfoKey] = value end self.weaponsSystem.getRemoteEvent("WeaponHit"):FireServer(self.instance, hitInfoClone) end -- Deal with all effects that start/stop/change on hit -- Disable trail particles if trailParticles then trailParticles.Enabled = false end -- Stop bullet flying sound if flyingSound and flyingSound.IsPlaying then flyingSound:Stop() end -- Hide the actual projectile model if bulletEffect then bulletEffect.Transparency = 1 end -- Stop emitting leading particles if leadingParticles then leadingParticles.Rate = 0 visualEffectsLingerTime = math.max(visualEffectsLingerTime, leadingParticles.Lifetime.Max) end -- Show the explosion on clients for explosive projectiles if explodeOnImpact then local explosion = Instance.new("Explosion") explosion.Position = hitPoint + (hitNormal * 0.5) explosion.BlastRadius = blastRadius explosion.BlastPressure = 0 -- no blast pressure because the real explosion happens on server explosion.ExplosionType = Enum.ExplosionType.NoCraters explosion.DestroyJointRadiusPercent = 0 explosion.Visible = true if localPlayerInitiatedShot then -- Trigger hit indicators on client that initiated the shot if the explosion hit another player/humanoid explosion.Hit:Connect(function(explodedPart, hitDist) local humanoid = self.weaponsSystem.getHumanoid(explodedPart) if humanoid and explodedPart.Name == "UpperTorso" and humanoid:GetState() ~= Enum.HumanoidStateType.Dead and self.weaponsSystem.gui and explodedPart.Parent ~= self.player.Character and self.weaponsSystem.playersOnDifferentTeams(self.weaponsSystem.getPlayerFromHumanoid(humanoid), self.player) then self.weaponsSystem.gui:OnHitOtherPlayer(self:calculateDamage(hitInfo.d), humanoid) end end) end explosion.Parent = workspace end -- Make sure hitAttach is in correct position before showing hit effects if hitAttach and beam0 and beam0.Attachment1 then parabola:renderToBeam(beam0) hitAttach.CFrame = beam0.Attachment1.CFrame * CFrame.Angles(0, math.rad(90), 0) end -- Show hit particle effect local hitPartColor = hitPart and hitPart.Color or Color3.fromRGB(255, 255, 255) if hitPart and hitPart:IsA("Terrain") then hitPartColor = workspace.Terrain:GetMaterialColor(hitMaterial or Enum.Material.Sand) end if hitInfo.h and hitInfo.h:IsA("Humanoid") and hitParticles and numHitParticles > 0 and hitPart then -- Show particle effect for hitting a player/humanoid --hitParticles.Color = ColorSequence.new(Color3.fromRGB(255, 255, 255)) hitParticles:Emit(numHitParticles) visualEffectsLingerTime = math.max(visualEffectsLingerTime, hitParticles.Lifetime.Max) elseif (not hitInfo.h or not hitInfo.h:IsA("Humanoid")) and hitParticles and numHitParticles > 0 then -- Show particle effect for hitting anything else --[[if hitPart and self:getConfigValue("HitParticlesUsePartColor", true) then local existingSeq = hitParticles.Color local newKeypoints = {} for i, keypoint in pairs(existingSeq.Keypoints) do local newColor = keypoint.Value if newColor == Color3.fromRGB(255, 0, 255) then newColor = hitPartColor end newKeypoints[i] = ColorSequenceKeypoint.new(keypoint.Time, newColor) end hitParticles.Color = ColorSequence.new(newKeypoints) end]] hitParticles:Emit(numHitParticles) visualEffectsLingerTime = math.max(visualEffectsLingerTime, hitParticles.Lifetime.Max) end -- Play hit sound if hitSound then hitSound:Play() visualEffectsLingerTime = math.max(visualEffectsLingerTime, hitSound.TimeLength) end -- Manage/show decals, billboards, and models (such as an arrow) that appear where the projectile hit (only if the hit object was not a humanoid/player) local hitPointObjectSpace = hitPart.CFrame:pointToObjectSpace(hitPoint) local hitNormalObjectSpace = hitPart.CFrame:vectorToObjectSpace(hitNormal) if not NO_BULLET_DECALS and hitPart and not hitPart.Parent or not hitPart.Parent:FindFirstChildOfClass("Humanoid") and hitPointObjectSpace and hitNormalObjectSpace and self.hitMarkTemplate then -- Clone hitMark (this contains all the decals/billboards/models to show on the hit surface) local hitMark = self.hitMarkTemplate:Clone() hitMark.Parent = hitPart CollectionService:AddTag(hitMark, "WeaponsSystemIgnore") -- Move/align hitMark to the hit surface local incomingVec = parabola:sampleVelocity(1).Unit if self:getConfigValue("AlignHitMarkToNormal", true) then -- Make hitMark face straight out from surface where projectile hit (good for decals) local forward = hitNormalObjectSpace local up = incomingVec local right = -forward:Cross(up).Unit up = forward:Cross(right) local orientationCFrame = CFrame.fromMatrix(hitPointObjectSpace + hitNormalObjectSpace * 0.05, right, up, -forward) hitMark.CFrame = hitPart.CFrame:toWorldSpace(orientationCFrame) else -- Make hitmark appear stuck in the hit surface from the direction the projectile came from (good for things like arrows) hitMark.CFrame = hitPart.CFrame * CFrame.new(hitPointObjectSpace, hitPointObjectSpace + hitPart.CFrame:vectorToObjectSpace(incomingVec)) end -- Weld hitMark to the hitPart local weld = Instance.new("WeldConstraint") weld.Part0 = hitMark weld.Part1 = hitPart weld.Parent = hitMark -- Fade glow decal over time local glowDecal = hitMark:FindFirstChild("Glow") if glowDecal then coroutine.wrap(function() local heartbeat = RunService.Heartbeat for i = 0, 1, 1/60 do heartbeat:Wait() glowDecal.Transparency = (i ^ 2) end end)() end -- Set bullethole decal color and fade over time local bulletHole = hitMark:FindFirstChild("BulletHole") if bulletHole then bulletHole.Color3 = hitPartColor TweenService:Create( bulletHole, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 4), { Transparency = 1 } ):Play() end -- Fade impact billboard's size and transparency over time local impactBillboard = hitMark:FindFirstChild("ImpactBillboard") if impactBillboard then local impact = impactBillboard:FindFirstChild("Impact") local impactTween = TweenService:Create( impact, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0), { Size = UDim2.new(1, 0, 1, 0) } ) impactTween.Completed:Connect(function() TweenService:Create( impact, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0), { Size = UDim2.new(0.5, 0, 0.5, 0), ImageTransparency = 1 } ):Play() end) impactTween:Play() end -- Destroy hitMark in 5 seconds Debris:AddItem(hitMark, 5) end flyingVisualEffectsFinished = true visualEffectsFinishTime = now + visualEffectsLingerTime end end -- Will enter this if-statement if projectile hit something or maxDistance has been reached if projFront >= maxDist then if not stoppedMotion then stoppedMotion = true stoppedMotionAt = now end -- Stop particle effects if projectile didn't hit anything and projBack has reached the end if projBack >= maxDist and not flyingVisualEffectsFinished then flyingVisualEffectsFinished = true visualEffectsFinishTime = now + visualEffectsLingerTime end end -- Update parabola domain parabola:setDomain(projBack, projFront) -- Continue updating pTravelDistance until projBack has reached maxDist (this helps with some visual effects) if projBack < maxDist then pTravelDistance = math.max(0, timeSinceStart * bulletSpeed) end -- Update visual effects each frame -- Update CFrame/velocity of projectile if the projectile uses a model (such as rocket or grenade) if shouldMovePart then local bulletPos = parabola:samplePoint(1) local bulletVelocity = parabola:sampleVelocity(1) bulletEffect.CFrame = CFrame.new(bulletPos, bulletPos + bulletVelocity) bulletEffect.Velocity = bulletVelocity.Unit * bulletSpeed end -- Update thickness and render trailing beams local thickness0 = beamThickness0 local thickness1 = beamThickness1 if beamFadeTime then -- Fade out trail beams if projectile is no longer moving (hit something or reached max distance) local timeSinceEnd = stoppedMotion and (now - stoppedMotionAt) or 0 local fadeAlpha = math.clamp(timeSinceEnd / beamFadeTime, 0, 1) thickness0 = thickness0 * (1 - fadeAlpha) thickness1 = thickness1 * (1 - fadeAlpha) end if beam0 then beam0.Width0 = thickness0 beam0.Width1 = thickness1 parabola:renderToBeam(beam0) end if beam1 then beam1.Width0 = thickness0 beam1.Width1 = thickness1 parabola:renderToBeam(beam1) end -- Disable muzzle flash after muzzleFlashTime seconds have passed if muzzleFlashShown and timeSinceStart > muzzleFlashTime and self.muzzleFlashBeam then self.muzzleFlashBeam.Enabled = false muzzleFlashShown = false end -- Destroy projectile and attached visual effects when visual effects are done showing or max bullet time has been reached local timeSinceParticleEffectsFinished = now - visualEffectsFinishTime if (flyingVisualEffectsFinished and timeSinceParticleEffectsFinished > 0) or timeSinceStart > MAX_BULLET_TIME then if bulletEffect then bulletEffect:Destroy() bulletEffect = nil end stepConn:Disconnect() end end stepConn = RunService.Heartbeat:Connect(steppedCallback) -- Get rid of charge on chargeable weapons if not IsServer and self.usesCharging then self.charge = math.clamp(self.charge - self:getConfigValue("FireDischarge", 1), 0, 1) end end function BulletWeapon:calculateDamage(travelDistance) local zeroDamageDistance = self:getConfigValue("ZeroDamageDistance", 10000) local fullDamageDistance = self:getConfigValue("FullDamageDistance", 1000) local distRange = zeroDamageDistance - fullDamageDistance local falloff = math.clamp(1 - (math.max(0, travelDistance - fullDamageDistance) / math.max(1, distRange)), 0, 1) return math.max(self:getConfigValue("HitDamage", 10) * falloff, 0) end function BulletWeapon:applyDamage(hitInfo) local damage = self:calculateDamage(hitInfo.d) if damage <= 0 then return end self.weaponsSystem.doDamage(hitInfo.h, damage, nil, self.player) end function BulletWeapon:onHit(hitInfo) local hitPoint = hitInfo.p local hitNormal = hitInfo.n local hitPart = hitInfo.part if hitPart and hitPart.Parent then local humanoid = self.weaponsSystem.getHumanoid(hitPart) hitInfo.h = humanoid or hitPart if IsServer and (not hitInfo.h:IsA("Humanoid") or self.weaponsSystem.playersOnDifferentTeams(self.weaponsSystem.getPlayerFromHumanoid(hitInfo.h), self.player)) then self:applyDamage(hitInfo) elseif hitInfo.h:IsA("Humanoid") and hitInfo.h:GetState() ~= Enum.HumanoidStateType.Dead and self.weaponsSystem.gui and self.player == Players.LocalPlayer and self.weaponsSystem.playersOnDifferentTeams(self.weaponsSystem.getPlayerFromHumanoid(hitInfo.h), self.player) then -- Show hit indicators on gui of client that shot projectile if players are not on same team self.weaponsSystem.gui:OnHitOtherPlayer(self:calculateDamage(hitInfo.d), hitInfo.h) end end -- Create invisible explosion on server that deals damage to anything caught in the explosion if IsServer and self:getConfigValue("ExplodeOnImpact", false) then local blastRadius = self:getConfigValue("BlastRadius", 8) local blastPressure = self:getConfigValue("BlastPressure", 10000) local blastDamage = self:getConfigValue("BlastDamage", 100) local explosion = Instance.new("Explosion") explosion.Position = hitPoint + (hitNormal * 0.5) explosion.BlastRadius = blastRadius explosion.BlastPressure = blastPressure explosion.ExplosionType = Enum.ExplosionType.NoCraters explosion.DestroyJointRadiusPercent = 0 explosion.Visible = false explosion.Hit:Connect(function(explodedPart, hitDist) local damageMultiplier = (1 - math.clamp((hitDist / blastRadius), 0, 1)) local damageToDeal = blastDamage * damageMultiplier local humanoid = self.weaponsSystem.getHumanoid(explodedPart) if humanoid then if explodedPart.Name == "UpperTorso" and humanoid:GetState() ~= Enum.HumanoidStateType.Dead and self.weaponsSystem.playersOnDifferentTeams(self.weaponsSystem.getPlayerFromHumanoid(humanoid), self.player) then -- Do damage to players/humanoids self.weaponsSystem.doDamage(humanoid, damageToDeal, nil, self.player) end elseif not CollectionService:HasTag(explodedPart, "WeaponsSystemIgnore") then -- Do damage to a part (sends damage to breaking system) self.weaponsSystem.doDamage(explodedPart, damageToDeal, nil, self.player) end end) explosion.Parent = workspace end end function BulletWeapon:fire(origin, dir, charge) if not self:isCharged() then return end BaseWeapon.fire(self, origin, dir, charge) end function BulletWeapon:onFired(firingPlayer, fireInfo, fromNetwork) if not IsServer and firingPlayer == Players.LocalPlayer and fromNetwork then return end local cooldownTime = self:getConfigValue("ShotCooldown", 0.1) local fireMode = self:getConfigValue("FireMode", "Semiautomatic") local isSemiAuto = fireMode == "Semiautomatic" local isBurst = fireMode == "Burst" if isBurst and not self.burstFiring then self.burstIdx = 0 self.burstFiring = true elseif isSemiAuto then self.triggerDisconnected = true end -- Calculate cooldown time for burst firing if self.burstFiring then self.burstIdx = self.burstIdx + 1 if self.burstIdx >= self:getConfigValue("NumBurstShots", 3) then self.burstFiring = false self.triggerDisconnected = true else cooldownTime = self:getConfigValue("BurstShotCooldown", nil) or cooldownTime end end self.nextFireTime = tick() + cooldownTime BaseWeapon.onFired(self, firingPlayer, fireInfo, fromNetwork) end function BulletWeapon:onConfigValueChanged(valueName, newValue, oldValue) BaseWeapon.onConfigValueChanged(self, valueName, newValue, oldValue) if valueName == "ShotEffect" then self.bulletEffectTemplate = ShotsFolder:FindFirstChild(self:getConfigValue("ShotEffect", "Bullet")) if self.bulletEffectTemplate then local config = self.bulletEffectTemplate:FindFirstChildOfClass("Configuration") if config then self:importConfiguration(config) end local beam0 = self.bulletEffectTemplate:FindFirstChild("Beam0") if beam0 then coroutine.wrap(function() ContentProvider:PreloadAsync({ beam0 }) end)() end end elseif valueName == "HitMarkEffect" then self.hitMarkTemplate = HitMarksFolder:FindFirstChild(self:getConfigValue("HitMarkEffect", "BulletHole")) if self.hitMarkTemplate then local config = self.hitMarkTemplate:FindFirstChildOfClass("Configuration") if config then self:importConfiguration(config) end end elseif valueName == "CasingEffect" then self.casingTemplate = CasingsFolder:FindFirstChild(self:getConfigValue("CasingEffect", "")) if self.casingTemplate then local config = self.casingTemplate:FindFirstChildOfClass("Configuration") if config then self:importConfiguration(config) end end elseif valueName == "ChargeRate" then self.usesCharging = newValue ~= nil end end function BulletWeapon:onActivatedChanged() BaseWeapon.onActivatedChanged(self) if not IsServer then -- Reload if no ammo left in clip if self.equipped and self:getAmmoInWeapon() <= 0 then self:reload() return end -- Fire weapon if self.activated and self.player == localPlayer and self:canFire() and tick() > self.nextFireTime then self:doLocalFire() end -- Reenable trigger after activated changes to false if not self.activated and self.triggerDisconnected and not self.burstFiring then self.triggerDisconnected = false end end end function BulletWeapon:onRenderStepped(dt) BaseWeapon.onRenderStepped(self, dt) if not self.tipAttach then return end if not self.equipped then return end local tipCFrame = self.tipAttach.WorldCFrame if self.player == Players.LocalPlayer then -- Retrieve aim point from camera and update player's aim animation local aimTrack = self:getAnimTrack(self:getConfigValue("AimTrack", "RifleAim")) local aimZoomTrack = self:getAnimTrack(self:getConfigValue("AimZoomTrack", "RifleAimDownSights")) if aimTrack then local aimDir = tipCFrame.LookVector local gunLookRay = Ray.new(tipCFrame.p, aimDir * 500) local _, gunHitPoint = Roblox.penetrateCast(gunLookRay, self.ignoreList) if self.weaponsSystem.aimRayCallback then local _, hitPoint = Roblox.penetrateCast(self.weaponsSystem.aimRayCallback(), self.ignoreList) self.aimPoint = hitPoint else self.aimPoint = gunHitPoint end if not aimTrack.IsPlaying and not self.reloading then aimTrack:Play(0.15) coroutine.wrap(function() -- prevent player from firing until gun is fully out wait(self:getConfigValue("StartupTime", 0.2)) self.startupFinished = true end)() end if aimZoomTrack and not self.reloading then if not aimZoomTrack.IsPlaying then aimZoomTrack:Play(0.15) end aimZoomTrack:AdjustSpeed(0.001) if self.weaponsSystem.camera:isZoomed() then if aimTrack.WeightTarget ~= 0 then aimZoomTrack:AdjustWeight(1) aimTrack:AdjustWeight(0) end elseif aimTrack.WeightTarget ~= 1 then aimZoomTrack:AdjustWeight(0) aimTrack:AdjustWeight(1) end end local MIN_ANGLE = -80 local MAX_ANGLE = 80 local aimYAngle = math.deg(self.recoilIntensity) if self.weaponsSystem.camera.enabled then -- Gets pitch and recoil from camera to figure out how high/low to aim the gun aimYAngle = math.deg(self.weaponsSystem.camera:getRelativePitch() + self.weaponsSystem.camera.currentRecoil.Y + self.recoilIntensity) end local aimTimePos = 2 * ((aimYAngle - MIN_ANGLE) / (MAX_ANGLE - MIN_ANGLE)) aimTrack:AdjustSpeed(0.001) aimTrack.TimePosition = math.clamp(aimTimePos, 0.001, 1.97) if aimZoomTrack then aimZoomTrack.TimePosition = math.clamp(aimTimePos, 0.001, 1.97) end -- Update recoil (decay over time) local recoilDecay = self:getConfigValue("RecoilDecay", 0.825) self.recoilIntensity = math.clamp(self.recoilIntensity * recoilDecay, 0, math.huge) else warn("no aimTrack") end end end function BulletWeapon:setChargingParticles(charge) local ratePerCharge = self:getConfigValue("ChargingParticlesRatePerCharge", 20) local rate = ratePerCharge * charge for _, v in pairs(self.chargingParticles) do v.Rate = rate end end function BulletWeapon:onStepped(dt) if not self.tipAttach then return end if not self.equipped then return end BaseWeapon.onStepped(self, dt) local now = tick() local chargingSound = self:getSound("Charging") local dischargingSound = self:getSound("Discharging") if self.usesCharging then -- Update charge amount local chargeBefore = self.charge self:handleCharging(dt) local chargeDelta = self.charge - chargeBefore -- Update charge particles if chargeDelta > 0 then self:setChargingParticles(self.charge) else self:setChargingParticles(0) end -- Play charging sounds if chargingSound then if chargingSound.Looped then if chargeDelta < 0 then chargingSound:Stop() else if not chargingSound.Playing and self.charge < 1 and chargeDelta > 0 then chargingSound:Play() end chargingSound.PlaybackSpeed = self.chargeSoundPitchMin + (self.charge * (self.chargeSoundPitchMax - self.chargeSoundPitchMin)) end else if chargeDelta > 0 and self.charge <= 1 and not chargingSound.Playing then chargingSound.TimePosition = chargingSound.TimeLength * self.charge chargingSound:Play() elseif chargeDelta <= 0 and chargingSound.Playing then chargingSound:Stop() end end end if dischargingSound then if dischargingSound.Looped then if chargeDelta > 0 then dischargingSound:Stop() else if not dischargingSound.Playing and self.charge > 0 then dischargingSound:Play() end dischargingSound.PlaybackSpeed = self.chargeSoundPitchMin + (self.charge * (self.chargeSoundPitchMax - self.chargeSoundPitchMin)) end else if chargeDelta < 0 and self.charge >= 0 and not dischargingSound.Playing then dischargingSound.TimePosition = dischargingSound.TimeLength * self.charge dischargingSound:Play() elseif chargeDelta >= 0 and dischargingSound.Playing then dischargingSound:Stop() end end end -- Play charge/discharge completed sounds and particle effects if chargeBefore < 1 and self.charge >= 1 then local chargeCompleteSound = self:getSound("ChargeComplete") if chargeCompleteSound then chargeCompleteSound:Play() end if chargingSound and chargingSound.Playing then chargingSound:Stop() end if self.chargeCompleteParticles then self.chargeCompleteParticles:Emit(self:getConfigValue("NumChargeCompleteParticles", 25)) end end if chargeBefore > 0 and self.charge <= 0 then local dischargeCompleteSound = self:getSound("DischargeComplete") if dischargeCompleteSound then dischargeCompleteSound:Play() end if dischargingSound and dischargingSound.Playing then dischargingSound:Stop() end if self.dischargeCompleteParticles then self.dischargeCompleteParticles:Emit(self:getConfigValue("NumDischargeCompleteParticles", 25)) end end self:renderCharge() else if chargingSound then chargingSound:Stop() end if dischargingSound then dischargingSound:Stop() end end if self.usesCharging and self.chargeGlowPart then self.chargeGlowPart.Transparency = 1 - self.charge end -- Fire weapon if it is fully charged if self:canFire() and now > self.nextFireTime then self:doLocalFire() end end function BulletWeapon:handleCharging(dt) local chargeDelta local shouldCharge = self.activated or self.burstFiring or self:getConfigValue("ChargePassively", false) if self.reloading or self.triggerDisconnected then shouldCharge = false end if shouldCharge then chargeDelta = self:getConfigValue("ChargeRate", 0) * dt else chargeDelta = self:getConfigValue("DischargeRate", 0) * -dt end self.charge = math.clamp(self.charge + chargeDelta, 0, 1) end function BulletWeapon:isCharged() return not self.usesCharging or self.charge >= 1 end function BulletWeapon:canFire() return self.player == Players.LocalPlayer and (self.burstFiring or self.activated) and not self.triggerDisconnected and not self.reloading and self:isCharged() and self.startupFinished end function BulletWeapon:doLocalFire() if self.tipAttach then local tipCFrame = self.tipAttach.WorldCFrame local tipPos = tipCFrame.Position local aimDir = (self.aimPoint - tipPos).Unit self:fire(tipPos, aimDir, self.charge) end end return BulletWeapon
--[=[ Observes an instance's ancestry with a brio @param instance Instance @param className string @return Observable<Brio<Instance>> ]=]
function RxInstanceUtils.observeFirstAncestorBrio(instance, className) assert(typeof(instance) == "Instance", "Bad instance") assert(type(className) == "string", "Bad className") return Observable.new(function(sub) local maid = Maid.new() local lastFound = nil local function handleAncestryChanged() local found = instance:FindFirstAncestorWhichIsA(className) if found then if found ~= lastFound then lastFound = found local brio = Brio.new(found) maid._current = brio sub:Fire(brio) end elseif lastFound then maid._current = nil lastFound = nil end end maid:GiveTask(instance.AncestryChanged:Connect(handleAncestryChanged)) handleAncestryChanged() return maid end) end
--Weld stuff here
MakeWeld(car.Misc.Hinges.Hinge,car.DriveSeat,"Motor",0).Name="ENGINE" ModelWeld(misc.Hinges.Parts,misc.Hinges.Hinge) MakeWeld(car.Misc.ActualCam.Hinge,car.Misc.Hinges.Parts.Hinge2,"Motor",0).Name="ENGINE" ModelWeld(misc.ActualCam.Parts,misc.ActualCam.Hinge) MakeWeld(car.Misc.Tach.M,car.DriveSeat,"Motor").Name="M" ModelWeld(misc.Tach.Parts,misc.Tach.M) MakeWeld(car.Misc.Speedo.N,car.DriveSeat,"Motor").Name="N" ModelWeld(misc.Speedo.Parts,misc.Speedo.N) MakeWeld(misc.Popups.Hinge, car.DriveSeat,"Motor",.1) ModelWeld(misc.Popups.Parts, misc.Popups.Hinge) local INT_PCK = nil for i,v in pairs(misc:GetDescendants()) do if v:IsA("ObjectValue") and v.Name == "INTERIOR_PACK" then INT_PCK = v.Value end end if INT_PCK then if INT_PCK:FindFirstChild("Handbrake") then local HB = INT_PCK.Handbrake MakeWeld(HB.W,car.DriveSeat,"Motor",0.1) ModelWeld(HB.Parts,HB.W) ModelWeld(HB.Misc,car.DriveSeat) end if INT_PCK:FindFirstChild("Pedals") then local PD = INT_PCK.Pedals MakeWeld(PD.B,car.DriveSeat,"Motor",0.1) ModelWeld(PD.Brake,PD.B) MakeWeld(PD.C,car.DriveSeat,"Motor",0.1) ModelWeld(PD.Clutch,PD.C) MakeWeld(PD.T,car.DriveSeat,"Motor",0.1) ModelWeld(PD.Throttle,PD.T) end if INT_PCK:FindFirstChild("Shifter") then local SH = INT_PCK.Shifter MakeWeld(SH.Hinge,car.DriveSeat,"Weld") MakeWeld(SH.W1,SH.Hinge,"Motor",0.05) MakeWeld(SH.W2,SH.W1,"Motor",0.05) ModelWeld(SH.Parts,SH.W2) ModelWeld(SH.Misc,car.DriveSeat) end if INT_PCK:FindFirstChild("Steering_Wheel") then local SW = INT_PCK.Steering_Wheel MakeWeld(SW.W,car.DriveSeat,"Motor",0.5) ModelWeld(SW.Parts,SW.W) end end 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(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(13),0,0) end end)
--[[ Updates the value stored in this State object. If `force` is enabled, this will skip equality checks and always update the state object and any dependents - use this with care as this can lead to unnecessary updates. ]]
function class:set(newValue: any, force: boolean?) local oldValue = self._value if force or not isSimilar(oldValue, newValue) then self._value = newValue updateAll(self) end end local function Value<T>(initialValue: T): Types.State<T> local self = setmetatable({ type = "State", kind = "Value", -- 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), _value = initialValue }, CLASS_METATABLE) initDependency(self) return self end return Value
-- Spawn all of the vehicles in the map
SpawnVehicles()
--This is the server sided module for handling this vehicles seating requests
local Players = game:GetService("Players") local Workspace = game:GetService("Workspace") local HttpService = game:GetService("HttpService") local DOOR_OPEN_SPEED = 2.15 local DOOR_OPEN_ANGLE = 55 local DOOR_OPEN_TIME = 0.5 --How long the door stays open for when entering/leaving local MAX_SEATING_DISTANCE = 15 local MIN_FLIP_ANGLE = 70 --degrees from vertical local PackagedScripts = script.Parent local PackagedVehicle = PackagedScripts.Parent local RemotesFolder = nil --Set later in the code by the SetRemotesFolder function
-- // Vars
local TweenService = game:GetService("TweenService") local frame = script.Parent.Parent local button = script.Parent local onPosition = UDim2.new(0, 0,0, 0) local onColor = Color3.new(0.333333, 1, 0) local offPosition = UDim2.new(0.519, 0,0, 0) local offColor = Color3.new(1, 0, 0) local debounce = false local waitTime = 0.5
-- setup emote chat hook
game:GetService("Players").LocalPlayer.Chatted:connect(function(msg) local emote = "" if string.sub(msg, 1, 3) == "/e " then emote = string.sub(msg, 4) elseif string.sub(msg, 1, 7) == "/emote " then emote = string.sub(msg, 8) end if (pose == "Standing" and emoteNames[emote] ~= nil) then playAnimation(emote, 0.1, Humanoid) end end)
----------------- --| Constants |-- -----------------
local ROCKET_MESH_ID = 'http://www.roblox.com/asset/?id=94690081' local ROCKET_MESH_SCALE = Vector3.new(1, 1, 1) local ROCKET_SHOW_TIME = 1.5 -- Seconds after animation begins to show the rocket local ROCKET_HIDE_TIME = 2.2 -- Seconds after animation begins to hide the rocket
--[[[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 ToggleABS = Enum.KeyCode.Y , ToggleTransMode = Enum.KeyCode.M , --Primary Controls Throttle = Enum.KeyCode.Up , Brake = Enum.KeyCode.Down , SteerLeft = Enum.KeyCode.Left , SteerRight = Enum.KeyCode.Right , --Secondary Controls Throttle2 = Enum.KeyCode.W , Brake2 = Enum.KeyCode.S , SteerLeft2 = Enum.KeyCode.A , SteerRight2 = Enum.KeyCode.D , --Manual Transmission ShiftUp = Enum.KeyCode.R , ShiftDown = Enum.KeyCode.F , Clutch = Enum.KeyCode.LeftShift , --Handbrake PBrake = Enum.KeyCode.P , --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 , }
--[[ The Class ]]
-- local BaseCharacterController = require(script.Parent:WaitForChild("BaseCharacterController")) local VRNavigation = setmetatable({}, BaseCharacterController) VRNavigation.__index = VRNavigation function VRNavigation.new(CONTROL_ACTION_PRIORITY) local self = setmetatable(BaseCharacterController.new(), VRNavigation) self.CONTROL_ACTION_PRIORITY = CONTROL_ACTION_PRIORITY self.navigationRequestedConn = nil self.heartbeatConn = nil self.currentDestination = nil self.currentPath = nil self.currentPoints = nil self.currentPointIdx = 0 self.expectedTimeToNextPoint = 0 self.timeReachedLastPoint = tick() self.moving = false self.isJumpBound = false self.moveLatch = false self.userCFrameEnabledConn = nil return self end function VRNavigation:SetLaserPointerMode(mode) pcall(function() StarterGui:SetCore("VRLaserPointerMode", mode) end) end function VRNavigation:GetLocalHumanoid() local character = LocalPlayer.Character if not character then return end for _, child in pairs(character:GetChildren()) do if child:IsA("Humanoid") then return child end end return nil end function VRNavigation:HasBothHandControllers() return VRService:GetUserCFrameEnabled(Enum.UserCFrame.RightHand) and VRService:GetUserCFrameEnabled(Enum.UserCFrame.LeftHand) end function VRNavigation:HasAnyHandControllers() return VRService:GetUserCFrameEnabled(Enum.UserCFrame.RightHand) or VRService:GetUserCFrameEnabled(Enum.UserCFrame.LeftHand) end function VRNavigation:IsMobileVR() return UserInputService.TouchEnabled end function VRNavigation:HasGamepad() return UserInputService.GamepadEnabled end function VRNavigation:ShouldUseNavigationLaser() --Places where we use the navigation laser: -- mobile VR with any number of hands tracked -- desktop VR with only one hand tracked -- desktop VR with no hands and no gamepad (i.e. with Oculus remote?) --using an Xbox controller with a desktop VR headset means no laser since the user has a thumbstick. --in the future, we should query thumbstick presence with a features API if self:IsMobileVR() then return true else if self:HasBothHandControllers() then return false end if not self:HasAnyHandControllers() then return not self:HasGamepad() end return true end end function VRNavigation:StartFollowingPath(newPath) currentPath = newPath currentPoints = currentPath:GetPointCoordinates() currentPointIdx = 1 moving = true timeReachedLastPoint = tick() local humanoid = self:GetLocalHumanoid() if humanoid and humanoid.Torso and #currentPoints >= 1 then local dist = (currentPoints[1] - humanoid.Torso.Position).magnitude expectedTimeToNextPoint = dist / humanoid.WalkSpeed end movementUpdateEvent:Fire("targetPoint", self.currentDestination) end function VRNavigation:GoToPoint(point) currentPath = true currentPoints = { point } currentPointIdx = 1 moving = true local humanoid = self:GetLocalHumanoid() local distance = (humanoid.Torso.Position - point).magnitude local estimatedTimeRemaining = distance / humanoid.WalkSpeed timeReachedLastPoint = tick() expectedTimeToNextPoint = estimatedTimeRemaining movementUpdateEvent:Fire("targetPoint", point) end function VRNavigation:StopFollowingPath() currentPath = nil currentPoints = nil currentPointIdx = 0 moving = false self.moveVector = ZERO_VECTOR3 end function VRNavigation:TryComputePath(startPos: Vector3, destination: Vector3) local numAttempts = 0 local newPath = nil while not newPath and numAttempts < 5 do newPath = PathfindingService:ComputeSmoothPathAsync(startPos, destination, MAX_PATHING_DISTANCE) numAttempts = numAttempts + 1 if newPath.Status == Enum.PathStatus.ClosestNoPath or newPath.Status == Enum.PathStatus.ClosestOutOfRange then newPath = nil break end if newPath and newPath.Status == Enum.PathStatus.FailStartNotEmpty then startPos = startPos + (destination - startPos).unit newPath = nil end if newPath and newPath.Status == Enum.PathStatus.FailFinishNotEmpty then destination = destination + Vector3.new(0, 1, 0) newPath = nil end end return newPath end function VRNavigation:OnNavigationRequest(destinationCFrame: CFrame, inputUserCFrame: CFrame) local destinationPosition = destinationCFrame.Position local lastDestination = self.currentDestination if not IsFiniteVector3(destinationPosition) then return end self.currentDestination = destinationPosition local humanoid = self:GetLocalHumanoid() if not humanoid or not humanoid.Torso then return end local currentPosition = humanoid.Torso.Position local distanceToDestination = (self.currentDestination - currentPosition).magnitude if distanceToDestination < NO_PATH_THRESHOLD then self:GoToPoint(self.currentDestination) return end if not lastDestination or (self.currentDestination - lastDestination).magnitude > RECALCULATE_PATH_THRESHOLD then local newPath = self:TryComputePath(currentPosition, self.currentDestination) if newPath then self:StartFollowingPath(newPath) if PathDisplay then PathDisplay.setCurrentPoints(self.currentPoints) PathDisplay.renderPath() end else self:StopFollowingPath() if PathDisplay then PathDisplay.clearRenderedPath() end end else if moving then self.currentPoints[#currentPoints] = self.currentDestination else self:GoToPoint(self.currentDestination) end end end function VRNavigation:OnJumpAction(actionName, inputState, inputObj) if inputState == Enum.UserInputState.Begin then self.isJumping = true end return Enum.ContextActionResult.Sink end function VRNavigation:BindJumpAction(active) if active then if not self.isJumpBound then self.isJumpBound = true ContextActionService:BindActionAtPriority("VRJumpAction", (function() return self:OnJumpAction() end), false, self.CONTROL_ACTION_PRIORITY, Enum.KeyCode.ButtonA) end else if self.isJumpBound then self.isJumpBound = false ContextActionService:UnbindAction("VRJumpAction") end end end function VRNavigation:ControlCharacterGamepad(actionName, inputState, inputObject) if inputObject.KeyCode ~= Enum.KeyCode.Thumbstick1 then return end if inputState == Enum.UserInputState.Cancel then self.moveVector = ZERO_VECTOR3 return end if inputState ~= Enum.UserInputState.End then self:StopFollowingPath() if PathDisplay then PathDisplay.clearRenderedPath() end if self:ShouldUseNavigationLaser() then self:BindJumpAction(true) self:SetLaserPointerMode("Hidden") end if inputObject.Position.magnitude > THUMBSTICK_DEADZONE then self.moveVector = Vector3.new(inputObject.Position.X, 0, -inputObject.Position.Y) if self.moveVector.magnitude > 0 then self.moveVector = self.moveVector.unit * math.min(1, inputObject.Position.magnitude) end self.moveLatch = true end else self.moveVector = ZERO_VECTOR3 if self:ShouldUseNavigationLaser() then self:BindJumpAction(false) self:SetLaserPointerMode("Navigation") end if self.moveLatch then self.moveLatch = false movementUpdateEvent:Fire("offtrack") end end return Enum.ContextActionResult.Sink end function VRNavigation:OnHeartbeat(dt) local newMoveVector = self.moveVector local humanoid = self:GetLocalHumanoid() if not humanoid or not humanoid.Torso then return end if self.moving and self.currentPoints then local currentPosition = humanoid.Torso.Position local goalPosition = currentPoints[1] local vectorToGoal = (goalPosition - currentPosition) * XZ_VECTOR3 local moveDist = vectorToGoal.magnitude local moveDir = vectorToGoal / moveDist if moveDist < POINT_REACHED_THRESHOLD then local estimatedTimeRemaining = 0 local prevPoint = currentPoints[1] for i, point in pairs(currentPoints) do if i ~= 1 then local dist = (point - prevPoint).magnitude prevPoint = point estimatedTimeRemaining = estimatedTimeRemaining + (dist / humanoid.WalkSpeed) end end table.remove(currentPoints, 1) currentPointIdx = currentPointIdx + 1 if #currentPoints == 0 then self:StopFollowingPath() if PathDisplay then PathDisplay.clearRenderedPath() end return else if PathDisplay then PathDisplay.setCurrentPoints(currentPoints) PathDisplay.renderPath() end local newGoal = currentPoints[1] local distanceToGoal = (newGoal - currentPosition).magnitude expectedTimeToNextPoint = distanceToGoal / humanoid.WalkSpeed timeReachedLastPoint = tick() end else local ignoreTable = { game.Players.LocalPlayer.Character, workspace.CurrentCamera } local obstructRay = Ray.new(currentPosition - Vector3.new(0, 1, 0), moveDir * 3) local obstructPart, obstructPoint, obstructNormal = workspace:FindPartOnRayWithIgnoreList(obstructRay, ignoreTable) if obstructPart then local heightOffset = Vector3.new(0, 100, 0) local jumpCheckRay = Ray.new(obstructPoint + moveDir * 0.5 + heightOffset, -heightOffset) local jumpCheckPart, jumpCheckPoint, jumpCheckNormal = workspace:FindPartOnRayWithIgnoreList(jumpCheckRay, ignoreTable) local heightDifference = jumpCheckPoint.Y - currentPosition.Y if heightDifference < 6 and heightDifference > -2 then humanoid.Jump = true end end local timeSinceLastPoint = tick() - timeReachedLastPoint if timeSinceLastPoint > expectedTimeToNextPoint + OFFTRACK_TIME_THRESHOLD then self:StopFollowingPath() if PathDisplay then PathDisplay.clearRenderedPath() end movementUpdateEvent:Fire("offtrack") end newMoveVector = self.moveVector:Lerp(moveDir, dt * 10) end end if IsFiniteVector3(newMoveVector) then self.moveVector = newMoveVector end end function VRNavigation:OnUserCFrameEnabled() if self:ShouldUseNavigationLaser() then self:BindJumpAction(false) self:SetLaserPointerMode("Navigation") else self:BindJumpAction(true) self:SetLaserPointerMode("Hidden") end end function VRNavigation:Enable(enable) self.moveVector = ZERO_VECTOR3 self.isJumping = false if enable then self.navigationRequestedConn = VRService.NavigationRequested:Connect(function(destinationCFrame, inputUserCFrame) self:OnNavigationRequest(destinationCFrame, inputUserCFrame) end) self.heartbeatConn = RunService.Heartbeat:Connect(function(dt) self:OnHeartbeat(dt) end) ContextActionService:BindAction("MoveThumbstick", (function(actionName, inputState, inputObject) return self:ControlCharacterGamepad(actionName, inputState, inputObject) end), false, self.CONTROL_ACTION_PRIORITY, Enum.KeyCode.Thumbstick1) ContextActionService:BindActivate(Enum.UserInputType.Gamepad1, Enum.KeyCode.ButtonR2) self.userCFrameEnabledConn = VRService.UserCFrameEnabled:Connect(function() self:OnUserCFrameEnabled() end) self:OnUserCFrameEnabled() VRService:SetTouchpadMode(Enum.VRTouchpad.Left, Enum.VRTouchpadMode.VirtualThumbstick) VRService:SetTouchpadMode(Enum.VRTouchpad.Right, Enum.VRTouchpadMode.ABXY) self.enabled = true else -- Disable self:StopFollowingPath() ContextActionService:UnbindAction("MoveThumbstick") ContextActionService:UnbindActivate(Enum.UserInputType.Gamepad1, Enum.KeyCode.ButtonR2) self:BindJumpAction(false) self:SetLaserPointerMode("Disabled") if self.navigationRequestedConn then self.navigationRequestedConn:Disconnect() self.navigationRequestedConn = nil end if self.heartbeatConn then self.heartbeatConn:Disconnect() self.heartbeatConn = nil end if self.userCFrameEnabledConn then self.userCFrameEnabledConn:Disconnect() self.userCFrameEnabledConn = nil end self.enabled = false end end return VRNavigation
--edit the below function to execute code when this response is chosen OR this prompt is shown --player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder) local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player) plrData.Classes.Base.Smasher.NoHumor.Value = true plrData.Classes.Base.Smasher.HeavyWeaponTraining.Value = true plrData.Classes.Base.Smasher.PlateTraining.Value = true end
--global functions
ai.Move = function(loc, mustSee, humanoid) goalHumanoid = humanoid if goalPos then goalPos = loc else goalPos = loc spawn(function() ai.State = "Tracking" local lastGoal local lastTime = time() while goalPos and ai.Humanoid do local gp = goalPos if pcall(function() return goalPos.X end) then elseif goalPos:IsA("BasePart") then gp = (ai.canSee(goalPos) or not mustSee) and goalPos.Position or nil lastTime = time() elseif goalPos:IsA("Model") then gp = nil for _, bodyPart in pairs(goalPos:GetChildren()) do if bodyPart:IsA("BasePart") and (ai.canSee(bodyPart) or not mustSee) then gp = goalPos:GetModelCFrame().p lastTime = time() break end end end lastGoal = gp and humanoid and gp + (gp - ai.Model.Torso.Position).unit * 10 or gp or lastGoal or ai.Model.Torso.Position if (goalHumanoid and goalHumanoid.Health <= 0) or (not goalHumanoid and (ai.Model.Torso.Position - lastGoal).magnitude < 3) or time() - lastTime > 3 then goalPos = nil else ai.Humanoid.Jump = objAhead(lastGoal) ai.Humanoid:MoveTo(lastGoal, workspace.Terrain) if goalHumanoid and ((ai.Model.Torso.Position - goalPos:GetModelCFrame().p) * Vector3.new(1,.5,1)).magnitude < 3 and time() - lastAttack > attackTime then attack(goalHumanoid) end end wait(.1) end if ai then ai.State = "Idle" end end) end end
--[[Weight and CG]]
Tune.Weight = 6000 -- Total weight (in pounds) Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable) --[[Width]] 5 , --[[Height]] 8 , --[[Length]] 17 } Tune.WeightDist = 65 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100) Tune.CGHeight = .100 -- 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
--- Returns a new Maid object
function Maid.new() local self = {} self.Tasks = {} return setmetatable(self, Maid) end Maid.MakeMaid = Maid.new
-- ROBLOX deviation END
local function extractValidTemplateHeadings(headings: string): string -- ROBLOX deviation START: get lines with value, return the first one, check for spaces in headings local match = headings:match(HEADINGS_FORMAT) local matches, hasEmptySpacesInHeading if match then matches = Array.filter(String.split(match, "\n"), function(line) return String.trim(line) ~= "" end) end if matches and #matches > 0 then local headings_ = Array.map(String.split(matches[1], "|"), function(heading) return String.trim(heading) end) hasEmptySpacesInHeading = Array.some(headings_, function(heading) return heading:match("%s") ~= nil end) end if match == nil or hasEmptySpacesInHeading then error( Error.new( "Table headings do not conform to expected format:\n\n" .. EXPECTED_COLOR("heading1 | headingN") .. "\n\n" .. "Received:\n\n" .. RECEIVED_COLOR(pretty(headings)) ) ) end -- ROBLOX deviation END return matches[1] end exports.extractValidTemplateHeadings = extractValidTemplateHeadings return exports
--HUB.Default.Lock.MouseButton1Click:connect(function() -- if carSeat.Seatlock.Value == false then -- handler:FireServer('seatlock',true,0) -- else -- handler:FireServer('seatlock',false,12) -- end --end)
radio.Buttons.Play.MouseButton1Click:connect(function() handler:FireServer('updateSong', radio.Buttons.Input.Text) end) radio.Buttons.Stop.MouseButton1Click:connect(function() handler:FireServer('pauseSong') end) game:GetService("RunService").RenderStepped:connect(function() if cam == "lockplr" then local XLook=math.max(math.min(((mouse.X-(mouse.ViewSizeX/2))/300)^3,1),-1) local YLook=math.max(math.min(((mouse.Y-(mouse.ViewSizeY/2))/300)^3,1),-1) local LookOffset if player.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then LookOffset=player.Character.Head.CFrame:toWorldSpace(CFrame.new(0.05,.2,-.1)*CFrame.Angles(-YLook,-XLook,0)) else LookOffset=player.Character.Head.CFrame:toWorldSpace(CFrame.new(0.05,0,-.3)*CFrame.Angles(-YLook,-XLook,0)) end Camera.CameraType="Scriptable" Camera.CameraSubject=player.Character.Humanoid Camera.CoordinateFrame=LookOffset player.CameraMaxZoomDistance=0 else player.CameraMaxZoomDistance=400 end end) while wait() do HUB.Misc.SS.ImageTransparency = carSeat.SST.Value and 0 or 0.7 if carSeat.Tic.Value then HUB.Misc.SS.ImageColor3 = Color3.new(0,1,0) else HUB.Misc.SS.ImageColor3 = Color3.new(0,0,0) end HUB.Misc.CC.ImageColor3 = carSeat.CC.Value and Color3.new(0,1,0) or Color3.new(0,0,0) end
--[[ wpcallPacked is a version of xpcall that: * Returns the length of the result first * Returns the result packed into a table * Passes extra arguments through to the passed function; xpcall doesn't * Issues a warning if PROMISE_DEBUG is enabled ]]
local function wpcallPacked(f, ...) local argsLength, args = pack(...) local body = function() return f(unpack(args, 1, argsLength)) end local resultLength, result = pack(xpcall(body, debug.traceback)) -- If promise debugging is on, warn whenever a pcall fails. -- This is useful for debugging issues within the Promise implementation -- itself. if PROMISE_DEBUG and not result[1] then warn(result[2]) end return resultLength, result end
--Save data to DataStore
local function savePlayerData(player, playerLeaving) local pdata = main.pd[player] if pdata and (pdata.DataToUpdate or playerLeaving) then return main:GetModule("DataStores"):DataStoreRetry(datastoreRetries, function() return playerDataStore:UpdateAsync(player.UserId, function(oldValue) local newValue = oldValue or {DataKey = 0} if pdata and main.pd[player] then if pdata.DataKey == newValue.DataKey then main.pd[player].DataToUpdate = false main.pd[player].DataKey = pdata.DataKey + 1 -- local pdataToSave = {} for a,b in pairs(main.pd[player]) do pdataToSave[a] = b end if not pdataToSave.SaveRank then --if playerLeaving and not pdataToSave.SaveRank then pdataToSave.Rank = 0 end local dataNotToSave = dataNotToSave() for i, v in pairs(dataNotToSave) do pdataToSave[v] = nil end -- newValue = pdataToSave else newValue = nil --Prevent data being overwritten end end return newValue end) end) end end
-- << PERMISSION TYPES >>
--[[ auto Owner -- Can use all commands & set all permissions 4 HeadAdmin -- Can use all commands & set all permissions (except from 'Owner') 3 Admin -- Can ban & set Moderators/VIP 2 Mod -- Can kick, mute, & use most commands 1 VIP -- Can use nonabusive commands only on self ]]
-- ================================================================================ -- SETTINGS -- ================================================================================
GameSettings.intermissionDuration = 10 -- Duration of intermission in seconds GameSettings.roundDuration = 60 -- Durationof race in seconds GameSettings.countdownDuration = 3 -- Race countdown at starting line in seconds GameSettings.minimumPlayers = 2 -- Minimum number of players for a race to start GameSettings.transitionEnd = 3 -- Duration of time between end of race and beginning of -- next intermission
--// This module is for stuff specific to cross server communication --// NOTE: THIS IS NOT A *CONFIG/USER* PLUGIN! ANYTHING IN THE MAINMODULE PLUGIN FOLDERS IS ALREADY PART OF/LOADED BY THE SCRIPT! DO NOT ADD THEM TO YOUR CONFIG>PLUGINS FOLDER!
return function(Vargs) local server = Vargs.Server; local service = Vargs.Service; local Settings = server.Settings local Functions, Commands, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Deps = server.Functions, server.Commands, server.Admin, server.Anti, server.Core, server.HTTP, server.Logs, server.Remote, server.Process, server.Variables, server.Deps -- // Remove legacy trello board if table.find(server.settings.Trello_Secondary, "9HH6BEX2") then table.remove(table.find(server.settings.Trello_Secondary, "9HH6BEX2")) Logs:AddLog("Script", "Removed legacy trello board"); end Logs:AddLog("Script", "Misc Features Module Loaded"); end;
--> functions
script.Parent.MouseButton1Click:connect(function() fovCamera.FieldOfView = fovCode.Text fovCode.Text = "FOV Number" end)
-- See if I have a tool
local spawner = script.Parent local tool = nil local region = Region3.new(Vector3.new(spawner.Position.X - spawner.Size.X/2, spawner.Position.Y + spawner.Size.Y/2, spawner.Position.Z - spawner.Size.Z/2), Vector3.new(spawner.Position.X + spawner.Size.X/2, spawner.Position.Y + 4, spawner.Position.Z + spawner.Size.Z/2)) local parts = game.Workspace:FindPartsInRegion3(region) for _, part in pairs(parts) do if part and part.Parent and part.Parent:IsA("Tool") then tool = part.Parent break end end local configTable = spawner.Configurations local configs = {} local function loadConfig(configName, defaultValue) if configTable:FindFirstChild(configName) then configs[configName] = configTable:FindFirstChild(configName).Value else configs[configName] = defaultValue end end loadConfig("SpawnCooldown", 3) if tool then tool.Parent = game.ServerStorage while true do -- put tool on pad local toolCopy = tool:Clone() local handle = toolCopy:FindFirstChild("Handle") toolCopy.Parent = game.Workspace local toolOnPad = true local parentConnection parentConnection = toolCopy.AncestryChanged:connect(function() if handle then handle.Anchored = false end toolOnPad = false parentConnection:disconnect() end) if handle then handle.CFrame = (spawner.CFrame + Vector3.new(0,handle.Size.Z/2 + 1,0)) * CFrame.Angles(-math.pi/2,0,0) handle.Anchored = true end -- wait for tool to be removed while toolOnPad do if handle then handle.CFrame = handle.CFrame * CFrame.Angles(0,0,math.pi/60) end wait() end -- wait for cooldown wait(configs["SpawnCooldown"]) end end
--Dupes a part from the template.
local function MakeFromTemplate(template: BasePart, currentCacheParent: Instance): BasePart local part: BasePart = template:Clone() -- ^ Ignore W000 type mismatch between Instance and BasePart. False alert. part.CFrame = CF_REALLY_FAR_AWAY part.Anchored = true part.Parent = currentCacheParent return part end function PartCacheStatic.new(template: BasePart, numPrecreatedParts: number, currentCacheParent: Instance): PartCache local newNumPrecreatedParts: number = numPrecreatedParts or 5 local newCurrentCacheParent: Instance = currentCacheParent or workspace --PrecreatedParts value. --Same thing. Ensure it's a number, ensure it's not negative, warn if it's really huge or 0. assert(numPrecreatedParts > 0, "PrecreatedParts can not be negative!") assertwarn(numPrecreatedParts ~= 0, "PrecreatedParts is 0! This may have adverse effects when initially using the cache.") assertwarn(template.Archivable, "The template's Archivable property has been set to false, which prevents it from being cloned. It will temporarily be set to true.") local oldArchivable = template.Archivable template.Archivable = true local newTemplate: BasePart = template:Clone() -- ^ Ignore W000 type mismatch between Instance and BasePart. False alert. template.Archivable = oldArchivable template = newTemplate local object: PartCache = { Open = {}, InUse = {}, CurrentCacheParent = newCurrentCacheParent, Template = template, ExpansionSize = 10 } setmetatable(object, PartCacheStatic) -- Below: Ignore type mismatch nil | number and the nil | Instance mismatch on the table.insert line. for _ = 1, newNumPrecreatedParts do table.insert(object.Open, MakeFromTemplate(template, object.CurrentCacheParent)) end object.Template.Parent = nil return object -- ^ Ignore mismatch here too end
-------------------------------------------------------------------------------------------------------------------------------------------------------
local P = script.Parent local Run = game:GetService('RunService') local wheels = P.System.Wheels local seat = P.System.VehicleSeat local vars = seat.ATSVariables local exclude = {"Wheels"} function WeldPair(x, y) local weld = Instance.new("Weld",x) weld.Part0 = x weld.Part1 = y weld.C1 = y.CFrame:toObjectSpace(x.CFrame); end function WeldAll(model, main) -- model can be anything for i,v in pairs(exclude) do if (model.Name == v) then return end end if model:IsA("BasePart") then WeldPair(main, model) end for _,v in pairs(model:GetChildren()) do WeldAll(v, main) end end function UnanchorAll(model) -- model can be anything if (model:IsA("BasePart")) then model.Anchored = false end for _,v in pairs(model:GetChildren()) do UnanchorAll(v) end end function Joint(x,y, c0, c1, type) local W = Instance.new(type, x) W.Part0 = x W.Part1 = y W.C0 = c0 W.C1 = c1 return W end function CreateWheelPart() local p = Instance.new("Part") p.FormFactor = Enum.FormFactor.Custom p.Transparency = 1 p.Anchored = true p.CanCollide = false p.TopSurface = Enum.SurfaceType.Unjoinable p.BottomSurface = Enum.SurfaceType.Unjoinable p.LeftSurface = Enum.SurfaceType.Unjoinable p.RightSurface = Enum.SurfaceType.Unjoinable p.FrontSurface = Enum.SurfaceType.Unjoinable p.BackSurface = Enum.SurfaceType.Unjoinable return p end for i,v in pairs(wheels:GetChildren()) do if (v:IsA("BasePart")) then local diameter = v.Size.x local M = Instance.new("Model",wheels) M.Name = v.Name v.Parent = M v.Name = "Wheel" for j,w in pairs(v:GetChildren()) do if (w:IsA("BasePart")) then w.Parent = M WeldPair(v,w) w.CanCollide = false end end if (v:FindFirstChild("Steer")) then local A = CreateWheelPart() A.Name = "Steer" A.Size = Vector3.new(diameter, 1, 0.6) A.CFrame = v.CFrame A.Parent = M end local B = CreateWheelPart() B.Name = "Suspension" B.Size = Vector3.new(0.8, 1, diameter) B.CFrame = v.CFrame * CFrame.new(-1,0,0) B.Parent = M local BB = Instance.new("BodyGyro") BB.Name = "BG" if (v:FindFirstChild("Steer")) then BB.D = vars.SuspensionDampeningFront.Value else BB.D = vars.SuspensionDampeningRear.Value end BB.P = vars.SuspensionPower.Value BB.maxTorque = Vector3.new() BB.Parent = B local C = CreateWheelPart() C.Name = "BodyHinge" C.Size = Vector3.new(0.8, 1, diameter) C.CFrame = v.CFrame * CFrame.new(1,0,0) C.Parent = M if (v:FindFirstChild("Powered")) then local CC = Instance.new("BodyAngularVelocity") CC.Name = "BAV" CC.angularvelocity = Vector3.new() CC.maxTorque = Vector3.new(20000, 0, 20000) CC.P = 800 CC.Parent = v end end end for i,v in pairs(wheels:GetChildren()) do if (v:FindFirstChild("Wheel")) and (v:FindFirstChild("Suspension")) then local isSteeringWheel = (v:FindFirstChild("Steer") ~= nil) if (v:FindFirstChild("Mesh")) then WeldAll(v.Mesh, v.Wheel) end if (isSteeringWheel) then Joint(v.Wheel, v.Steer, CFrame.Angles(math.pi / 2,0,0), v.Steer.CFrame:toObjectSpace(v.Wheel.CFrame) * CFrame.Angles(math.pi / 2,0,0), "Rotate") local M = Joint(v.Steer, v.Suspension, CFrame.Angles(math.pi,0,0), v.Suspension.CFrame:toObjectSpace(v.Steer.CFrame) * CFrame.Angles(math.pi,0,0), "Motor") M.MaxVelocity = 0.03 else Joint(v.Wheel, v.Suspension, CFrame.Angles(math.pi / 2,0,0), v.Suspension.CFrame:toObjectSpace(v.Wheel.CFrame) * CFrame.Angles(math.pi / 2,0,0), "Rotate") end Joint(v.Suspension, v.BodyHinge, CFrame.new(Vector3.new(2,0,0)) * CFrame.Angles(math.pi/2,0,0), v.BodyHinge.CFrame:toObjectSpace(v.Suspension.CFrame) * CFrame.new(Vector3.new(2,0,0)) * CFrame.Angles(math.pi/2,0,0), "Rotate") Joint(v.BodyHinge, seat, CFrame.new(), seat.CFrame:toObjectSpace(v.BodyHinge.CFrame), "Weld") else print("Invalid wheel: Missing Wheel or Suspension part!") end end WeldAll(P, seat) wait(0.5) UnanchorAll(P) function UpdateWheels() if (not wheels) or (not seat) or (not vars) then return end for i,v in pairs(wheels:GetChildren()) do if (v:FindFirstChild("Suspension")) then v.Suspension.BG.CFrame = seat.CFrame * CFrame.Angles(-math.pi/2,-math.rad(vars.SuspensionAngle.Value),0) end end end UpdateWheels() for i,v in pairs(wheels:GetChildren()) do if (v:FindFirstChild("Suspension")) then local isSteeringWheel = (v:FindFirstChild("Steer") ~= nil) if(isSteeringWheel) then v.Suspension.BG.maxTorque = Vector3.new(0,3000000,0) else v.Suspension.BG.maxTorque = Vector3.new(0,9000000,0) end end end Run.Heartbeat:connect(UpdateWheels)
--[=[ @tag Component Class `Construct` is called before the component is started, and should be used to construct the component instance. ```lua local MyComponent = Component.new({Tag = "MyComponent"}) function MyComponent:Construct() self.SomeData = 32 self.OtherStuff = "HelloWorld" end ``` ]=]
function Component:Construct() end
--[=[ Pushes an entry to the right of the queue @param value T ]=]
function Queue:PushRight(value) self._last = self._last + 1 self[self._last] = value end
--NOTICE: If converting to an AF, uncomment any of the commented codes below
ButtonAlert.ProximityPrompt.Triggered:Connect(function() Events:Fire("signal",1) ButtonAlert.Click:Play() end) ButtonAttack.ProximityPrompt.Triggered:Connect(function() Events:Fire("signal",2) ButtonAttack.Click:Play() end)
--s.Pitch = 0.7
while s.Pitch<1.1 do s.Pitch=s.Pitch+0.012 s:Play() if s.Pitch>1.1 then s.Pitch=1.1 end wait(0.001) end
-- js https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt -- lua http://www.lua.org/manual/5.4/manual.html#pdf-utf8.codepoint
return function(str: string, index: number): number if typeof(index) ~= "number" then index = 1 end local strLen, invalidBytePosition = utf8.len(str) assert(strLen ~= nil, ("string `%s` has an invalid byte at position %s"):format(str, tostring(invalidBytePosition))) if index > strLen or index < 1 then return NaN end local offset = utf8.offset(str, index) local value = utf8.codepoint(str, offset, offset) if value == nil then return NaN end return value end
-- Basic settings
local MAXIMUM_DIFFERENT_ITEMS = 6 local plr = game.Players.LocalPlayer function getItemTable() -- Formulate and return a table of items local items = {} for _, i in pairs(script.Parent:GetChildren()) do if i.Name == "Item" then for _=1, i.Count.Value do table.insert(items, i.Item.Value.Name) end end end return items end function refreshOutlines() -- Create table of item names local items = {} for _, i in pairs(script.Parent:GetChildren()) do if i.Name == "Item" then table.insert(items, i.Item.Value.Name) end end -- Check size if #items > 0 then -- Create table of connected items local connectedItems = {} for _, i in pairs(game.ReplicatedStorage.Recipes:GetChildren()) do local okay = true for _, o in pairs(items) do if i.Ingredients:FindFirstChild(o) == nil then okay = false break end end if okay then for _, o in pairs(i.Ingredients:GetChildren()) do table.insert(connectedItems, o.Name) end end end -- Go through displayed items adding/removing outlines for _, i in pairs(script.Parent.Parent.Parent.Display.Container:GetChildren()) do if i.Name == "Item" then local okay = false for n, o in pairs(connectedItems) do if o == i.Item.Value.Name then okay = true table.remove(connectedItems, n) break end end i.BlueEdge.Visible = okay end end else -- Remove all outlines for _, i in pairs(script.Parent.Parent.Parent.Display.Container:GetChildren()) do if i.Name == "Item" then i.BlueEdge.Visible = false end end end end script.Parent.AddItem.OnInvoke = function(item) -- Check if there already is an entry for the item local existing = nil for _, i in pairs(script.Parent:GetChildren()) do if i.Name == "Item" then if i.Item.Value == item then existing = i break end end end if existing == nil then -- Check if the item count maximum has been reached local entryCount = #script.Parent:GetChildren() - 5 if entryCount >= MAXIMUM_DIFFERENT_ITEMS then return false end -- Create an item GUI element and add to container local itemGui = script.Parent.ItemTemplate:clone() itemGui.Name = "Item" itemGui.Item.Value = item itemGui.ItemIcon.Image = item.IconAsset.Value itemGui.ItemNameLabel.Text = item.Name itemGui.ItemNameLabel.TextColor3 = plr.PlayerScripts.Functions.GetRarityColor:Invoke(item.Rarity.Value) if item.Rarity.Value == "Immortal" or item.Rarity.Value == "Developer" then itemGui.ItemName.TextStrokeColor3 = Color3.fromRGB(255, 255, 255) end itemGui.Position = UDim2.new(0, (entryCount % 3) * 116 + 10, 0, math.floor(entryCount / 3) * 40 + 10) itemGui.Parent = script.Parent itemGui.Visible = true itemGui.InteractionHandler.Disabled = false -- Tell preview to refresh plr.PlayerGui.MainGui.Crafting.Preview.Refresh:Fire(getItemTable()) refreshOutlines() -- Return success return true else -- Increment count value existing.Count.Value = existing.Count.Value + 1 existing.ItemCount.Text = "x " .. existing.Count.Value -- Tell preview to refresh plr.PlayerGui.MainGui.Crafting.Preview.Refresh:Fire(getItemTable()) -- Return success return true end end script.Parent.RemoveItem.Event:connect(function(itemGui) -- Get item local item = itemGui.Item.Value -- Decrement count itemGui.Count.Value = itemGui.Count.Value - 1 -- Check if none left if itemGui.Count.Value <= 0 then -- Calculate gui rank to be used below local thisRank = (((itemGui.Position.Y.Offset - 10) / 40) * 3) + ((itemGui.Position.X.Offset - 10) / 116) -- Destroy the gui itemGui:destroy() -- Move each item over/up for _, i in pairs(script.Parent:GetChildren()) do if i.Name == "Item" then local rank = (((i.Position.Y.Offset - 10) / 40) * 3) + ((i.Position.X.Offset - 10) / 116) if rank > thisRank then i.Position = i.Position + UDim2.new(0, -116, 0, 0) if i.Position.X.Offset < 0 then i.Position = i.Position + UDim2.new(0, 348, 0, -40) end end end end elseif itemGui.Count.Value > 1 then -- Change text itemGui.ItemCount.Text = "x " .. itemGui.Count.Value else -- Change text itemGui.ItemCount.Text = "" end -- Add back to main display plr.PlayerGui.MainGui.Crafting.Display.Container.AddItem:Fire(item) -- Tell preview to refresh plr.PlayerGui.MainGui.Crafting.Preview.Refresh:Fire(getItemTable()) refreshOutlines() end) script.Parent.ClearItems.Event:connect(function() -- Destroy all items for _, i in pairs(script.Parent:GetChildren()) do if i.Name == "Item" then i:destroy() end end -- Tell preview to refresh plr.PlayerGui.MainGui.Crafting.Preview.Refresh:Fire({}) refreshOutlines() end)
-- Show where the red lines are going. You can change their colour and width in VisualizerCache
local SHOW_DEBUG_RAY_LINES: boolean = true
-- Types -- Stephen Leitnick -- December 20, 2021
export type Args = { n: number, [any]: any, } export type FnBind = (Instance, ...any) -> ...any export type ServerMiddlewareFn = (Instance, Args) -> (boolean, ...any) export type ServerMiddleware = {ServerMiddlewareFn} export type ClientMiddlewareFn = (Args) -> (boolean, ...any) export type ClientMiddleware = {ClientMiddlewareFn} return nil
------------------ ------------------
function waitForChild(parent, childName) while true do local child = parent:findFirstChild(childName) if child then return child end parent.ChildAdded:wait() end end local Figure = script.Parent local Torso = waitForChild(Figure, "Torso") local RightShoulder = waitForChild(Torso, "Right Shoulder") local LeftShoulder = waitForChild(Torso, "Left Shoulder") local RightHip = waitForChild(Torso, "Right Hip") local LeftHip = waitForChild(Torso, "Left Hip") local Neck = waitForChild(Torso, "Neck") local Humanoid = waitForChild(Figure, "Humanoid") local pose = "Standing" local toolAnim = "None" local toolAnimTime = 0 local isSeated = false function onRunning(speed) if isSeated then return end if speed>0 then pose = "Running" else pose = "Standing" end end function onDied() pose = "Dead" local parts = Figure:GetChildren() for i=1,#parts do if parts.className == "Part" then Debris.AddItem(parts[i], 60) end end end function onJumping() isSeated = false pose = "Jumping" end function onClimbing() pose = "Climbing" end function onGettingUp() pose = "GettingUp" end function onFreeFall() pose = "FreeFall" end function onDancing() pose = "Dancing" end function onFallingDown() pose = "FallingDown" end function onSeated() isSeated = true pose = "Seated" end function moveJump() RightShoulder.MaxVelocity = 0.5 LeftShoulder.MaxVelocity = 0.5 RightShoulder.DesiredAngle = 3.1 LeftShoulder.DesiredAngle = -3.1 RightHip.DesiredAngle = 0 LeftHip.DesiredAngle = 0 end function moveFreeFall() RightShoulder.MaxVelocity = 0.5 LeftShoulder.MaxVelocity = 0.5 RightShoulder.DesiredAngle = 3.1 LeftShoulder.DesiredAngle = -3.1 RightHip.DesiredAngle = 0 LeftHip.DesiredAngle = 0 end function moveFloat() RightShoulder.MaxVelocity = 0.5 LeftShoulder.MaxVelocity = 0.5 RightShoulder.DesiredAngle = -1.57 LeftShoulder.DesiredAngle = 1.57 RightHip.DesiredAngle = 1.57 LeftHip.DesiredAngle = -1.57 end function moveBoogy() while pose=="Boogy" do wait(.5) RightShoulder.MaxVelocity = 1 LeftShoulder.MaxVelocity = 1 RightShoulder.DesiredAngle = -3.14 LeftShoulder.DesiredAngle = 0 RightHip.DesiredAngle = 1.57 LeftHip.DesiredAngle = 0 wait(.5) RightShoulder.MaxVelocity = 1 LeftShoulder.MaxVelocity = 1 RightShoulder.DesiredAngle = 0 LeftShoulder.DesiredAngle = -3.14 RightHip.DesiredAngle = 0 LeftHip.DesiredAngle = 1.57 end end function moveZombie() RightShoulder.MaxVelocity = 0.5 LeftShoulder.MaxVelocity = 0.5 RightShoulder.DesiredAngle = -1.57 LeftShoulder.DesiredAngle = 1.57 RightHip.DesiredAngle = 0 LeftHip.DesiredAngle = 0 end function movePunch() script.Parent.Torso.Anchored=true RightShoulder.MaxVelocity = 60 LeftShoulder.MaxVelocity = 0.5 RightShoulder.DesiredAngle = -1.57 LeftShoulder.DesiredAngle = 0 RightHip.DesiredAngle = 0 LeftHip.DesiredAngle = 0 wait(1) script.Parent.Torso.Anchored=false pose="Standing" end function moveKick() RightShoulder.MaxVelocity = 0.5 LeftShoulder.MaxVelocity = 0.5 RightShoulder.DesiredAngle = 0 LeftShoulder.DesiredAngle = 0 RightHip.MaxVelocity = 40 RightHip.DesiredAngle = 1.57 LeftHip.DesiredAngle = 0 wait(1) pose="Standing" end function moveFly() RightShoulder.MaxVelocity = 0.5 LeftShoulder.MaxVelocity = 0.5 RightShoulder.DesiredAngle = 0 LeftShoulder.DesiredAngle = 0 RightHip.MaxVelocity = 40 RightHip.DesiredAngle = 1.57 LeftHip.DesiredAngle = 0 wait(1) pose="Standing" end function moveClimb() RightShoulder.MaxVelocity = 0.5 LeftShoulder.MaxVelocity = 0.5 RightShoulder.DesiredAngle = -3.14 LeftShoulder.DesiredAngle = 3.14 RightHip.DesiredAngle = 0 LeftHip.DesiredAngle = 0 end function moveSit() RightShoulder.MaxVelocity = 0.15 LeftShoulder.MaxVelocity = 0.15 RightShoulder.DesiredAngle = 3.14 /2 LeftShoulder.DesiredAngle = -3.14 /2 RightHip.DesiredAngle = 3.14 /2 LeftHip.DesiredAngle = -3.14 /2 end function getTool() kidTable = Figure:children() if (kidTable ~= nil) then numKids = #kidTable for i=1,numKids do if (kidTable[i].className == "Tool") then return kidTable[i] end end end return nil end function getToolAnim(tool) c = tool:children() for i=1,#c do if (c[i].Name == "toolanim" and c[i].className == "StringValue") then return c[i] end end return nil end function animateTool() if (toolAnim == "None") then RightShoulder.DesiredAngle = 1.57 return end if (toolAnim == "Slash") then RightShoulder.MaxVelocity = 0.5 RightShoulder.DesiredAngle = 0 return end if (toolAnim == "Lunge") then RightShoulder.MaxVelocity = 0.5 LeftShoulder.MaxVelocity = 0.5 RightHip.MaxVelocity = 0.5 LeftHip.MaxVelocity = 0.5 RightShoulder.DesiredAngle = -1.57 LeftShoulder.DesiredAngle = 1.0 RightHip.DesiredAngle = 1.57 LeftHip.DesiredAngle = 1.0 return end end function move(time) local amplitude local frequency if (pose == "Jumping") then moveJump() return end if (pose == "Zombie") then moveZombie() return end if (pose == "Boogy") then moveBoogy() return end if (pose == "Float") then moveFloat() return end if (pose == "Punch") then movePunch() return end if (pose == "Kick") then moveKick() return end if (pose == "Fly") then moveFly() return end if (pose == "FreeFall") then moveFreeFall() return end if (pose == "Climbing") then moveClimb() return end if (pose == "Seated") then moveSit() return end amplitude = 0.1 frequency = 1 RightShoulder.MaxVelocity = 0.15 LeftShoulder.MaxVelocity = 0.15 if (pose == "Running") then amplitude = 1 frequency = 9 elseif (pose == "Dancing") then amplitude = 2 frequency = 16 end desiredAngle = amplitude * math.sin(time*frequency) if pose~="Dancing" then RightShoulder.DesiredAngle = desiredAngle LeftShoulder.DesiredAngle = desiredAngle RightHip.DesiredAngle = -desiredAngle LeftHip.DesiredAngle = -desiredAngle else RightShoulder.DesiredAngle = desiredAngle LeftShoulder.DesiredAngle = desiredAngle RightHip.DesiredAngle = -desiredAngle LeftHip.DesiredAngle = -desiredAngle end local tool = getTool() if tool ~= nil then local animStringValueObject = getToolAnim(tool) if animStringValueObject ~= nil then toolAnim = animStringValueObject.Value -- message recieved, delete StringValue animStringValueObject.Parent = nil toolAnimTime = time - 4.3 end if time > toolAnimTime then toolAnimTime = 0 toolAnim = "None" end animateTool() else toolAnim = "None" toolAnimTime = 0 end end
-----<< TABLES >>-----
local ignoreTable = {tool, player.Character}
--// Processing
return function(Vargs, GetEnv) local env = GetEnv(nil, {script = script}) setfenv(1, env) local _G, game, script, getfenv, setfenv, workspace, getmetatable, setmetatable, loadstring, coroutine, rawequal, typeof, print, math, warn, error, pcall, xpcall, select, rawset, rawget, ipairs, pairs, next, Rect, Axes, os, time, Faces, unpack, string, Color3, newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor, NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint, NumberSequenceKeypoint, PhysicalProperties, Region3int16, Vector3int16, require, table, type, wait, Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay = _G, game, script, getfenv, setfenv, workspace, getmetatable, setmetatable, loadstring, coroutine, rawequal, typeof, print, math, warn, error, pcall, xpcall, select, rawset, rawget, ipairs, pairs, next, Rect, Axes, os, time, Faces, unpack, string, Color3, newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor, NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint, NumberSequenceKeypoint, PhysicalProperties, Region3int16, Vector3int16, require, table, type, wait, Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay local script = script local service = Vargs.Service local client = Vargs.Client local Anti, Core, Functions, Process, Remote, UI, Variables local function Init() UI = client.UI; Anti = client.Anti; Core = client.Core; Variables = client.Variables Functions = client.Functions; Process = client.Process; Remote = client.Remote; Process.Init = nil; end local function RunLast() --[[client = service.ReadOnly(client, { [client.Variables] = true; [client.Handlers] = true; G_API = true; G_Access = true; G_Access_Key = true; G_Access_Perms = true; Allowed_API_Calls = true; HelpButtonImage = true; Finish_Loading = true; RemoteEvent = true; ScriptCache = true; Returns = true; PendingReturns = true; EncodeCache = true; DecodeCache = true; Received = true; Sent = true; Service = true; Holder = true; GUIs = true; LastUpdate = true; RateLimits = true; Init = true; RunLast = true; RunAfterInit = true; RunAfterLoaded = true; RunAfterPlugins = true; }, true)--]] Process.RunLast = nil; end local function RunAfterLoaded(data) --// Events --service.NetworkClient.ChildRemoved:Connect(function() wait(30) client.Anti.Detected("crash", "Network client disconnected") end) --service.NetworkClient.ChildAdded:Connect(function() client.Anti.Detected("crash", "Network client reconnected?") end) service.Player.Chatted:Connect(service.EventTask("Event: ProcessChat", Process.Chat)) service.Player.CharacterRemoving:Connect(service.EventTask("Event: CharacterRemoving", Process.CharacterRemoving)) service.Player.CharacterAdded:Connect(service.Threads.NewEventTask("Event: CharacterAdded", Process.CharacterAdded)) service.LogService.MessageOut:Connect(Process.LogService) --service.Threads.NewEventTask("EVENT:MessageOut",client.Process.LogService,60)) service.ScriptContext.Error:Connect(Process.ErrorMessage) --service.Threads.NewEventTask("EVENT:ErrorMessage",client.Process.ErrorMessage,60)) --// Get RateLimits Process.RateLimits = Remote.Get("RateLimits") or Process.RateLimits; Process.RunAfterLoaded = nil; end getfenv().client = nil getfenv().service = nil getfenv().script = nil client.Process = { Init = Init; RunLast = RunLast; RunAfterLoaded = RunAfterLoaded; RateLimits = { --// Defaults; Will be updated with server data at client run Remote = 0.02; Command = 0.1; Chat = 0.1; RateLog = 10; }; Remote = function(data, com, ...) local args = {...} Remote.Received += 1 if type(com) == "string" then if com == client.DepsName.."GIVE_KEY" then if not Core.Key then log("~! Set remote key") Core.Key = args[1] log("~! Call Finish_Loading()") client.Finish_Loading() end elseif Core.Key then local comString = Remote.Decrypt(com,Core.Key) local command = (data.Mode == "Get" and Remote.Returnables[comString]) or Remote.Commands[comString] if command then --local ran,err = pcall(command, args) --task service.Threads.RunTask("REMOTE:"..comString,command,args) local rets = {service.TrackTask("Remote: ".. comString, command, args)} if not rets[1] then logError(rets[2]) else return {unpack(rets, 2)}; end end end end end; LogService = function(Message, Type) --service.FireEvent("Output", Message, Type) end; ErrorMessage = function(Message, Trace, Script) --service.FireEvent("ErrorMessage", Message, Trace, Script) if Message and Message ~= "nil" and Message ~= "" and (string.find(Message,":: Adonis ::") or string.find(Message,script.Name) or Script == script) then logError(tostring(Message).." - "..tostring(Trace)) end --if (Script == nil or (not Trace or Trace == "")) and not (Trace and string.find(Trace,"CoreGui.RobloxGui")) then --Anti.Detected("log","Scriptless/Traceless error found. Script: "..tostring(Script).." - Trace: "..tostring(Trace)) --end end; Chat = function(msg) --service.FireEvent("Chat",msg) if not service.Player or service.Player.Parent ~= service.Players then Remote.Fire("ProcessChat",msg) end end; CharacterAdded = function(...) service.Events.CharacterAdded:Fire(...) task.wait() UI.GetHolder() end; CharacterRemoving = function() if Variables.UIKeepAlive then for ind,g in client.GUIs do if g.Class == "ScreenGui" or g.Class == "GuiMain" or g.Class == "TextLabel" then if not (g.Object:IsA("ScreenGui") and not g.Object.ResetOnSpawn) and g.CanKeepAlive then g.KeepAlive = true g.KeepParent = g.Object.Parent g.Object.Parent = nil elseif not g.CanKeepAlive then pcall(g.Destroy, g) end end end end if Variables.GuiViewFolder then Variables.GuiViewFolder:Destroy() Variables.GuiViewFolder = nil end if Variables.ChatEnabled then service.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true) end if Variables.PlayerListEnabled then service.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true) end local textbox = service.UserInputService:GetFocusedTextBox() if textbox then textbox:ReleaseFocus() end service.Events.CharacterRemoving:Fire() end } end
---
local Paint = false script.Parent.MouseButton1Click:connect(function() Paint = not Paint handler:FireServer("Tawny",Paint) end)
--If necessary change the last word to:
--Signal1 --Signal1a --Signal2 --Signal2a
--[[* * A class that generates the CLI status of currently running tests * and also provides an ANSI escape sequence to remove status lines * from the terminal. ]]
export type Status = { onChange: (self: Status, callback: () -> ()) -> (), runStarted: (self: Status, aggregatedResults: AggregatedResult, options: ReporterOnStartOptions) -> (), runFinished: (self: Status) -> (), addTestCaseResult: (self: Status, test: Test, testCaseResult: TestCaseResult) -> (), testStarted: (self: Status, testPath: Config_Path, config: Config_ProjectConfig) -> (), testFinished: ( self: Status, _config: Config_ProjectConfig, testResult: TestResult, aggregatedResults: AggregatedResult ) -> (), get: (self: Status) -> Cache, } local Status = {} Status.__index = Status function Status.new(): Status local self = setmetatable({}, Status) self._cache = nil self._currentTests = CurrentTestList.new() self._currentTestCases = {} self._done = false self._emitScheduled = false self._estimatedTime = 0 self._showStatus = false return (self :: any) :: Status end function Status:onChange(callback: () -> ()): () self._callback = callback end function Status:runStarted(aggregatedResults: AggregatedResult, options: ReporterOnStartOptions): () self._estimatedTime = if Boolean.toJSBoolean(options) and Boolean.toJSBoolean(options.estimatedTime) then options.estimatedTime else 0 self._showStatus = if Boolean.toJSBoolean(options) then options.showStatus else options self._interval = setInterval(function() return self:_tick() end, 1000) self._aggregatedResults = aggregatedResults self:_debouncedEmit() end function Status:runFinished(): () self._done = true if Boolean.toJSBoolean(self._interval) then clearInterval(self._interval) end self:_emit() end function Status:addTestCaseResult(test: Test, testCaseResult: TestCaseResult): () table.insert(self._currentTestCases, { test = test, testCaseResult = testCaseResult }) if not Boolean.toJSBoolean(self._showStatus) then self:_emit() else self:_debouncedEmit() end end function Status:testStarted(testPath: Config_Path, config: Config_ProjectConfig): () self._currentTests:add(testPath, config) if not self._showStatus then self:_emit() else self:_debouncedEmit() end end function Status:testFinished( _config: Config_ProjectConfig, testResult: TestResult, aggregatedResults: AggregatedResult ): () local testFilePath = testResult.testFilePath self._aggregatedResults = aggregatedResults self._currentTests:delete(testFilePath) self._currentTestCases = Array.filter(self._currentTestCases, function(ref) local test = ref.test if _config ~= test.context.config then return true end return test.path ~= testFilePath end) self:_debouncedEmit() end function Status:get(): Cache if Boolean.toJSBoolean(self._cache) then return self._cache end if Boolean.toJSBoolean(self._done) then return { clear = "", content = "" } end local width = CONSOLE_WIDTH local content = "\n" Array.forEach(self._currentTests:get(), function(record) if Boolean.toJSBoolean(record) then local config, testPath = record.config, record.testPath local projectDisplayName = if Boolean.toJSBoolean(config.displayName) then tostring(printDisplayName(config)) .. " " else "" local prefix = RUNNING .. projectDisplayName -- ROBLOX deviation START: assert prefixLen is a valid number local prefixLen = stringLength(prefix) assert(prefixLen ~= nil) content ..= wrapAnsiString(prefix .. trimAndFormatPath(prefixLen, config, testPath, width), width) .. "\n" -- ROBLOX deviation END end end) if self._showStatus and Boolean.toJSBoolean(self._aggregatedResults) then content ..= "\n" .. tostring(getSummary(self._aggregatedResults, { currentTestCases = self._currentTestCases, estimatedTime = self._estimatedTime, roundTime = true, width = width, })) end local height = 0 local i = 0 -- ROBLOX deviation START - Check if utf8.len doesn't return nil because of invalid chars local contentLength = utf8.len(content) assert(contentLength ~= nil) while i < contentLength do -- ROBLOX deviation END if String.charCodeAt(content, i) == "\n" then height += 1 end i += 1 end -- ROBLOX deviation: We don't have an operation to actually clear console local clear = ("\n"):rep(height) self._cache = { clear = clear, content = content } return self._cache end function Status:_emit(): () self._cache = nil if Boolean.toJSBoolean(self._callback) then self:_callback() end end function Status:_debouncedEmit(): () if not Boolean.toJSBoolean(self._emitScheduled) then -- Perf optimization to avoid two separate renders When -- one test finishes and another test starts executing. self._emitScheduled = true setTimeout(function() self:_emit() self._emitScheduled = false end, 100) end end function Status:_tick(): () self:_debouncedEmit() end exports.default = Status return exports