prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------- -- STATE CHANGE HANDLERS
function onRunning(speed) if speed > 0.75 then local scale = 16.0 playAnimation("walk", 0.2, Humanoid) setAnimationSpeed(speed / scale) pose = "Running" else if emoteNames[currentAnim] == nil and not currentlyPlayingEmote 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
--white 1
bin.Blade.BrickColor = BrickColor.new("Institutional white") bin.Blade2.BrickColor = BrickColor.new("Institutional white") bin.Blade.White.Enabled=true colorbin.white.Value = true bin.Blade.Blue.Enabled=false colorbin.blue.Value = false bin.Blade.Green.Enabled=false colorbin.green.Value = false bin.Blade.Magenta.Enabled=false colorbin.magenta.Value = false 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
--[[Steering]]
Tune.SteerInner = 36 -- Inner wheel steering angle (in degrees) Tune.SteerOuter = 37 -- Outer wheel steering angle (in degrees) Tune.SteerSpeed = .05 -- Steering increment per tick (in degrees) Tune.ReturnSpeed = .1 -- Steering increment per tick (in degrees) Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS) Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent) Tune.MSteerExp = 1 -- Mouse steering exponential degree --Steer Gyro Tuning Tune.SteerD = 1000 -- Steering Dampening Tune.SteerMaxTorque = 50000 -- Steering Force Tune.SteerP = 90000 -- Steering Aggressiveness
--------------------------------------------------------------------------------
local Character = script.Parent local Player = game.Players:GetPlayerFromCharacter(Character) local Humanoid = Character:WaitForChild('Humanoid')
--[[ Used to set a handler for when the promise resolves, rejects, or is cancelled. Returns a new promise chained from this promise. ]]
function Promise.prototype:_finally(traceback, finallyHandler, onlyOk) if not onlyOk then self._unhandledRejection = false end -- Return a promise chained off of this promise return Promise._new(traceback, function(resolve, reject) local finallyCallback = resolve if finallyHandler then finallyCallback = createAdvancer( traceback, finallyHandler, resolve, reject ) end if onlyOk then local callback = finallyCallback finallyCallback = function(...) if self._status == Promise.Status.Rejected then return resolve(self) end return callback(...) end end if self._status == Promise.Status.Started then -- The promise is not settled, so queue this. table.insert(self._queuedFinally, finallyCallback) else -- The promise already settled or was cancelled, run the callback now. finallyCallback(self._status) end end, self) end function Promise.prototype:finally(finallyHandler) assert( finallyHandler == nil or type(finallyHandler) == "function", string.format(ERROR_NON_FUNCTION, "Promise:finally") ) return self:_finally(debug.traceback(nil, 2), finallyHandler) end
--[[Standardized Values: Don't touch unless needed]]
--[[ The Module ]]
-- local BaseCamera = {} BaseCamera.__index = BaseCamera function BaseCamera.new() local self = setmetatable({}, BaseCamera) -- So that derived classes have access to this self.FIRST_PERSON_DISTANCE_THRESHOLD = FIRST_PERSON_DISTANCE_THRESHOLD self.cameraType = nil self.cameraMovementMode = nil self.lastCameraTransform = nil self.lastUserPanCamera = tick() self.humanoidRootPart = nil self.humanoidCache = {} -- Subject and position on last update call self.lastSubject = nil self.lastSubjectPosition = Vector3.new(0, 5, 0) self.lastSubjectCFrame = CFrame.new(self.lastSubjectPosition) -- These subject distance members refer to the nominal camera-to-subject follow distance that the camera -- is trying to maintain, not the actual measured value. -- The default is updated when screen orientation or the min/max distances change, -- to be sure the default is always in range and appropriate for the orientation. self.defaultSubjectDistance = math.clamp(DEFAULT_DISTANCE, player.CameraMinZoomDistance, player.CameraMaxZoomDistance) self.currentSubjectDistance = math.clamp(DEFAULT_DISTANCE, player.CameraMinZoomDistance, player.CameraMaxZoomDistance) self.inFirstPerson = false self.inMouseLockedMode = false self.portraitMode = false self.isSmallTouchScreen = false -- Used by modules which want to reset the camera angle on respawn. self.resetCameraAngle = true self.enabled = false -- Input Event Connections self.PlayerGui = nil self.cameraChangedConn = nil self.viewportSizeChangedConn = nil -- VR Support self.shouldUseVRRotation = false self.VRRotationIntensityAvailable = false self.lastVRRotationIntensityCheckTime = 0 self.lastVRRotationTime = 0 self.vrRotateKeyCooldown = {} self.cameraTranslationConstraints = Vector3.new(1, 1, 1) self.humanoidJumpOrigin = nil self.trackingHumanoid = nil self.cameraFrozen = false self.subjectStateChangedConn = nil self.gamepadZoomPressConnection = nil -- Mouse locked formerly known as shift lock mode self.mouseLockOffset = ZERO_VECTOR3 -- Initialization things used to always execute at game load time, but now these camera modules are instantiated -- when needed, so the code here may run well after the start of the game if player.Character then self:OnCharacterAdded(player.Character) end player.CharacterAdded:Connect(function(char) self:OnCharacterAdded(char) end) if self.cameraChangedConn then self.cameraChangedConn:Disconnect() end self.cameraChangedConn = workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function() self:OnCurrentCameraChanged() end) self:OnCurrentCameraChanged() if self.playerCameraModeChangeConn then self.playerCameraModeChangeConn:Disconnect() end self.playerCameraModeChangeConn = player:GetPropertyChangedSignal("CameraMode"):Connect(function() self:OnPlayerCameraPropertyChange() end) if self.minDistanceChangeConn then self.minDistanceChangeConn:Disconnect() end self.minDistanceChangeConn = player:GetPropertyChangedSignal("CameraMinZoomDistance"):Connect(function() self:OnPlayerCameraPropertyChange() end) if self.maxDistanceChangeConn then self.maxDistanceChangeConn:Disconnect() end self.maxDistanceChangeConn = player:GetPropertyChangedSignal("CameraMaxZoomDistance"):Connect(function() self:OnPlayerCameraPropertyChange() end) if self.playerDevTouchMoveModeChangeConn then self.playerDevTouchMoveModeChangeConn:Disconnect() end self.playerDevTouchMoveModeChangeConn = player:GetPropertyChangedSignal("DevTouchMovementMode"):Connect(function() self:OnDevTouchMovementModeChanged() end) self:OnDevTouchMovementModeChanged() -- Init if self.gameSettingsTouchMoveMoveChangeConn then self.gameSettingsTouchMoveMoveChangeConn:Disconnect() end self.gameSettingsTouchMoveMoveChangeConn = UserGameSettings:GetPropertyChangedSignal("TouchMovementMode"):Connect(function() self:OnGameSettingsTouchMovementModeChanged() end) self:OnGameSettingsTouchMovementModeChanged() -- Init UserGameSettings:SetCameraYInvertVisible() UserGameSettings:SetGamepadCameraSensitivityVisible() self.hasGameLoaded = game:IsLoaded() if not self.hasGameLoaded then self.gameLoadedConn = game.Loaded:Connect(function() self.hasGameLoaded = true self.gameLoadedConn:Disconnect() self.gameLoadedConn = nil end) end self:OnPlayerCameraPropertyChange() return self end function BaseCamera:GetModuleName() return "BaseCamera" end function BaseCamera:OnCharacterAdded(char) self.resetCameraAngle = self.resetCameraAngle or self:GetEnabled() self.humanoidRootPart = nil if UserInputService.TouchEnabled then self.PlayerGui = player:WaitForChild("PlayerGui") for _, child in ipairs(char:GetChildren()) do if child:IsA("Tool") then self.isAToolEquipped = true end end char.ChildAdded:Connect(function(child) if child:IsA("Tool") then self.isAToolEquipped = true end end) char.ChildRemoved:Connect(function(child) if child:IsA("Tool") then self.isAToolEquipped = false end end) end end function BaseCamera:GetHumanoidRootPart() if not self.humanoidRootPart then if player.Character then local humanoid = player.Character:FindFirstChildOfClass("Humanoid") if humanoid then self.humanoidRootPart = humanoid.RootPart end end end return self.humanoidRootPart end function BaseCamera:GetBodyPartToFollow(humanoid, isDead) -- If the humanoid is dead, prefer the head part if one still exists as a sibling of the humanoid if humanoid:GetState() == Enum.HumanoidStateType.Dead then local character = humanoid.Parent if character and character:IsA("Model") then return character:FindFirstChild("Head") or humanoid.RootPart end end return humanoid.RootPart end function BaseCamera:GetSubjectCFrame() local result = self.lastSubjectCFrame local camera = workspace.CurrentCamera local cameraSubject = camera and camera.CameraSubject if not cameraSubject then return result end if cameraSubject:IsA("Humanoid") then local humanoid = cameraSubject local humanoidIsDead = humanoid:GetState() == Enum.HumanoidStateType.Dead if VRService.VREnabled and humanoidIsDead and humanoid == self.lastSubject then result = self.lastSubjectCFrame else local bodyPartToFollow = humanoid.RootPart -- If the humanoid is dead, prefer their head part as a follow target, if it exists if humanoidIsDead then if humanoid.Parent and humanoid.Parent:IsA("Model") then bodyPartToFollow = humanoid.Parent:FindFirstChild("Head") or bodyPartToFollow end end if bodyPartToFollow and bodyPartToFollow:IsA("BasePart") then local heightOffset if humanoid.RigType == Enum.HumanoidRigType.R15 then if humanoid.AutomaticScalingEnabled then heightOffset = R15_HEAD_OFFSET local rootPart = humanoid.RootPart if bodyPartToFollow == rootPart then local rootPartSizeOffset = (rootPart.Size.Y - HUMANOID_ROOT_PART_SIZE.Y)/2 heightOffset = heightOffset + Vector3.new(0, rootPartSizeOffset, 0) end else heightOffset = R15_HEAD_OFFSET_NO_SCALING end else heightOffset = HEAD_OFFSET end if humanoidIsDead then heightOffset = ZERO_VECTOR3 end result = bodyPartToFollow.CFrame*CFrame.new(heightOffset + humanoid.CameraOffset) end end elseif cameraSubject:IsA("BasePart") then result = cameraSubject.CFrame elseif cameraSubject:IsA("Model") then -- Model subjects are expected to have a PrimaryPart to determine orientation if cameraSubject.PrimaryPart then result = cameraSubject:GetPrimaryPartCFrame() else result = CFrame.new() end end if result then self.lastSubjectCFrame = result end return result end function BaseCamera:GetSubjectVelocity() local camera = workspace.CurrentCamera local cameraSubject = camera and camera.CameraSubject if not cameraSubject then return ZERO_VECTOR3 end if cameraSubject:IsA("BasePart") then return cameraSubject.Velocity elseif cameraSubject:IsA("Humanoid") then local rootPart = cameraSubject.RootPart if rootPart then return rootPart.Velocity end elseif cameraSubject:IsA("Model") then local primaryPart = cameraSubject.PrimaryPart if primaryPart then return primaryPart.Velocity end end return ZERO_VECTOR3 end function BaseCamera:GetSubjectRotVelocity() local camera = workspace.CurrentCamera local cameraSubject = camera and camera.CameraSubject if not cameraSubject then return ZERO_VECTOR3 end if cameraSubject:IsA("BasePart") then return cameraSubject.RotVelocity elseif cameraSubject:IsA("Humanoid") then local rootPart = cameraSubject.RootPart if rootPart then return rootPart.RotVelocity end elseif cameraSubject:IsA("Model") then local primaryPart = cameraSubject.PrimaryPart if primaryPart then return primaryPart.RotVelocity end end return ZERO_VECTOR3 end function BaseCamera:StepZoom() local zoom = self.currentSubjectDistance local zoomDelta = CameraInput.getZoomDelta() if math.abs(zoomDelta) > 0 then local newZoom if zoomDelta > 0 then newZoom = zoom + zoomDelta*(1 + zoom*ZOOM_SENSITIVITY_CURVATURE) newZoom = math.max(newZoom, self.FIRST_PERSON_DISTANCE_THRESHOLD) else newZoom = (zoom + zoomDelta)/(1 - zoomDelta*ZOOM_SENSITIVITY_CURVATURE) newZoom = math.max(newZoom, FIRST_PERSON_DISTANCE_MIN) end if newZoom < self.FIRST_PERSON_DISTANCE_THRESHOLD then newZoom = FIRST_PERSON_DISTANCE_MIN end self:SetCameraToSubjectDistance(newZoom) end return ZoomController.GetZoomRadius() end function BaseCamera:GetSubjectPosition() local result = self.lastSubjectPosition local camera = game.Workspace.CurrentCamera local cameraSubject = camera and camera.CameraSubject if cameraSubject then if cameraSubject:IsA("Humanoid") then local humanoid = cameraSubject local humanoidIsDead = humanoid:GetState() == Enum.HumanoidStateType.Dead if VRService.VREnabled and humanoidIsDead and humanoid == self.lastSubject then result = self.lastSubjectPosition else local bodyPartToFollow = humanoid.RootPart -- If the humanoid is dead, prefer their head part as a follow target, if it exists if humanoidIsDead then if humanoid.Parent and humanoid.Parent:IsA("Model") then bodyPartToFollow = humanoid.Parent:FindFirstChild("Head") or bodyPartToFollow end end if bodyPartToFollow and bodyPartToFollow:IsA("BasePart") then local heightOffset if humanoid.RigType == Enum.HumanoidRigType.R15 then if humanoid.AutomaticScalingEnabled then heightOffset = R15_HEAD_OFFSET if bodyPartToFollow == humanoid.RootPart then local rootPartSizeOffset = (humanoid.RootPart.Size.Y/2) - (HUMANOID_ROOT_PART_SIZE.Y/2) heightOffset = heightOffset + Vector3.new(0, rootPartSizeOffset, 0) end else heightOffset = R15_HEAD_OFFSET_NO_SCALING end else heightOffset = HEAD_OFFSET end if humanoidIsDead then heightOffset = ZERO_VECTOR3 end result = bodyPartToFollow.CFrame.p + bodyPartToFollow.CFrame:vectorToWorldSpace(heightOffset + humanoid.CameraOffset) end end elseif cameraSubject:IsA("VehicleSeat") then local offset = SEAT_OFFSET if VRService.VREnabled then offset = VR_SEAT_OFFSET end result = cameraSubject.CFrame.p + cameraSubject.CFrame:vectorToWorldSpace(offset) elseif cameraSubject:IsA("SkateboardPlatform") then result = cameraSubject.CFrame.p + SEAT_OFFSET elseif cameraSubject:IsA("BasePart") then result = cameraSubject.CFrame.p elseif cameraSubject:IsA("Model") then if cameraSubject.PrimaryPart then result = cameraSubject:GetPrimaryPartCFrame().p else result = cameraSubject:GetModelCFrame().p end end else -- cameraSubject is nil -- Note: Previous RootCamera did not have this else case and let self.lastSubject and self.lastSubjectPosition -- both get set to nil in the case of cameraSubject being nil. This function now exits here to preserve the -- last set valid values for these, as nil values are not handled cases return end self.lastSubject = cameraSubject self.lastSubjectPosition = result return result end function BaseCamera:UpdateDefaultSubjectDistance() if self.portraitMode then self.defaultSubjectDistance = math.clamp(PORTRAIT_DEFAULT_DISTANCE, player.CameraMinZoomDistance, player.CameraMaxZoomDistance) else self.defaultSubjectDistance = math.clamp(DEFAULT_DISTANCE, player.CameraMinZoomDistance, player.CameraMaxZoomDistance) end end function BaseCamera:OnViewportSizeChanged() local camera = game.Workspace.CurrentCamera local size = camera.ViewportSize self.portraitMode = size.X < size.Y self.isSmallTouchScreen = UserInputService.TouchEnabled and (size.Y < 500 or size.X < 700) self:UpdateDefaultSubjectDistance() end
--Differential Settings
Tune.FDiffSlipThres = 50 -- 1 - 100% (Max threshold of applying full lock determined by deviation from avg speed) Tune.FDiffLockThres = 50 -- 0 - 100% (0 - Bias toward slower wheel, 100 - Bias toward faster wheel) Tune.RDiffSlipThres = 50 -- 1 - 100% Tune.RDiffLockThres = 50 -- 0 - 100% Tune.CDiffSlipThres = 50 -- 1 - 100% [AWD Only] Tune.CDiffLockThres = 50 -- 0 - 100% [AWD Only]
--// Functions
function UpdateTag(plr) if plr == L_1_ or not plr.Character or not plr.Character:FindFirstChild("TeamTagUI") then return; end; local Tag = plr.Character:FindFirstChild("TeamTagUI"); if plr.Team == L_1_.Team then Tag.Enabled = true; if plr.Character:FindFirstChild("ACS_Client") and plr.Character.ACS_Client:FindFirstChild("FireTeam") and plr.Character.ACS_Client.FireTeam.SquadName.Value ~= "" then Tag.Frame.Icon.ImageColor3 = plr.Character.ACS_Client.FireTeam.SquadColor.Value; else Tag.Frame.Icon.ImageColor3 = Color3.fromRGB(255,255,255); end; return; end; Tag.Enabled = false; return; end
--Made by Luckymaxer
Functions = {} Debris = game:GetService("Debris") RbxUtility = LoadLibrary("RbxUtility") Create = RbxUtility.Create function Functions.Clamp(Number, Min, Max) return math.max(math.min(Max, Number), Min) end function Functions.GetPercentage(Start, End, Number) return (((Number - Start) / (End - Start)) * 100) end function Functions.Round(Number, RoundDecimal) local WholeNumber, Decimal = math.modf(Number) return ((Decimal >= RoundDecimal and math.ceil(Number)) or (Decimal < RoundDecimal and math.floor(Number))) end function Functions.CheckTableForInstance(Table, Instance) for i, v in pairs(Table) do if v == Instance then return true end end return false end function Functions.CheckTableForString(Table, String) for i, v in pairs(Table) do if string.lower(v) == string.lower(String) then return true end end return false end function Functions.CheckIntangible(Hit) local ProjectileNames = {"Water", "Arrow", "Projectile", "Effect", "Rail", "Laser", "Bullet"} if Hit and Hit.Parent then if ((not Hit.CanCollide or Functions.CheckTableForString(ProjectileNames, Hit.Name)) and not Hit.Parent:FindFirstChild("Humanoid")) then return true end end return false end function Functions.CastRay(StartPos, Vec, Length, Ignore, DelayIfHit) local Ignore = ((type(Ignore) == "table" and Ignore) or {Ignore}) local RayHit, RayPos, RayNormal = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(StartPos, Vec * Length), Ignore) if RayHit and Functions.CheckIntangible(RayHit) then if DelayIfHit then wait() end RayHit, RayPos, RayNormal = Functions.CastRay((RayPos + (Vec * 0.01)), Vec, (Length - ((StartPos - RayPos).magnitude)), Ignore, DelayIfHit) end return RayHit, RayPos, RayNormal end function Functions.TagHumanoid(humanoid, player) local Creator_Tag = Create("ObjectValue"){ Name = "creator", Value = player, } Debris:AddItem(Creator_Tag, 2) Creator_Tag.Parent = humanoid end function Functions.UntagHumanoid(humanoid) for i, v in pairs(humanoid:GetChildren()) do if v:IsA("ObjectValue") and v.Name == "creator" then v:Destroy() end end end function Functions.IsTeamMate(Player1, Player2) return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor) end return Functions
--animations --->> --507771019 roblox dance,3695333486 hype dance, 3333499508 monkey, 3303391864 around town, 4212455378 dorky, 4049037604 line dance, 3333136415 side to side, 4265725525 baby dance, 3338025566 robot dance, 3994127840 celebrate, 3576686446 wave, 4841405708 --copy and past the id into idle --// Wonuf
local Model = script.Parent local Config = Model.Configuration local userId = Config.userId.Value local Loader if Config.AutoUpdateLoader.Value then Loader = require(2849224151) -- The auto updating module, free to take else Loader = require(script.MainModule) end local Track = Model.Humanoid:LoadAnimation(script.Idle) Track:Play()
--[[ Public API ]]
-- function Thumbstick:Enable() ThumbstickFrame.Visible = true end function Thumbstick:Disable() ThumbstickFrame.Visible = false OnTouchEnded() end function Thumbstick:Create(parentFrame) if ThumbstickFrame then ThumbstickFrame:Destroy() ThumbstickFrame = nil if OnTouchMovedCn then OnTouchMovedCn:disconnect() OnTouchMovedCn = nil end if OnTouchEndedCn then OnTouchEndedCn:disconnect() OnTouchEndedCn = nil end end local isSmallScreen = parentFrame.AbsoluteSize.y <= 500 local thumbstickSize = isSmallScreen and 70 or 120 local position = isSmallScreen and UDim2.new(0, (thumbstickSize/2) - 10, 1, -thumbstickSize - 20) or UDim2.new(0, thumbstickSize/2, 1, -thumbstickSize * 1.75) ThumbstickFrame = Instance.new('Frame') ThumbstickFrame.Name = "ThumbstickFrame" ThumbstickFrame.Active = true ThumbstickFrame.Visible = false ThumbstickFrame.Size = UDim2.new(0, thumbstickSize, 0, thumbstickSize) ThumbstickFrame.Position = position ThumbstickFrame.BackgroundTransparency = 1 local outerImage = Instance.new('ImageLabel') outerImage.Name = "OuterImage" outerImage.Image = TOUCH_CONTROL_SHEET outerImage.ImageRectOffset = Vector2.new() outerImage.ImageRectSize = Vector2.new(220, 220) outerImage.BackgroundTransparency = 1 outerImage.Size = UDim2.new(0, thumbstickSize, 0, thumbstickSize) outerImage.Position = UDim2.new(0, 0, 0, 0) outerImage.Parent = ThumbstickFrame StickImage = Instance.new('ImageLabel') StickImage.Name = "StickImage" StickImage.Image = TOUCH_CONTROL_SHEET StickImage.ImageRectOffset = Vector2.new(220, 0) StickImage.ImageRectSize = Vector2.new(111, 111) StickImage.BackgroundTransparency = 1 StickImage.Size = UDim2.new(0, thumbstickSize/2, 0, thumbstickSize/2) StickImage.Position = UDim2.new(0, thumbstickSize/2 - thumbstickSize/4, 0, thumbstickSize/2 - thumbstickSize/4) StickImage.ZIndex = 2 StickImage.Parent = ThumbstickFrame local centerPosition = nil local deadZone = 0.05 local function doMove(direction) local inputAxis = direction / (thumbstickSize/2) -- Scaled Radial Dead Zone local inputAxisMagnitude = inputAxis.magnitude if inputAxisMagnitude < deadZone then inputAxis = Vector3.new() else inputAxis = inputAxis.unit * ((inputAxisMagnitude - deadZone) / (1 - deadZone)) -- NOTE: Making inputAxis a unit vector will cause the player to instantly go max speed -- must check for zero length vector is using unit inputAxis = Vector3.new(inputAxis.x, 0, inputAxis.y) end local humanoid = getHumanoid() if humanoid then humanoid:Move(inputAxis, true) end end local function moveStick(pos) local relativePosition = Vector2.new(pos.x - centerPosition.x, pos.y - centerPosition.y) local length = relativePosition.magnitude local maxLength = ThumbstickFrame.AbsoluteSize.x/2 if IsFollowStick and length > maxLength then local offset = relativePosition.unit * maxLength ThumbstickFrame.Position = UDim2.new( 0, pos.x - ThumbstickFrame.AbsoluteSize.x/2 - offset.x, 0, pos.y - ThumbstickFrame.AbsoluteSize.y/2 - offset.y) else length = math.min(length, maxLength) relativePosition = relativePosition.unit * length end StickImage.Position = UDim2.new(0, relativePosition.x + StickImage.AbsoluteSize.x/2, 0, relativePosition.y + StickImage.AbsoluteSize.y/2) end -- input connections ThumbstickFrame.InputBegan:connect(function(inputObject) if MoveTouchObject or inputObject.UserInputType ~= Enum.UserInputType.Touch then return end MoveTouchObject = inputObject ThumbstickFrame.Position = UDim2.new(0, inputObject.Position.x - ThumbstickFrame.Size.X.Offset/2, 0, inputObject.Position.y - ThumbstickFrame.Size.Y.Offset/2) centerPosition = Vector2.new(ThumbstickFrame.AbsolutePosition.x + ThumbstickFrame.AbsoluteSize.x/2, ThumbstickFrame.AbsolutePosition.y + ThumbstickFrame.AbsoluteSize.y/2) local direction = Vector2.new(inputObject.Position.x - centerPosition.x, inputObject.Position.y - centerPosition.y) moveStick(inputObject.Position) end) OnTouchMovedCn = UserInputService.TouchMoved:connect(function(inputObject, isProcessed) if inputObject == MoveTouchObject then centerPosition = Vector2.new(ThumbstickFrame.AbsolutePosition.x + ThumbstickFrame.AbsoluteSize.x/2, ThumbstickFrame.AbsolutePosition.y + ThumbstickFrame.AbsoluteSize.y/2) local direction = Vector2.new(inputObject.Position.x - centerPosition.x, inputObject.Position.y - centerPosition.y) doMove(direction) moveStick(inputObject.Position) end end) OnTouchEnded = function() ThumbstickFrame.Position = position StickImage.Position = UDim2.new(0, ThumbstickFrame.Size.X.Offset/2 - thumbstickSize/4, 0, ThumbstickFrame.Size.Y.Offset/2 - thumbstickSize/4) MoveTouchObject = nil local humanoid = getHumanoid() if humanoid then humanoid:Move(Vector3.new(0, 0, 0), true) end end OnTouchEndedCn = UserInputService.TouchEnded:connect(function(inputObject, isProcessed) if inputObject == MoveTouchObject then OnTouchEnded() end end) ThumbstickFrame.Parent = parentFrame end return Thumbstick
-- -- local targetOffsetVector = (lastTargetPos - target) -- if targetOffsetVector.magnitude < math.huge then -- targetOffsetVector = (lastTargetPos - target) * Vector3.new(1,0,1) -- end
if targetOffset > TargetOffsetMax then --if targetOffsetVector.magnitude > TargetOffsetMax then --print("moveto") local startPoint = character.Torso.Position local humanoidState = character.Humanoid:GetState() if humanoidState == Enum.HumanoidStateType.Jumping or humanoidState == Enum.HumanoidStateType.Freefall then --print("this") local ray = Ray.new(character.Torso.Position, Vector3.new(0, -100, 0)) local hitPart, hitPoint = game.Workspace:FindPartOnRay(ray, character) if hitPart then startPoint = hitPoint end end --print("making new path") local newTarget = target local ray = Ray.new(target + Vector3.new(0,-3,0), Vector3.new(0, -100, 0)) local hitPart, hitPoint = game.Workspace:FindPartOnRay(ray, character) if hitPoint then if (hitPoint - target).magnitude > 4 then newTarget = newTarget * Vector3.new(1,0,1) + Vector3.new(0,3,0) end end --local newTarget = Vector3.new(1,0,1) * target + Vector3.new(0, 2, 0) path = PathfindingService:ComputeSmoothPathAsync(startPoint, newTarget, 500) if path.Status ~= Enum.PathStatus.Success then --print(tostring(path.Status)) end --path = PathfindingService:ComputeRawPathAsync(startPoint, target, 500)
--Shutdown
car.DriveSeat.ChildRemoved:connect(function(child) if child.Name=="SeatWeld" and child:IsA("Weld") then script.Parent:Destroy() end end)
--// # key, Takedown
mouse.KeyDown:connect(function(key) if key=="v" then veh.Lightbar.middle.Beep:Play() veh.Lightbar.Remotes.TakedownEvent:FireServer(true) end end)
--[[ Listens for user input ]]
function UserInput.init() UserInputService.InputBegan:Connect( function(inputObject, gameProcessedEvent) if gameProcessedEvent then return end local action = getActionFromInput(inputObject) if action == "Forwards" then throttle = 1 elseif action == "Backwards" then throttle = -1 elseif action == "Left" then steer = -1 elseif action == "Right" then steer = 1 elseif action == "Boost" then if FlagEnableBoosts then ClientVehicleBoosts.requestBoost() end end end ) UserInputService.InputEnded:Connect( function(inputObject, gameProcessedEvent) if gameProcessedEvent then return end local action = getActionFromInput(inputObject) if action == "Forwards" or action == "Backwards" then throttle = isActionHeld("Forwards") and 1 or isActionHeld("Backwards") and -1 or 0 elseif action == "Left" or action == "Right" then steer = isActionHeld("Right") and 1 or isActionHeld("Left") and -1 or 0 end end ) end
--Vars
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local UserInputService = game:GetService("UserInputService") local cam = workspace.CurrentCamera local car = script.Parent.Car.Value local _Tune = require(car["A-Chassis Tune"]) local _IsOn = _Tune.AutoStart if _Tune.AutoStart then script.Parent.IsOn.Value=true end local _GSteerT=0 local _GSteerC=0 local _GThrot=0 local _GBrake=0 local _ClutchOn = true local _RPM = 0 local _HP = 0 local _OutTorque = 0 local _CGear = 0 local _PGear = _CGear local _TMode = _Tune.TransModes[1] local _MSteer = false local _SteerL = false local _SteerR = false local _PBrake = false local _TCS = true local _TCSActive = false local FlipWait=tick() local FlipDB=false local _InControls = false
-- Number of bullets in a clip
local ClipSize = 12
-- Mapping from movement mode and lastInputType enum values to control modules to avoid huge if elseif switching
local movementEnumToModuleMap = { [Enum.TouchMovementMode.DPad] = DynamicThumbstick, [Enum.DevTouchMovementMode.DPad] = DynamicThumbstick, [Enum.TouchMovementMode.Thumbpad] = DynamicThumbstick, [Enum.DevTouchMovementMode.Thumbpad] = DynamicThumbstick, [Enum.TouchMovementMode.Thumbstick] = TouchThumbstick, [Enum.DevTouchMovementMode.Thumbstick] = TouchThumbstick, [Enum.TouchMovementMode.DynamicThumbstick] = DynamicThumbstick, [Enum.DevTouchMovementMode.DynamicThumbstick] = DynamicThumbstick, [Enum.TouchMovementMode.ClickToMove] = ClickToMove, [Enum.DevTouchMovementMode.ClickToMove] = ClickToMove, -- Current default [Enum.TouchMovementMode.Default] = DynamicThumbstick, [Enum.ComputerMovementMode.Default] = Keyboard, [Enum.ComputerMovementMode.KeyboardMouse] = Keyboard, [Enum.DevComputerMovementMode.KeyboardMouse] = Keyboard, [Enum.DevComputerMovementMode.Scriptable] = nil, [Enum.ComputerMovementMode.ClickToMove] = ClickToMove, [Enum.DevComputerMovementMode.ClickToMove] = ClickToMove, }
-- Implements Javascript's `Map.prototype.forEach` as defined below -- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/forEach
function Set:forEach<T>(callback: callbackFn<T> | callbackFnWithThisArg<T>, thisArg: Object?): () if typeof(callback) ~= "function" then error("callback is not a function") end return Array.forEach(self._array, function(value: T) if thisArg ~= nil then (callback :: callbackFnWithThisArg<T>)(thisArg, value, value, self) else (callback :: callbackFn<T>)(value, value, self) end end) end function Set:has(value): boolean return self._map[value] ~= nil end function Set:ipairs() return ipairs(self._array) end return Set
--BrickColor codes: http://wiki.roblox.com/index.php?title=BrickColor_codes
script.Parent.Transparency=0 --If you want the command to activate after the --button is pressed, put the commands here instead. end script.Parent.ClickDetector.MouseClick:connect(onClicked)
-- Game Services
local Configurations = require(game.ServerStorage.Configurations)
-------------------------
function DoorClose() if Shaft00.MetalDoor.CanCollide == false then Shaft00.MetalDoor.CanCollide = true while Shaft00.MetalDoor.Transparency > 0.0 do Shaft00.MetalDoor.Transparency = Shaft00.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, 20, 0) --Change 10 to change the speed. end if Shaft01.MetalDoor.CanCollide == false then Shaft01.MetalDoor.CanCollide = true while Shaft01.MetalDoor.Transparency > 0.0 do Shaft01.MetalDoor.Transparency = Shaft01.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, 20, 0) end if Shaft02.MetalDoor.CanCollide == false then Shaft02.MetalDoor.CanCollide = true while Shaft02.MetalDoor.Transparency > 0.0 do Shaft02.MetalDoor.Transparency = Shaft02.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, 20, 0) end if Shaft03.MetalDoor.CanCollide == false then Shaft03.MetalDoor.CanCollide = true while Shaft03.MetalDoor.Transparency > 0.0 do Shaft03.MetalDoor.Transparency = Shaft03.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, 20, 0) end if Shaft04.MetalDoor.CanCollide == false then Shaft04.MetalDoor.CanCollide = true while Shaft04.MetalDoor.Transparency > 0.0 do Shaft04.MetalDoor.Transparency = Shaft04.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, 20, 0) end if Shaft05.MetalDoor.CanCollide == false then Shaft05.MetalDoor.CanCollide = true while Shaft05.MetalDoor.Transparency > 0.0 do Shaft05.MetalDoor.Transparency = Shaft05.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, 20, 0) end if Shaft06.MetalDoor.CanCollide == false then Shaft06.MetalDoor.CanCollide = true while Shaft06.MetalDoor.Transparency > 0.0 do Shaft06.MetalDoor.Transparency = Shaft06.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, 20, 0) end if Shaft07.MetalDoor.CanCollide == false then Shaft07.MetalDoor.CanCollide = true while Shaft07.MetalDoor.Transparency > 0.0 do Shaft07.MetalDoor.Transparency = Shaft07.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, 20, 0) end if Shaft08.MetalDoor.CanCollide == false then Shaft08.MetalDoor.CanCollide = true while Shaft08.MetalDoor.Transparency > 0.0 do Shaft08.MetalDoor.Transparency = Shaft08.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, 20, 0) end if Shaft09.MetalDoor.CanCollide == false then Shaft09.MetalDoor.CanCollide = true while Shaft09.MetalDoor.Transparency > 0.0 do Shaft09.MetalDoor.Transparency = Shaft09.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, 20, 0) end if Shaft10.MetalDoor.CanCollide == false then Shaft10.MetalDoor.CanCollide = true while Shaft10.MetalDoor.Transparency > 0.0 do Shaft10.MetalDoor.Transparency = Shaft10.MetalDoor.Transparency - .1 wait(0.000001) end end if Shaft11.MetalDoor.CanCollide == false then Shaft11.MetalDoor.CanCollide = true while Shaft11.MetalDoor.Transparency > 0.0 do Shaft11.MetalDoor.Transparency = Shaft11.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, -20, 0) end if Shaft12.MetalDoor.CanCollide == false then Shaft12.MetalDoor.CanCollide = true while Shaft12.MetalDoor.Transparency > 0.0 do Shaft12.MetalDoor.Transparency = Shaft12.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, -20, 0) end if Shaft13.MetalDoor.CanCollide == false then Shaft13.MetalDoor.CanCollide = true while Shaft13.MetalDoor.Transparency > 0.0 do Shaft13.MetalDoor.Transparency = Shaft13.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, -20, 0) end end function onClicked() DoorClose() end script.Parent.MouseButton1Click:connect(onClicked) script.Parent.MouseButton1Click:connect(function() if clicker == true then clicker = false else return end end) script.Parent.MouseButton1Click:connect(function() Car.Touched:connect(function(otherPart) if otherPart == Elevator.Floors.F11 then StopE() DoorOpen() end end)end) function StopE() Car.BodyVelocity.velocity = Vector3.new(0, 0, 0) Car.BodyPosition.position = Elevator.Floors.F11.Position clicker = true end function DoorOpen() while Shaft10.MetalDoor.Transparency < 1.0 do Shaft10.MetalDoor.Transparency = Shaft10.MetalDoor.Transparency + .1 wait(0.000001) end Shaft10.MetalDoor.CanCollide = false end
--[[Status Vars]]
local _IsOn = _Tune.AutoStart if _Tune.AutoStart then car.DriveSeat.IsOn.Value=true end local _GSteerT=0 local _GSteerC=0 local _GThrot=0 local _GBrake=0 local _ClutchOn = true local _ClPressing = false local _RPM = 0 local _HP = 0 local _OutTorque = 0 local _CGear = 0 local _TMode = _Tune.TransModes[1] local _MSteer = false local _SteerL = false local _SteerR = false local _PBrake = false local _TCS = _Tune.TCSEnabled local _TCSActive = false local _ABS = _Tune.ABSEnabled local _ABSActive = false local FlipWait=tick() local FlipDB=false local _InControls = false
--[Tip] --More modes with smaller speed increments makes for a more precise and smooth ride.
-- Slider sizes (Normal)
local normalSize = UDim2.new(0.155, 0, 1, 0)
-- Load Roblox Camera Controller Modules
local ClassicCamera = require(script:WaitForChild("ClassicCamera")) local OrbitalCamera = require(script:WaitForChild("OrbitalCamera")) local LegacyCamera = require(script:WaitForChild("LegacyCamera")) local VehicleCamera = require(script:WaitForChild("VehicleCamera"))
-- Rigs
local Rigs = { [0] = script.DefaultR15; -- The normal blocky R15 rig. This is just here so converting with IgnoreBodyParts off can work. [1] = script.Dogu15; -- The original, non-deforming Dogu15 rig. [2] = script.Dogu15LegacyDeform; -- The second version of the Dogu15 rig, now with mesh deformation! [3] = script.Dogu15Deform; -- The third (and current) version of Dogu15. No more annoying gaps, and a twisty torso! [4] = script.ACSDogu; -- The third (and current) version of Dogu15. No more annoying gaps, and a twisty torso! }
------//Sprinting Animations
self.RighTSprint = CFrame.new(-1, 0.5, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0)); self.LefTSprint = CFrame.new(1.25,1.15,-1.35) * CFrame.Angles(math.rad(-60),math.rad(35),math.rad(-25)); return self
--[[Dependencies]]
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local UserInputService = game:GetService("UserInputService") local car = script.Parent.Car.Value local _Tune = require(car["A-Chassis Tune"])
--Constants;
local RAYLength = 100 -- Not really. A point, off in space.
--[[Transmission]]
Tune.TransModes = {"Auto", "Semi"} --[[ [Modes] "Auto" : Automatic shifting "Semi" : Clutchless manual shifting, dual clutch transmission "Manual" : Manual shifting with clutch >Include within brackets eg: {"Semi"} or {"Auto", "Manual"} >First mode is default mode ]] --Automatic Settings Tune.AutoShiftMode = "Speed" --[[ [Modes] "Speed" : Shifts based on wheel speed "RPM" : Shifts based on RPM ]] Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev) Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev) --Gear Ratios Tune.FinalDrive = 4.06 -- Gearing determines top speed and wheel torque Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed --[[Reverse]] 2.00 , -- Copy and paste a ratio to add a gear --[[Neutral]] 0 , -- Ratios can also be deleted --[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required --[[ 2 ]] 2.04 , --[[ 3 ]] 1.38 , --[[ 4 ]] 1.03 , --[[ 5 ]] 0.81 , --[[ 6 ]] 0.64 , } Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
-- Container for temporary connections (disconnected automatically)
local Connections = {}; function AnchorTool.Equip() -- Enables the tool's equipped functionality -- Start up our interface ShowUI(); BindShortcutKeys(); end; function AnchorTool.Unequip() -- Disables the tool's equipped functionality -- Clear unnecessary resources HideUI(); ClearConnections(); end; function ClearConnections() -- Clears out temporary connections for ConnectionKey, Connection in pairs(Connections) do Connection:disconnect(); Connections[ConnectionKey] = nil; end; end; function ShowUI() -- Creates and reveals the UI -- Reveal UI if already created if UI then -- Reveal the UI UI.Visible = true; -- Update the UI every 0.1 seconds UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1); -- Skip UI creation return; end; -- Create the UI UI = Core.Tool.Interfaces.BTAnchorToolGUI:Clone(); UI.Parent = Core.UI; UI.Visible = true; -- References to UI elements local AnchorButton = UI.Status.Anchored.Button; local UnanchorButton = UI.Status.Unanchored.Button; -- Enable the anchor status switch AnchorButton.MouseButton1Click:connect(function () SetProperty('Anchored', true); end); UnanchorButton.MouseButton1Click:connect(function () SetProperty('Anchored', false); end); -- Update the UI every 0.1 seconds UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1); end; function UpdateUI() -- Updates information on the UI -- Make sure the UI's on if not UI then return; end; -- Check the common anchor status of selection local Anchored = Support.IdentifyCommonProperty(Selection.Items, 'Anchored'); -- Update the anchor option switch if Anchored == true then Core.ToggleSwitch('Anchored', UI.Status); -- If the selection is unanchored elseif Anchored == false then Core.ToggleSwitch('Unanchored', UI.Status); -- If the anchor status varies, don't select a current switch elseif Anchored == nil then Core.ToggleSwitch(nil, UI.Status); end; end; function HideUI() -- Hides the tool UI -- Make sure there's a UI if not UI then return; end; -- Hide the UI UI.Visible = false; -- Stop updating the UI UIUpdater:Stop(); end; function SetProperty(Property, Value) -- Make sure the given value is valid if Value == nil then return; end; -- Start a history record TrackChange(); -- Go through each part for _, Part in pairs(Selection.Items) do -- Store the state of the part before modification table.insert(HistoryRecord.Before, { Part = Part, [Property] = Part[Property] }); -- Create the change request for this part table.insert(HistoryRecord.After, { Part = Part, [Property] = Value }); end; -- Register the changes RegisterChange(); end; function BindShortcutKeys() -- Enables useful shortcut keys for this tool -- Track user input while this tool is equipped table.insert(Connections, UserInputService.InputBegan:connect(function (InputInfo, GameProcessedEvent) -- Make sure this is an intentional event if GameProcessedEvent then return; end; -- Make sure this input is a key press if InputInfo.UserInputType ~= Enum.UserInputType.Keyboard then return; end; -- Make sure it wasn't pressed while typing if UserInputService:GetFocusedTextBox() then return; end; -- Check if the enter key was pressed if InputInfo.KeyCode == Enum.KeyCode.Return or InputInfo.KeyCode == Enum.KeyCode.KeypadEnter then -- Toggle the selection's anchor status ToggleAnchors(); end; end)); end; function ToggleAnchors() -- Toggles the anchor status of the selection -- Change the anchor status to the opposite of the common anchor status SetProperty('Anchored', not Support.IdentifyCommonProperty(Selection.Items, 'Anchored')); end; function TrackChange() -- Start the record HistoryRecord = { Before = {}; After = {}; Unapply = function (Record) -- Reverts this change -- Select the changed parts Selection.Replace(Support.GetListMembers(Record.Before, 'Part')); -- Send the change request Core.SyncAPI:Invoke('SyncAnchor', Record.Before); end; Apply = function (Record) -- Applies this change -- Select the changed parts Selection.Replace(Support.GetListMembers(Record.After, 'Part')); -- Send the change request Core.SyncAPI:Invoke('SyncAnchor', Record.After); end; }; end; function RegisterChange() -- Finishes creating the history record and registers it -- Make sure there's an in-progress history record if not HistoryRecord then return; end; -- Send the change to the server Core.SyncAPI:Invoke('SyncAnchor', HistoryRecord.After); -- Register the record and clear the staging Core.History.Add(HistoryRecord); HistoryRecord = nil; end;
--[[** Takes a table where keys are child names and values are functions to check the children against. Pass an instance tree into the function. If at least one child passes each check, the overall check passes. Warning! If you pass in a tree with more than one child of the same name, this function will always return false @param checkTable The table to check against @returns A function that checks an instance tree **--]]
function t.children(checkTable) assert(checkChildren(checkTable)) return function(value) local instanceSuccess, instanceErrMsg = t.Instance(value) if not instanceSuccess then return false, instanceErrMsg or "" end local childrenByName = {} for _, child in ipairs(value:GetChildren()) do local name = child.Name if checkTable[name] then if childrenByName[name] then return false, string.format("Cannot process multiple children with the same name %q", name) end childrenByName[name] = child end end for name, check in checkTable do local success, errMsg = check(childrenByName[name]) if not success then return false, string.format("[%s.%s] %s", value:GetFullName(), name, errMsg or "") end end return true end end end return t
-- debug.profileend()
return function(DeltaTime)
-- Decompiled with the Synapse X Luau decompiler.
return { Name = "help", Description = "Displays a list of all commands, or inspects one command.", Group = "Help", Args = { { Type = "command", Name = "Command", Description = "The command to view information on", Optional = true } }, ClientRun = function(p1, p2) if p2 then local v1 = p1.Cmdr.Registry:GetCommand(p2); p1:Reply(("Command: %s"):format(v1.Name), Color3.fromRGB(230, 126, 34)); if v1.Aliases and #v1.Aliases > 0 then p1:Reply(("Aliases: %s"):format(table.concat(v1.Aliases, ", ")), Color3.fromRGB(230, 230, 230)); end; p1:Reply(v1.Description, Color3.fromRGB(230, 230, 230)); local v2, v3, v4 = ipairs(v1.Args); while true do v2(v3, v4); if not v2 then break; end; v4 = v2; if v3.Optional == true then local v5 = "?"; else v5 = ""; end; p1:Reply(("#%d %s%s: %s - %s"):format(v2, v3.Name, v5, v3.Type, v3.Description)); end; else p1:Reply("Argument Shorthands\n-------------------\t\t\t\n. Me/Self\n* All/Everyone \n** Others \n? Random\n?N List of N random values\t\t\t\n"); local v6 = p1.Cmdr.Registry:GetCommands(); table.sort(v6, function(p3, p4) return p3.Group < p4.Group; end); local v7 = nil; local v8, v9, v10 = ipairs(v6); while true do v8(v9, v10); if not v8 then break; end; v10 = v8; if v7 ~= v9.Group then p1:Reply(("\n%s\n-------------------"):format(v9.Group)); v7 = v9.Group; end; p1:Reply(("%s - %s"):format(v9.Name, v9.Description)); end; end; return ""; end };
--- Interaction with SetCore Player events.
local PlayerBlockedEvent = nil local PlayerMutedEvent = nil local PlayerUnBlockedEvent = nil local PlayerUnMutedEvent = nil
--[[Transmission]]
Tune.TransModes = {"Auto", "Semi", "Manual"} --[[ [Modes] "Auto" : Automatic shifting "Semi" : Clutchless manual shifting, dual clutch transmission "Manual" : Manual shifting with clutch >Include within brackets eg: {"Semi"} or {"Auto", "Manual"} >First mode is default mode ]] --Automatic Settings Tune.AutoShiftMode = "Speed" --[[ [Modes] "Speed" : Shifts based on wheel speed "RPM" : Shifts based on RPM ]] Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev) Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev) --Gear Ratios Tune.FinalDrive = 3.06 -- Gearing determines top speed and wheel torque Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed --[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear --[[Neutral]] 0 , -- Ratios can also be deleted --[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required --[[ 2 ]] 2.04 , --[[ 3 ]] 1.38 , --[[ 4 ]] 1.03 , --[[ 5 ]] 0.81 , --[[ 6 ]] 0.64 , } Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--[[Weight and CG]]
Tune.Weight = 4000 -- Total weight (in pounds) Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable) --[[Width]] 8 , --[[Height]] 15 , --[[Length]] 25 } Tune.WeightDist = 30 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100) Tune.CGHeight = 2 -- Center of gravity height (studs relative to median of all wheels) Tune.WBVisible = false -- Makes the weight brick visible --Unsprung Weight Tune.FWheelDensity = .5 -- Front Wheel Density Tune.RWheelDensity = .5 -- 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
--// Input Connections
L_99_.InputBegan:connect(function(L_296_arg1, L_297_arg2) if not L_297_arg2 and L_15_ then if L_296_arg1.UserInputType == Enum.UserInputType.MouseButton2 and not L_73_ and L_24_.CanAim and not L_70_ and L_15_ and not L_62_ and not L_63_ then if not L_60_ then if not L_61_ then L_3_.Humanoid.WalkSpeed = 10 L_144_ = 10 L_143_ = 0.008 end L_91_ = L_49_ L_122_.target = L_52_.CFrame:toObjectSpace(L_43_.CFrame).p L_107_:FireServer(true) L_60_ = true end end; if L_296_arg1.KeyCode == Enum.KeyCode.E and L_15_ and not L_74_ and not L_75_ then L_74_ = true L_76_ = false L_75_ = true LeanRight() end if L_296_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and not L_74_ and not L_76_ then L_74_ = true L_75_ = false L_76_ = true LeanLeft() end if L_296_arg1.KeyCode == L_24_.AlternateAimKey and not L_73_ and L_24_.CanAim and not L_70_ and L_15_ and not L_62_ and not L_63_ then if not L_60_ then if not L_61_ then L_3_.Humanoid.WalkSpeed = 10 L_144_ = 10 L_143_ = 0.008 end L_91_ = L_49_ L_122_.target = L_52_.CFrame:toObjectSpace(L_43_.CFrame).p L_107_:FireServer(true) L_60_ = true end end; if L_296_arg1.UserInputType == Enum.UserInputType.MouseButton1 and not L_73_ and L_65_ and L_15_ and not L_62_ and not L_63_ and not L_70_ then L_64_ = true if not Shooting and L_15_ and not L_77_ then if L_95_ > 0 then Shoot() end elseif not Shooting and L_15_ and L_77_ then if L_97_ > 0 then Shoot() end end end; if L_296_arg1.KeyCode == L_24_.LaserKey and L_15_ and L_24_.LaserAttached then local L_298_ = L_1_:FindFirstChild("LaserLight") L_111_.KeyDown[1].Plugin() end; if L_296_arg1.KeyCode == L_24_.LightKey and L_15_ and L_24_.LightAttached then local L_299_ = L_1_:FindFirstChild("FlashLight"):FindFirstChild('Light') local L_300_ = false L_299_.Enabled = not L_299_.Enabled end; if L_15_ and L_296_arg1.KeyCode == L_24_.FireSelectKey and not L_66_ then L_66_ = true if L_86_ == 1 then if Shooting then Shooting = false end if L_24_.AutoEnabled then L_86_ = 2 L_77_ = false L_65_ = L_78_ elseif not L_24_.AutoEnabled and L_24_.BurstEnabled then L_86_ = 3 L_77_ = false L_65_ = L_78_ elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then L_86_ = 4 L_77_ = false L_65_ = L_78_ elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then L_86_ = 6 L_77_ = true L_78_ = L_65_ L_65_ = L_79_ elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled then L_86_ = 1 L_77_ = false L_65_ = L_78_ end elseif L_86_ == 2 then if Shooting then Shooting = false end if L_24_.BurstEnabled then L_86_ = 3 L_77_ = false L_65_ = L_78_ elseif not L_24_.BurstEnabled and L_24_.BoltAction then L_86_ = 4 L_77_ = false L_65_ = L_78_ elseif not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then L_86_ = 6 L_77_ = true L_78_ = L_65_ L_65_ = L_79_ elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then L_86_ = 1 L_77_ = false L_65_ = L_78_ elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.SemiEnabled then L_86_ = 2 L_77_ = false L_65_ = L_78_ end elseif L_86_ == 3 then if Shooting then Shooting = false end if L_24_.BoltAction then L_86_ = 4 L_77_ = false L_65_ = L_78_ elseif not L_24_.BoltAction and L_24_.ExplosiveEnabled then L_86_ = 6 L_77_ = true L_78_ = L_65_ L_65_ = L_79_ elseif not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then L_86_ = 1 L_77_ = false L_65_ = L_78_ elseif not L_24_.BoltAction and not L_24_.SemiEnabled and L_24_.AutoEnabled then L_86_ = 2 L_77_ = false L_65_ = L_78_ elseif not L_24_.BoltAction and not L_24_.SemiEnabled and not L_24_.AutoEnabled then L_86_ = 3 L_77_ = false L_65_ = L_78_ end elseif L_86_ == 4 then if Shooting then Shooting = false end if L_24_.ExplosiveEnabled then L_86_ = 6 L_77_ = true L_78_ = L_65_ L_65_ = L_79_ elseif not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then L_86_ = 1 L_77_ = false L_65_ = L_78_ elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then L_86_ = 2 L_77_ = false L_65_ = L_78_ elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then L_86_ = 3 L_77_ = false L_65_ = L_78_ elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled then L_86_ = 4 L_77_ = false L_65_ = L_78_ end elseif L_86_ == 6 then if Shooting then Shooting = false end L_79_ = L_65_ if L_24_.SemiEnabled then L_86_ = 1 L_77_ = false L_65_ = L_78_ elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then L_86_ = 2 L_77_ = false L_65_ = L_78_ elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then L_86_ = 3 L_77_ = false L_65_ = L_78_ elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then L_86_ = 4 L_77_ = false L_65_ = L_78_ elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction then L_86_ = 6 L_77_ = true L_78_ = L_65_ L_65_ = L_79_ end end UpdateAmmo() FireModeAnim() IdleAnim() L_66_ = false end; if L_296_arg1.KeyCode == Enum.KeyCode.F and not L_73_ and not L_63_ and not L_66_ and not L_60_ and not L_62_ and not Shooting and not L_72_ then if not L_69_ and not L_70_ then L_70_ = true Shooting = false L_65_ = false L_124_ = time() delay(0.6, function() if L_95_ ~= L_24_.Ammo and L_95_ > 0 then CreateShell() end end) BoltBackAnim() L_69_ = true elseif L_69_ and L_70_ then BoltForwardAnim() Shooting = false L_65_ = true if L_95_ ~= L_24_.Ammo and L_95_ > 0 then L_95_ = L_95_ - 1 elseif L_95_ >= L_24_.Ammo then L_65_ = true end L_69_ = false L_70_ = false IdleAnim() L_71_ = false end UpdateAmmo() end; if L_296_arg1.KeyCode == Enum.KeyCode.LeftShift and not L_73_ and L_135_ and not L_60_ then L_67_ = true if L_15_ and not L_66_ and not L_63_ and L_67_ and not L_61_ and not L_70_ then Shooting = false L_60_ = false L_63_ = true delay(0, function() if L_63_ and not L_62_ then L_60_ = false L_68_ = true end end) L_91_ = 80 L_3_.Humanoid.WalkSpeed = 21 L_144_ = 21 L_143_ = 0.4 end end; if L_296_arg1.KeyCode == Enum.KeyCode.R and not L_73_ and L_15_ and not L_62_ and not L_60_ and not Shooting and not L_63_ and not L_70_ then if not L_77_ then if L_96_ > 0 and L_95_ < L_24_.Ammo then Shooting = false L_62_ = true ReloadAnim() if L_95_ <= 0 then if not L_24_.CanSlideLock then BoltBackAnim() end BoltForwardAnim() end IdleAnim() L_65_ = true if L_95_ <= 0 then if (L_96_ - (L_24_.Ammo - L_95_)) < 0 then L_95_ = L_95_ + L_96_ L_96_ = 0 else L_96_ = L_96_ - (L_24_.Ammo - L_95_) L_95_ = L_24_.Ammo end elseif L_95_ > 0 then if (L_96_ - (L_24_.Ammo - L_95_)) < 0 then L_95_ = L_95_ + L_96_ + 1 L_96_ = 0 else L_96_ = L_96_ - (L_24_.Ammo - L_95_) L_95_ = L_24_.Ammo + 1 end end L_62_ = false if not L_71_ then L_65_ = true end end; elseif L_77_ then if L_97_ > 0 then Shooting = false L_62_ = true nadeReload() IdleAnim() L_62_ = false L_65_ = true end end; UpdateAmmo() end; if L_296_arg1.KeyCode == Enum.KeyCode.RightBracket and L_60_ then if (L_50_ < 1) then L_50_ = L_50_ + L_24_.SensitivityIncrement end end if L_296_arg1.KeyCode == Enum.KeyCode.LeftBracket and L_60_ then if (L_50_ > 0.1) then L_50_ = L_50_ - L_24_.SensitivityIncrement end end if L_296_arg1.KeyCode == Enum.KeyCode.T and L_1_:FindFirstChild("AimPart2") then if not L_80_ then L_52_ = L_1_:WaitForChild("AimPart2") L_49_ = L_24_.CycleAimZoom if L_60_ then L_91_ = L_24_.CycleAimZoom end L_80_ = true else L_52_ = L_1_:FindFirstChild("AimPart") L_49_ = L_24_.AimZoom if L_60_ then L_91_ = L_24_.AimZoom end L_80_ = false end; end; if L_296_arg1.KeyCode == L_24_.InspectionKey then if not L_73_ then L_73_ = true InspectAnim() IdleAnim() L_73_ = false end end; end end) L_99_.InputEnded:connect(function(L_301_arg1, L_302_arg2) if not L_302_arg2 and L_15_ then if L_301_arg1.UserInputType == Enum.UserInputType.MouseButton2 and not L_73_ and L_24_.CanAim then if L_60_ then if not L_61_ then L_3_.Humanoid.WalkSpeed = 16 L_144_ = 17 L_143_ = .25 end L_91_ = 70 L_122_.target = Vector3.new() L_107_:FireServer(false) L_60_ = false end end; if L_301_arg1.KeyCode == Enum.KeyCode.E and L_15_ and L_74_ then Unlean() L_74_ = false L_76_ = false L_75_ = false end if L_301_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and L_74_ then Unlean() L_74_ = false L_76_ = false L_75_ = false end if L_301_arg1.KeyCode == L_24_.AlternateAimKey and not L_73_ and L_24_.CanAim then if L_60_ then if not L_61_ then L_3_.Humanoid.WalkSpeed = 16 L_144_ = 17 L_143_ = .25 end L_91_ = 70 L_122_.target = Vector3.new() L_107_:FireServer(false) L_60_ = false end end; if L_301_arg1.UserInputType == Enum.UserInputType.MouseButton1 and not L_73_ then L_64_ = false if Shooting then Shooting = false end end; if L_301_arg1.KeyCode == Enum.KeyCode.E and L_15_ then local L_303_ = L_41_:WaitForChild('GameGui') if L_16_ then L_303_:WaitForChild('AmmoFrame').Visible = false L_16_ = false end end; if L_301_arg1.KeyCode == Enum.KeyCode.LeftShift and not L_73_ and not L_66_ and not L_61_ then -- SPRINT L_67_ = false if L_63_ and not L_60_ and not Shooting and not L_67_ then L_63_ = false L_68_ = false L_91_ = 70 L_3_.Humanoid.WalkSpeed = 16 L_144_ = 17 L_143_ = .25 end end; end end) L_99_.InputChanged:connect(function(L_304_arg1, L_305_arg2) if not L_305_arg2 and L_15_ and L_24_.FirstPersonOnly and L_60_ then if L_304_arg1.UserInputType == Enum.UserInputType.MouseWheel then if L_304_arg1.Position.Z == 1 and (L_50_ < 1) then L_50_ = L_50_ + L_24_.SensitivityIncrement elseif L_304_arg1.Position.Z == -1 and (L_50_ > 0.1) then L_50_ = L_50_ - L_24_.SensitivityIncrement end end end end) L_99_.InputChanged:connect(function(L_306_arg1, L_307_arg2) if not L_307_arg2 and L_15_ then local L_308_, L_309_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_52_.CFrame.p, (L_52_.CFrame.lookVector).unit * 10000), IgnoreList); if L_308_ then local L_310_ = (L_309_ - L_6_.Position).magnitude L_33_.Text = math.ceil(L_310_) .. ' m' end end end)
--[[ Calls the given callback on all nodes in the tree, traversed depth-first. ]]
function TestPlan:visitAllNodes(callback, root, level) root = root or self level = level or 0 for _, child in ipairs(root.children) do callback(child, level) self:visitAllNodes(callback, child, level + 1) end end
-- TODO: Raycast from perimeter of objectType mesh instead of cell
function ContentsManager:_getTouchingScenery(cellId, objectType) local scenerySet = {} local cell = self:getCell(cellId) local rayDirection = Vector3.new(0, -self.grid.CELL_DIMENSIONS.Y, 0) local rayOrigins = { cell.center, cell.center + Vector3.new(self.grid.CELL_DIMENSIONS.X / 2, 0, 0), cell.center - Vector3.new(self.grid.CELL_DIMENSIONS.X / 2, 0, 0), cell.center + Vector3.new(0, 0, self.grid.CELL_DIMENSIONS.Z / 2), cell.center - Vector3.new(0, 0, self.grid.CELL_DIMENSIONS.Z / 2) } for _, rayOrigin in ipairs(rayOrigins) do local part = workspace:FindPartOnRayWithWhitelist(Ray.new(rayOrigin, rayDirection), Util.getTableKeys(SceneryManager.scenery), true) if part then scenerySet[part] = true end end return scenerySet end function ContentsManager:addForced(objectType, cell) return self:add(objectType, cell, nil, true) end function ContentsManager:add(objectType, cellId, instance, forced) if forced or self:canPlace(objectType, cellId) then if instance ~= nil then self:_addToContents(instance, objectType, cellId) else local gridObject = objectType:render(self, self:getCell(cellId)) self:_addToContents(gridObject, objectType, cellId) -- TODO: Move this check into Grid/init.lua if isServer then local touchingObjects = self:getTouchingObjects(gridObject, objectType, self:getCell(cellId)) weldTouchingObjects(gridObject, touchingObjects) gridObject.Anchored = false end end return true else return false end end function ContentsManager:_allocateCell(cellId) local cellName = tostring(cellId) self.contents[cellName] = self:getCell(cellId) return self.contents[cellName] end function ContentsManager:_deallocateCell(cellId) local cellName = tostring(cellId) self.contents[cellName] = nil end function ContentsManager:_allocateConnectivityMapForIndex(cellId, index) local cell = self:_allocateCell(cellId) local indexAsString = tostring(index) if cell.connectivityMap[indexAsString] == nil then cell.connectivityMap[indexAsString] = {} end return cell.connectivityMap[indexAsString] end function ContentsManager:_deallocateConnectivityMapForIndex(cellId, index) local cell = self:getCell(cellId) local indexAsString = tostring(index) cell.connectivityMap[indexAsString] = nil end function ContentsManager:_addToContents(object, objectType, cellId) local cell = self:_allocateCell(cellId) cell.contents.objects[objectType] = object -- Update occupancy for cell cell.occupancy = bit32.bor(objectType.occupancy, cell.occupancy) -- Update occupancyMap for cell for index = 0, 13 do if bit32.extract(objectType.occupancy, index) == 1 then cell.occupancyMap[tostring(index)] = object end end -- Update occupancy and contents for orthogonally adjacent cells for _, face in pairs(BitOps.FACES) do local adjacentCell = self:_allocateCell(cellId + face) adjacentCell.occupancy = BitOps.applyFaceOccupancy(adjacentCell.occupancy, -1 * face, objectType.occupancy, face) if bit32.btest(BitOps.OCCUPANCY_FACE_MASK[tostring(BitOps.normalizeVec3(face))], objectType.occupancy) then local simpleObjectType, objectTypeRotation, objectFaceRotation = objectType.fromString(objectType.name) local adjacentObjectTypeRotation = (objectTypeRotation + 180) % 360 local adjacentObjectType = self.grid.objectTypes[simpleObjectType .. "$" .. tostring(adjacentObjectTypeRotation) .. "$" .. tostring(objectFaceRotation)] adjacentCell.contents.objects[adjacentObjectType] = object end end -- Update occupancyMap for orthogonally adjacent cells for _, face in pairs(BitOps.FACES) do local occupancyFaceIndex = BitOps.OCCUPANCY_INDEX_FOR_FACE[tostring(BitOps.normalizeVec3(face))] if bit32.extract(objectType.occupancy, occupancyFaceIndex) == 1 then -- TODO: Don't allocate cell unless you have to local adjacentCell = self:_allocateCell(cellId + face) local occupancyIndexForAdjacentFace = BitOps.OCCUPANCY_INDEX_FOR_FACE[tostring(BitOps.normalizeVec3(-1 * face))] adjacentCell.occupancyMap[tostring(occupancyIndexForAdjacentFace)] = object end end -- Update connectivity for cell cell.connectivity = bit32.bor(objectType.connectivity, cell.connectivity) -- Update connectivityMap for cell for index = 0, 23 do if bit32.extract(objectType.connectivity, index) == 1 then local setOfObjectsConnectedToPoint = self:_allocateConnectivityMapForIndex(cellId, index) setOfObjectsConnectedToPoint[object] = true end end -- Update connectivity for orthogonally adjacent cells for _, face in pairs(BitOps.FACES) do -- TODO: Don't allocate cell unless you have to local adjacentCell = self:_allocateCell(cellId + face) adjacentCell.connectivity = BitOps.applyFaceConnectivity(adjacentCell.connectivity, -1 * face, objectType.connectivity, face) end -- Update connectivityMap for orthogonally adjacent cells for _, face in pairs(BitOps.FACES) do for listIndex, bitmaskIndex in ipairs(BitOps.CONNECTIVITY_INDEXES_FOR_FACE[tostring(BitOps.normalizeVec3(face))]) do if bit32.extract(objectType.connectivity, bitmaskIndex) == 1 then local connectivityIndexesForAdjacentFace = BitOps.CONNECTIVITY_INDEXES_FOR_FACE[tostring(BitOps.normalizeVec3(-1 * face))] local adjacentBitmaskIndex = connectivityIndexesForAdjacentFace[listIndex] local setOfObjectsConnectedToAdjacentPoint = self:_allocateConnectivityMapForIndex(cellId + face, adjacentBitmaskIndex) setOfObjectsConnectedToAdjacentPoint[object] = true end end end -- Update connectivity and connectivityMap for diagonally adjacent cells for edgeAsString, connectivityIndexes in pairs(BitOps.CONNECTIVITY_INDEXES_FOR_EDGE) do local edge = Vector3FromString(edgeAsString) local connectivityIndexesSize = #connectivityIndexes for i, connectivityIndex in ipairs(connectivityIndexes) do if bit32.extract(objectType.connectivity, connectivityIndex) ~= 0 then -- TODO: Don't allocate cell unless you have to local diagonallyAdjacentCell = self:_allocateCell(cellId + edge) local diagonallyAdjacentEdge = BitOps.normalizeVec3(-1 * edge) local diagonallyAdjacentEdgeConnectivityIndexes = BitOps.CONNECTIVITY_INDEXES_FOR_EDGE[tostring(diagonallyAdjacentEdge)] -- Flip the order you traverse the diagonally adjacent edge's -- connectivity indexes if the edge is perpendicular to the Y axis local j = i if edge.Y ~= 0 then j = connectivityIndexesSize + 1 - j end diagonallyAdjacentCell.connectivity = bit32.replace(diagonallyAdjacentCell.connectivity, 1, diagonallyAdjacentEdgeConnectivityIndexes[j]) local setOfObjectsConnectedToAdjacentPoint = self:_allocateConnectivityMapForIndex( diagonallyAdjacentCell.id, diagonallyAdjacentEdgeConnectivityIndexes[j] ) setOfObjectsConnectedToAdjacentPoint[object] = true end end end if DEBUG then local system = "CLIENT - " if isServer then system = "SERVER - " end print(system .. "ContentsManager contents for folder " .. self.folder.Name .. " after adding " .. objectType.name .. " to " .. tostring(cellId)) print(Util.debugPrint(self.contents)) end self:broadcastContentsChange({ type = ADDED_OBJECT, cellId = cellId, objectType = objectType, object = object, }) end function ContentsManager:broadcastContentsChange(change) if self.contentsListenerCount > 0 then for callback in pairs(self.contentsListeners) do callback(change) end end end function ContentsManager:getTouchingObjects(object, objectType, cell) local result = {} -- Must be connected to the same object by at least two connectivity points local setOfConnectedObjects = {} for i = 0, 23 do local key = tostring(i) if bit32.extract(objectType.connectivity, i) == 1 and cell.connectivityMap[key] ~= nil then for touchingObject in pairs(cell.connectivityMap[key]) do if setOfConnectedObjects[touchingObject] then result[touchingObject] = true else setOfConnectedObjects[touchingObject] = true end end end end for sceneryObject in pairs(self:_getTouchingScenery(cell.id, objectType)) do result[sceneryObject] = true end return result end function ContentsManager:remove(objectType, cellName, suppressWarning, doNotDestroy) local cell = self:getCell(Vector3FromString(cellName)) -- Get object local object = cell.contents.objects[objectType] if object == nil then if not suppressWarning then warn("Tried to remove " .. objectType.name .. " in cell " .. tostring(cell.id) .. " where none existed") end return end -- Update occupancy for cell cell.occupancy = bit32.band(bit32.bnot(objectType.occupancy), cell.occupancy) -- Update occupancyMap for cell for index = 0, 13 do if bit32.extract(objectType.occupancy, index) == 1 then cell.occupancyMap[tostring(index)] = nil end end -- Update occupancy for orthogonally adjacent cells for _, face in pairs(BitOps.FACES) do local adjacentCell = self:getCell(cell.id + face) adjacentCell.occupancy = BitOps.removeFaceOccupancy(adjacentCell.occupancy, -1 * face, objectType.occupancy, face) end -- Update occupancyMap for orthogonally adjacent cells for _, face in pairs(BitOps.FACES) do local occupancyFaceIndex = BitOps.OCCUPANCY_INDEX_FOR_FACE[tostring(BitOps.normalizeVec3(face))] if bit32.extract(objectType.occupancy, occupancyFaceIndex) == 1 then local adjacentCell = self:getCell(cell.id + face) local occupancyIndexForAdjacentFace = BitOps.OCCUPANCY_INDEX_FOR_FACE[tostring(BitOps.normalizeVec3(-1 * face))] adjacentCell.occupancyMap[tostring(occupancyIndexForAdjacentFace)] = nil local simpleObjectType, objectTypeRotation, objectFaceRotation = objectType.fromString(objectType.name) local adjacentObjectTypeRotation = (objectTypeRotation + 180) % 360 local adjacentObjectType = self.grid.objectTypes[simpleObjectType .. "$" .. tostring(adjacentObjectTypeRotation) .. "$" .. tostring(objectFaceRotation)] adjacentCell.contents.objects[adjacentObjectType] = nil end end -- Update connectivity and connectivityMap for cell for index = 0, 23 do if bit32.extract(objectType.connectivity, index) == 1 then local setOfObjectsConnectedToPoint = self:_allocateConnectivityMapForIndex(cell.id, index) setOfObjectsConnectedToPoint[object] = nil if next(setOfObjectsConnectedToPoint) == nil then self:_deallocateConnectivityMapForIndex(cell.id, index) cell.connectivity = bit32.replace(cell.connectivity, 0, index) end end end -- Update connectivity and connectivityMap for orthogonally adjacent cells for _, face in pairs(BitOps.FACES) do for listIndex, bitmaskIndex in ipairs(BitOps.CONNECTIVITY_INDEXES_FOR_FACE[tostring(BitOps.normalizeVec3(face))]) do if bit32.extract(objectType.connectivity, bitmaskIndex) == 1 then local connectivityIndexesForAdjacentFace = BitOps.CONNECTIVITY_INDEXES_FOR_FACE[tostring(BitOps.normalizeVec3(-1 * face))] local adjacentBitmaskIndex = connectivityIndexesForAdjacentFace[listIndex] local setOfObjectsConnectedToAdjacentPoint = self:_allocateConnectivityMapForIndex(cell.id + face, adjacentBitmaskIndex) setOfObjectsConnectedToAdjacentPoint[object] = nil if next(setOfObjectsConnectedToAdjacentPoint) == nil then local adjacentCell = self:getCell(cell.id + face) self:_deallocateConnectivityMapForIndex(adjacentCell.id, adjacentBitmaskIndex) adjacentCell.connectivity = bit32.replace(adjacentCell.connectivity, 0, adjacentBitmaskIndex) end end end end -- Update connectivity and connectivityMap for diagonally adjacent cells for edgeAsString, connectivityIndexes in pairs(BitOps.CONNECTIVITY_INDEXES_FOR_EDGE) do local edge = Vector3FromString(edgeAsString) local connectivityIndexesSize = #connectivityIndexes for i, connectivityIndex in ipairs(connectivityIndexes) do if bit32.extract(objectType.connectivity, connectivityIndex) ~= 0 then local diagonallyAdjacentCell = self:getCell(cell.id + edge) local diagonallyAdjacentEdge = BitOps.normalizeVec3(-1 * edge) local diagonallyAdjacentEdgeConnectivityIndexes = BitOps.CONNECTIVITY_INDEXES_FOR_EDGE[tostring(diagonallyAdjacentEdge)] -- Flip the order you traverse the diagonally adjacent edge's -- connectivity indexes if the edge is perpendicular to the Y axis local j = i if edge.Y ~= 0 then j = connectivityIndexesSize + 1 - j end local setOfObjectsConnectedToAdjacentPoint = self:_allocateConnectivityMapForIndex( diagonallyAdjacentCell.id, diagonallyAdjacentEdgeConnectivityIndexes[j] ) setOfObjectsConnectedToAdjacentPoint[object] = nil if next(setOfObjectsConnectedToAdjacentPoint) == nil then diagonallyAdjacentCell.connectivity = bit32.replace(diagonallyAdjacentCell.connectivity, 0, diagonallyAdjacentEdgeConnectivityIndexes[j]) end end end end -- Remove object from cell contents cell.contents.objects[objectType] = nil -- Remove object from adjacent cell contents for _, face in pairs(BitOps.FACES) do local occupancyFaceIndex = BitOps.OCCUPANCY_INDEX_FOR_FACE[tostring(BitOps.normalizeVec3(face))] if bit32.extract(objectType.occupancy, occupancyFaceIndex) == 1 then local adjacentCell = self:getCell(cell.id + face) local simpleObjectType, objectTypeRotation, objectFaceRotation = objectType.fromString(objectType.name) local adjacentObjectTypeRotation = (objectTypeRotation + 180) % 360 local adjacentObjectType = self.grid.objectTypes[simpleObjectType .. "$" .. tostring(adjacentObjectTypeRotation) .. "$" .. tostring(objectFaceRotation)] adjacentCell.contents.objects[adjacentObjectType] = nil end end -- Destroy object if not doNotDestroy then object:Destroy() end -- Deallocate all affected cells that are empty and disconnected local affectedCells = { cell } for _, face in pairs(BitOps.FACES) do table.insert(affectedCells, self:getCell(cell.id + face)) end for edge in pairs(BitOps.CONNECTIVITY_INDEXES_FOR_EDGE) do table.insert(affectedCells, self:getCell(cell.id + Vector3FromString(edge))) end for _, affectedCell in ipairs(affectedCells) do if affectedCell.occupancy == 0 and affectedCell.connectivity == 0 then self:_deallocateCell(affectedCell.id) end end if DEBUG then local system = "CLIENT - " if isServer then system = "SERVER - " end print(system .. "ContentsManager contents for folder " .. self.folder.Name .. " after removing " .. objectType.name .. " to " .. cellName) print(Util.debugPrint(self.contents)) end self:broadcastContentsChange({ type = REMOVED_OBJECT, cellId = cell.id, objectType = objectType, doNotDestroy = doNotDestroy, }) -- TODO: This should be moved into Grid/init.lua if isServer then RemoveGridObject:FireAllClients(objectType:toString(cell), doNotDestroy) end end function ContentsManager:removeByName(name, suppressWarning, doNotDestroy) local parsedName = {} for word in name:gmatch("[^|]+") do table.insert(parsedName, word) end local objectTypeName = parsedName[1] local cellName = parsedName[2] if self.grid.objectTypes[objectTypeName] then self:remove(self.grid.objectTypes[objectTypeName], cellName, suppressWarning, doNotDestroy) else warn("Could not find object type " .. objectTypeName) end end function ContentsManager:destroy() -- TODO end return ContentsManager
--[=[ Checks if a string is empty or nil @param str string @return boolean ]=]
function String.isEmptyOrWhitespaceOrNil(str: string): boolean return type(str) ~= "string" or str == "" or String.isWhitespace(str) end
--[[ Touch Events ]]
-- if IsTouchDevice then -- On touch devices we need to recreate the guis on character load. LocalPlayer.CharacterAdded:connect(function(character) createTouchGuiContainer() if CurrentControlModule then CurrentControlModule:Disable() CurrentControlModule = nil end onControlsChanged() end) UserInputService.Changed:connect(function(property) if property == 'ModalEnabled' then IsModalEnabled = UserInputService.ModalEnabled setJumpModule(not UserInputService.ModalEnabled) if UserInputService.ModalEnabled then if CurrentControlModule then CurrentControlModule:Disable() end else if CurrentControlModule then CurrentControlModule:Enable() end end end end) BindableEvent_OnFailStateChanged.Event:connect(function(isOn) if ClickToMoveTouchControls then if isOn then ClickToMoveTouchControls:Enable() else ClickToMoveTouchControls:Disable() end if ClickToMoveTouchControls == ControlModules.Thumbpad or ClickToMoveTouchControls == ControlModules.Thumbstick or ClickToMoveTouchControls == ControlModules.Default then -- if isOn then TouchJumpModule:Enable() else TouchJumpModule:Disable() end end end end) end MasterControl:Init() onControlsChanged()
-- How many times per second the gun can fire
local FireRate = 1 / 1000
-- ================================================================================ -- PUBLIC FUNCTIONS -- ================================================================================
function Gamepad:IsDown(keyCode) return down[keyCode] == true end -- Gamepad:IsDown() function Gamepad:GetInput(keyCode) return state[keyCode] end -- Gamepad:GetInput() function Gamepad:GetPosition(keyCode) local input = self:GetInput(keyCode) if input then return input.Position end return ZERO_VECTOR end -- Gamepad:GetPosition()
--Bosun math
speedDiv = 66/maxSpeed elevationAngle = 66/upRaise turnAngleDiv = 66 / turnInclineAngle
--[=[ Deep-reconciles a dictionary into another dictionary. ```lua local template = { A = 0, B = 0, C = { D = "", }, } local toReconcile = { A = 9, B = 8, C = {}, } print(TableKit.Reconcile(toReconcile, template)) -- prints { A = 9, B = 8, C = { D = "" } ``` @within TableKit @param original table @param reconcile table @return table ]=]
function TableKit.Reconcile(original: { [unknown]: unknown }, reconcile: { [unknown]: any }) local tbl = table.clone(original) for key, value in reconcile do if tbl[key] == nil then if typeof(value) == "table" then tbl[key] = TableKit.DeepCopy(value) else tbl[key] = value end elseif typeof(reconcile[key]) == "table" then if typeof(value) == "table" then tbl[key] = TableKit.Reconcile(value, reconcile[key]) else tbl[key] = TableKit.DeepCopy(reconcile[key]) end end end return tbl end
--- Event handler for text box focus lost
function Window:LoseFocus(submit) local text = Entry.TextBox.Text self:ClearHistoryState() if Gui.Visible and not GuiService.MenuIsOpen then Entry.TextBox:CaptureFocus() elseif GuiService.MenuIsOpen and Gui.Visible then self:Hide() end if submit and self.Valid then wait() self:SetEntryText("") self.ProcessEntry(text) elseif submit then self:AddLine(self._errorText, Color3.fromRGB(255, 153, 153)) end end function Window:TraverseHistory(delta) local history = self.Cmdr.Dispatcher:GetHistory() if self.HistoryState == nil then self.HistoryState = { Position = #history + 1, InitialText = self:GetEntryText(), } end self.HistoryState.Position = math.clamp(self.HistoryState.Position + delta, 1, #history + 1) self:SetEntryText( self.HistoryState.Position == #history + 1 and self.HistoryState.InitialText or history[self.HistoryState.Position] ) end function Window:ClearHistoryState() self.HistoryState = nil end function Window:SelectVertical(delta) if self.AutoComplete:IsVisible() and not self.HistoryState then self.AutoComplete:Select(delta) else self:TraverseHistory(delta) end end local lastPressTime = 0 local pressCount = 0
--------AUDIENCE BACK RIGHT--------
game.Workspace.audiencebackright1.Part1.BrickColor = BrickColor.new(1023) game.Workspace.audiencebackright1.Part2.BrickColor = BrickColor.new(1023) game.Workspace.audiencebackright1.Part3.BrickColor = BrickColor.new(1023) game.Workspace.audiencebackright1.Part4.BrickColor = BrickColor.new(106) game.Workspace.audiencebackright1.Part5.BrickColor = BrickColor.new(106) game.Workspace.audiencebackright1.Part6.BrickColor = BrickColor.new(106) game.Workspace.audiencebackright1.Part7.BrickColor = BrickColor.new(1013) game.Workspace.audiencebackright1.Part8.BrickColor = BrickColor.new(1013) game.Workspace.audiencebackright1.Part9.BrickColor = BrickColor.new(1013)
--[[ Retries a Promise-returning callback N times until it succeeds. ]]
function Promise.retry(callback, times, ...) assert(type(callback) == "function", "Parameter #1 to Promise.retry must be a function") assert(type(times) == "number", "Parameter #2 to Promise.retry must be a number") local args, length = {...}, select("#", ...) return Promise.resolve(callback(...)):catch(function(...) if times > 0 then return Promise.retry(callback, times - 1, unpack(args, 1, length)) else return Promise.reject(...) end end) end
--
local sight = 18 local walking = true local shooting = false local canshoot = true local cansay = true local saycooldown = 0 local akweld = Instance.new("Weld", npc["AK-47"]) akweld.Part0 = rightarm akweld.Part1 = npc["AK-47"] function walkanim(walkspeed) if walkspeed > 5 then walking = true else walking = false end end npchumanoid.Running:connect(walkanim) function randomwalk() while wait(math.random(3,6)) do if not shooting and not walking then npchumanoid.WalkSpeed = 16 local function createwalkpart() local walkpart = Instance.new("Part", npc) walkpart.Size = Vector3.new(1,1,1) walkpart.Anchored = true walkpart.Material = "Neon" walkpart.Transparency = 1 walkpart.BrickColor = BrickColor.new("Maroon") walkpart.CFrame = torso.CFrame * CFrame.new(math.random(-60,60),math.random(-30,30),math.random(-60,60)) local path = game:GetService("PathfindingService"):FindPathAsync(torso.Position, walkpart.Position) local waypoints = path:GetWaypoints() if path.Status == Enum.PathStatus.Success then for i,v in pairs(waypoints) do local pospart = Instance.new("Part", npc) pospart.Size = Vector3.new(1,1,1) pospart.Anchored = true pospart.Material = "Neon" pospart.Transparency = 1 pospart.Position = v.Position pospart.Name = "pospart" pospart.CanCollide = false end for i,v in pairs(waypoints) do npchumanoid:MoveTo(v.Position) local allow = 0 while (torso.Position - v.Position).magnitude > 4 and allow < 35 do allow = allow + 1 wait() end if v.Action == Enum.PathWaypointAction.Jump then npchumanoid.Jump = true end end for i,v in pairs(npc:GetChildren()) do if v.Name == "pospart" then v:destroy() end end else createwalkpart() wait() end walkpart:destroy() end createwalkpart() end end end function checkandshoot() while wait() do saycooldown = saycooldown + 1 if saycooldown == 500 then cansay = true saycooldown = 0 end for i,v in pairs(workspace:GetChildren()) do if v.ClassName == "Model" and v.Name ~= "Rufus14" then local victimhumanoid = v:findFirstChildOfClass("Humanoid") local victimhead = v:findFirstChild("Head") if victimhumanoid and victimhead and v.Name ~= npc.Name then if (victimhead.Position - head.Position).magnitude < sight then if victimhumanoid.Name == "noneofurbusiness" and cansay then elseif not shooting and victimhumanoid.Health > 0 and canshoot then shooting = true walking = false local doesshoot = 0 local hpnow = npchumanoid.Health local walk = 0 npchumanoid.WalkSpeed = 0 while shooting and (victimhead.Position - head.Position).magnitude < sight and victimhumanoid.Health > 0 and canshoot do doesshoot = doesshoot + 1 walk = walk + 1 if npchumanoid.PlatformStand == false then npc.HumanoidRootPart.CFrame = CFrame.new(npc.HumanoidRootPart.Position,Vector3.new(victimhead.Position.x,npc.HumanoidRootPart.Position.y,victimhead.Position.z)) end if walk == 100 and not walking then local function createwalkpart() local walkpart = Instance.new("Part", npc) walkpart.Size = Vector3.new(1,1,1) walkpart.Anchored = true walkpart.Material = "Neon" walkpart.Transparency = 1 walkpart.BrickColor = BrickColor.new("Maroon") walkpart.CFrame = torso.CFrame * CFrame.new(-math.random(20,60),math.random(-40,40),math.random(-10,10)) local path = game:GetService("PathfindingService"):FindPathAsync(torso.Position, walkpart.Position) local waypoints = path:GetWaypoints() if path.Status == Enum.PathStatus.Success then shooting = false canshoot = false npchumanoid.WalkSpeed = 20 for i,v in pairs(waypoints) do local pospart = Instance.new("Part", npc) pospart.Size = Vector3.new(1,1,1) pospart.Anchored = true pospart.Material = "Neon" pospart.Transparency = 1 pospart.Position = v.Position pospart.Name = "pospart" pospart.CanCollide = false end for i,v in pairs(waypoints) do npchumanoid:MoveTo(v.Position) local allow = 0 while (torso.Position - v.Position).magnitude > 4 and allow < 35 do allow = allow + 1 wait() end if v.Action == Enum.PathWaypointAction.Jump then npchumanoid.Jump = true end end canshoot = true npchumanoid.WalkSpeed = 16 for i,v in pairs(npc:GetChildren()) do if v.Name == "pospart" then v:destroy() end end else createwalkpart() wait() end walkpart:destroy() end createwalkpart() end if doesshoot == 2 then doesshoot = 0 npc["AK-47"].shoot:Play() local bullet = Instance.new("Part", npc) bullet.Size = Vector3.new(0.3,0.3,3.5) bullet.Material = "Neon" bullet.CFrame = npc["AK-47"].CFrame * CFrame.new(0,0,-4) bullet.CanCollide = false local velocity = Instance.new("BodyVelocity", bullet) velocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge) bullet.CFrame = CFrame.new(bullet.Position, victimhead.Position) velocity.Velocity = bullet.CFrame.lookVector * 500 + Vector3.new(math.random(-20,20),math.random(-20,20),0) local pointlight = Instance.new("PointLight", npc["AK-47"]) game.Debris:AddItem(pointlight,0.1) local function damage(part) local damage = math.random(1,10) if part.Parent.ClassName ~= "Accessory" and part.Parent.Parent.ClassName ~= "Accessory" and part.ClassName ~= "Accessory" and part.Parent.Name ~= npc.Name and part.CanCollide == true then bullet:destroy() local victimhumanoid = part.Parent:findFirstChildOfClass("Humanoid") if victimhumanoid then if victimhumanoid.Health > damage then victimhumanoid:TakeDamage(damage) else victimhumanoid:TakeDamage(damage) end end end end game.Debris:AddItem(bullet, 5) bullet.Touched:connect(damage) end wait() end walking = false shooting = false end end end end end end end function run() while wait() do local hpnow = npchumanoid.Health wait() if npchumanoid.Health < hpnow then local dorun = math.random(1,1) if dorun == 1 and not walking then local function createwalkpart() local walkpart = Instance.new("Part", npc) walkpart.Size = Vector3.new(1,1,1) walkpart.Anchored = true walkpart.Material = "Neon" walkpart.Transparency = 1 walkpart.BrickColor = BrickColor.new("Maroon") walkpart.CFrame = torso.CFrame * CFrame.new(math.random(20,60),math.random(-20,20),math.random(-60,60)) local path = game:GetService("PathfindingService"):FindPathAsync(torso.Position, walkpart.Position) local waypoints = path:GetWaypoints() if path.Status == Enum.PathStatus.Success then shooting = false canshoot = false walking = true npchumanoid.WalkSpeed = 20 for i,v in pairs(waypoints) do local pospart = Instance.new("Part", npc) pospart.Size = Vector3.new(1,1,1) pospart.Anchored = true pospart.Material = "Neon" pospart.Transparency = 1 pospart.Position = v.Position pospart.Name = "pospart" pospart.CanCollide = false end for i,v in pairs(waypoints) do npchumanoid:MoveTo(v.Position) local allow = 0 while (torso.Position - v.Position).magnitude > 4 and allow < 35 do allow = allow + 1 wait() end if v.Action == Enum.PathWaypointAction.Jump then npchumanoid.Jump = true end end shooting = false canshoot = true walking = false npchumanoid.WalkSpeed = 16 for i,v in pairs(npc:GetChildren()) do if v.Name == "pospart" then v:destroy() end end else createwalkpart() wait() end walkpart:destroy() end createwalkpart() end end end end function death() if head:findFirstChild("The Prodigy - Voodoo People (Pendulum Remix)") then head["The Prodigy - Voodoo People (Pendulum Remix)"]:destroy() end if npc:findFirstChild("Health") then npc.Health.Disabled = true end npchumanoid.Archivable = true local zombiecorpse = npchumanoid.Parent:Clone() npchumanoid.Parent:destroy() zombiecorpse.Parent = workspace game.Debris:AddItem(zombiecorpse, 15) local Humanoid = zombiecorpse:findFirstChildOfClass("Humanoid") local Torso = zombiecorpse.Torso Humanoid.PlatformStand = true Humanoid:SetStateEnabled("Dead", false) for i,v in pairs(Humanoid.Parent.Torso:GetChildren()) do if v.ClassName == 'Motor6D' or v.ClassName == 'Weld' then v:destroy() end end for i,v in pairs(zombiecorpse:GetChildren()) do if v.ClassName == "Part" then for q,w in pairs(v:GetChildren()) do if w.ClassName == "BodyPosition" or w.ClassName == "BodyVelocity" then w:destroy() end end end end local function makeconnections(limb, attachementone, attachmenttwo, twistlower, twistupper, upperangle) local connection = Instance.new('BallSocketConstraint', limb) connection.LimitsEnabled = true connection.Attachment0 = attachementone connection.Attachment1 = attachmenttwo connection.TwistLimitsEnabled = true connection.TwistLowerAngle = twistlower connection.TwistUpperAngle = twistupper connection.UpperAngle = 70 end local function makehingeconnections(limb, attachementone, attachmenttwo, twistlower, twistupper, upperangle) local connection = Instance.new('HingeConstraint', limb) connection.Attachment0 = attachementone connection.Attachment1 = attachmenttwo connection.LimitsEnabled = true connection.LowerAngle = twistlower connection.UpperAngle = twistupper end Humanoid.Parent['Right Arm'].RightShoulderAttachment.Position = Vector3.new(0, 0.5, 0) Torso.RightCollarAttachment.Position = Vector3.new(1.5, 0.5, 0) Humanoid.Parent['Left Arm'].LeftShoulderAttachment.Position = Vector3.new(0, 0.5, 0) Torso.LeftCollarAttachment.Position = Vector3.new(-1.5, 0.5, 0) local RightLegAttachment = Instance.new("Attachment", Humanoid.Parent["Right Leg"]) RightLegAttachment.Position = Vector3.new(0, 1, 0) local TorsoRightLegAttachment = Instance.new("Attachment", Torso) TorsoRightLegAttachment.Position = Vector3.new(0.5, -1, 0) -- local LeftLegAttachment = Instance.new("Attachment", Humanoid.Parent["Left Leg"]) LeftLegAttachment.Position = Vector3.new(0, 1, 0) local TorsoLeftLegAttachment = Instance.new("Attachment", Torso) TorsoLeftLegAttachment.Position = Vector3.new(-0.5, -1, 0) -- if Humanoid.Parent:findFirstChild("Head") then local HeadAttachment = Instance.new("Attachment", Humanoid.Parent.Head) HeadAttachment.Position = Vector3.new(0, -0.5, 0) makehingeconnections(Humanoid.Parent.Head, HeadAttachment, Torso.NeckAttachment, -20, 20, 70) end makeconnections(Humanoid.Parent['Right Arm'], Humanoid.Parent['Right Arm'].RightShoulderAttachment, Torso.RightCollarAttachment, -80, 80) makeconnections(Humanoid.Parent['Left Arm'], Humanoid.Parent['Left Arm'].LeftShoulderAttachment, Torso.LeftCollarAttachment, -80, 80) makeconnections(Humanoid.Parent['Right Leg'], RightLegAttachment, TorsoRightLegAttachment, -80, 80, 70) makeconnections(Humanoid.Parent['Left Leg'], LeftLegAttachment, TorsoLeftLegAttachment, -80, 80, 70) if Humanoid.Parent:findFirstChild("Right Arm") then local limbcollider = Instance.new("Part", Humanoid.Parent["Right Arm"]) limbcollider.Size = Vector3.new(1,1.3,1) limbcollider.Shape = "Cylinder" limbcollider.Transparency = 1 local limbcolliderweld = Instance.new("Weld", limbcollider) limbcolliderweld.Part0 = Humanoid.Parent["Right Arm"] limbcolliderweld.Part1 = limbcollider limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0) for i,v in pairs(zombiecorpse["Right Arm"]:GetChildren()) do if v.ClassName == 'Motor6D' or v.ClassName == 'Weld' then v:destroy() end end end -- if Humanoid.Parent:findFirstChild("Left Arm") then local limbcollider = Instance.new("Part", Humanoid.Parent["Left Arm"]) limbcollider.Size = Vector3.new(1,1.3,1) limbcollider.Shape = "Cylinder" limbcollider.Transparency = 1 local limbcolliderweld = Instance.new("Weld", limbcollider) limbcolliderweld.Part0 = Humanoid.Parent["Left Arm"] limbcolliderweld.Part1 = limbcollider limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0) end -- if Humanoid.Parent:findFirstChild("Left Leg") then local limbcollider = Instance.new("Part", Humanoid.Parent["Left Leg"]) limbcollider.Size = Vector3.new(1,1.3,1) limbcollider.Shape = "Cylinder" limbcollider.Transparency = 1 local limbcolliderweld = Instance.new("Weld", limbcollider) limbcolliderweld.Part0 = Humanoid.Parent["Left Leg"] limbcolliderweld.Part1 = limbcollider limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0) end -- if Humanoid.Parent:findFirstChild("Right Leg") then local limbcollider = Instance.new("Part", Humanoid.Parent["Right Leg"]) limbcollider.Size = Vector3.new(1,1.3,1) limbcollider.Shape = "Cylinder" limbcollider.Transparency = 1 local limbcolliderweld = Instance.new("Weld", limbcollider) limbcolliderweld.Part0 = Humanoid.Parent["Right Leg"] limbcolliderweld.Part1 = limbcollider limbcolliderweld.C0 = CFrame.fromEulerAnglesXYZ(0,0,math.pi/2) * CFrame.new(-0.4,0,0) end local ragdoll = zombiecorpse if ragdoll:findFirstChild("HumanoidRootPart") then ragdoll.HumanoidRootPart.CanCollide = false ragdoll.HumanoidRootPart:destroy() end end npchumanoid.Died:connect(death) spawn(run) spawn(checkandshoot) spawn(randomwalk) while wait() do --check animations and other things if not walking and not shooting then for i = 0.2,0.8 , 0.09 do if not walking and not shooting then akweld.C0 = akweld.C0:lerp(CFrame.new(-0.583096504, -1.87343168, 0.0918724537, 0.808914721, -0.582031429, 0.0830438882, -0.166903317, -0.0918986499, 0.981681228, -0.56373775, -0.807956576, -0.171481162),i) rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.32261992, 0.220639229, -0.279059082, 0.766044497, 0.604022682, -0.219846413, -0.492403805, 0.331587851, -0.804728508, -0.413175881, 0.724711061, 0.551434159),i) leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.16202736, -0.00836706161, -0.880517244, 0.939692557, -0.342020094, -2.98023224e-08, 0.171009958, 0.46984598, -0.866025567, 0.296198159, 0.813797832, 0.499999642),i) lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.599619389, -1.99128425, 0, 0.996194661, 0.087155968, 0, -0.087155968, 0.996194661, 0, 0, 0, 1),i) righthip.C0 = righthip.C0:lerp(CFrame.new(0.599619389, -1.99128449, 0, 0.996194661, -0.087155968, 0, 0.087155968, 0.996194661, 0, 0, 0, 1),i) root.C0 = root.C0:lerp(CFrame.new(0,0,0),i) neck.C0 = neck.C0:lerp(CFrame.new(0,1.5,0),i) wait() end end end if walking then --this is the walking animation for i = 0.2,0.8 , 0.09 do if walking then akweld.C0 = akweld.C0:lerp(CFrame.new(-0.583096504, -1.87343168, 0.0918724537, 0.808914721, -0.582031429, 0.0830438882, -0.166903317, -0.0918986499, 0.981681228, -0.56373775, -0.807956576, -0.171481162),i) rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.32261992, 0.220639229, -0.279059082, 0.766044497, 0.604022682, -0.219846413, -0.492403805, 0.331587851, -0.804728508, -0.413175881, 0.724711061, 0.551434159),i) leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.16202736, -0.00836706161, -0.880517244, 0.939692557, -0.342020094, -2.98023224e-08, 0.171009958, 0.46984598, -0.866025567, 0.296198159, 0.813797832, 0.499999642),i) lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.527039051, -1.78302765, 0.642787695, 0.999390841, 0.026734557, 0.0224329531, -0.0348994918, 0.765577614, 0.642395973, 0, -0.642787635, 0.766044438),i) righthip.C0 = righthip.C0:lerp(CFrame.new(0.522737741, -1.65984559, -0.766044617, 0.999390841, -0.0224329531, 0.0267345682, 0.0348994918, 0.642395794, -0.765577734, 0, 0.766044497, 0.642787457),i) root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.996194661, 6.98491931e-09, -0.0871561021, 0.00759615982, 0.996194661, 0.0868242308, 0.0868244469, -0.087155886, 0.992403805),i) neck.C0 = neck.C0:lerp(CFrame.new(2.38418579e-07, 1.49809694, 0.0435779095, 0.996194661, 6.38283382e-09, 0.0871560946, 0.00759615889, 0.996194601, -0.0868242308, -0.0868244469, 0.087155886, 0.992403746),i) wait() end end head.footstep:Play() for i = 0.2,0.8 , 0.09 do if walking then akweld.C0 = akweld.C0:lerp(CFrame.new(-0.583096504, -1.87343168, 0.0918724537, 0.808914721, -0.582031429, 0.0830438882, -0.166903317, -0.0918986499, 0.981681228, -0.56373775, -0.807956576, -0.171481162),i) rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.32261992, 0.220639229, -0.279059082, 0.766044497, 0.604022682, -0.219846413, -0.492403805, 0.331587851, -0.804728508, -0.413175881, 0.724711061, 0.551434159),i) leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.16202736, -0.00836706161, -0.880517244, 0.939692557, -0.342020094, -2.98023224e-08, 0.171009958, 0.46984598, -0.866025567, 0.296198159, 0.813797832, 0.499999642),i) lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.520322084, -1.59067655, -0.819151878, 0.999390841, 0.0200175196, -0.028587997, -0.0348994918, 0.573226929, -0.818652987, 0, 0.819151998, 0.57357645),i) righthip.C0 = righthip.C0:lerp(CFrame.new(0.528892756, -1.83610249, 0.573575974, 0.999390841, -0.0285879895, -0.020017527, 0.0348994955, 0.818652987, 0.57322675, -7.4505806e-09, -0.573576212, 0.819152057),i) root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.996194661, -1.44354999e-08, 0.0871558934, -0.00759615237, 0.996194661, 0.0868244395, -0.0868242383, -0.0871560946, 0.992403805),i) neck.C0 = neck.C0:lerp(CFrame.new(0, 1.49809742, 0.0435781479, 0.996194601, -1.27129169e-08, -0.0871559009, -0.0075961519, 0.996194661, -0.0868244097, 0.0868242458, 0.0871560723, 0.992403746),i) wait() end end head.footstep:Play() end if shooting then --this is the shooting animation for i = 0.2,0.8 , 0.45 do if shooting then akweld.C0 = akweld.C0:lerp(CFrame.new(-0.109231472, -2.24730468, -0.300003052, 0.984807491, 1.94707184e-07, 0.173647866, -0.173648044, -2.68220873e-07, 0.984807491, 3.67846468e-07, -0.999999821, -8.00420992e-08),i) root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.173648223, 0, -0.98480773, 0, 1, 0, 0.98480773, 0, 0.173648223),i) rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.21384871, 0.500000477, -0.879925251, 0.342019856, 0.939692438, -1.49501886e-08, 1.94707184e-07, -2.68220873e-07, -0.999999821, -0.939692438, 0.342020035, -3.76157232e-07),i) leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.59201181, 0.470158577, -0.794548988, 0.271118939, 0.181368172, 0.945304275, 0.902039766, -0.390578717, -0.18377316, 0.335885108, 0.902526498, -0.269494623),i) lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.681244373, -2.07163191, 0, 0.98480773, 0.173648283, 0, -0.173648283, 0.98480767, 0, 0, -1.86264515e-09, 0.99999994),i) righthip.C0 = righthip.C0:lerp(CFrame.new(0.681244612, -2.07163191, -4.76837158e-07, 0.98480773, -0.173648283, 0, 0.173648283, 0.98480767, 0, 0, 1.86264515e-09, 0.99999994),i) neck.C0 = neck.C0:lerp(CFrame.new(0.0296957493, 1.49240398, -0.0815882683, 0.336824059, 0.059391167, 0.939692557, -0.173648164, 0.98480773, -7.4505806e-09, -0.925416589, -0.163175896, 0.342020094),i) wait() end end for i = 0.2,0.8 , 0.45 do if shooting then akweld.C0 = akweld.C0:lerp(CFrame.new(-0.109231472, -2.24730468, -0.300003052, 0.984807491, 1.94707184e-07, 0.173647866, -0.173648044, -2.68220873e-07, 0.984807491, 3.67846468e-07, -0.999999821, -8.00420992e-08),i) root.C0 = root.C0:lerp(CFrame.new(0, 0, 0, 0.173648223, 0, -0.98480773, 0, 1, 0, 0.98480773, 0, 0.173648223),i) rightshoulder.C0 = rightshoulder.C0:lerp(CFrame.new(1.60777056, 0.499999523, -0.81046629, 0.342019439, 0.939691842, 1.55550936e-07, 4.10554577e-08, -3.93739697e-07, -0.999999464, -0.939691901, 0.342019975, -4.77612389e-07),i) leftshoulder.C0 = leftshoulder.C0:lerp(CFrame.new(-1.10000956, 0.482372284, -0.926761627, 0.27112025, 0.263066441, 0.925899446, 0.902039289, -0.405109912, -0.149033815, 0.335885197, 0.875603914, -0.347129732),i) lefthip.C0 = lefthip.C0:lerp(CFrame.new(-0.681244373, -2.07163191, 0, 0.98480773, 0.173648283, 0, -0.173648283, 0.98480767, 0, 0, -1.86264515e-09, 0.99999994),i) righthip.C0 = righthip.C0:lerp(CFrame.new(0.681244612, -2.07163191, -4.76837158e-07, 0.98480773, -0.173648283, 0, 0.173648283, 0.98480767, 0, 0, 1.86264515e-09, 0.99999994),i) neck.C0 = neck.C0:lerp(CFrame.new(0.121206045, 1.4753027, -0.0450725555, 0.336823881, 0.221664757, 0.915103495, -0.173648164, 0.969846308, -0.171010077, -0.925416648, -0.101305753, 0.365159094),i) wait() end end end end
--Scripted by DermonDarble
local userInputService = game:GetService("UserInputService") local camera = game.Workspace.CurrentCamera local player = game.Players.LocalPlayer local character = player.Character local humanoidRootPart = character.HumanoidRootPart local car = script:WaitForChild("Car").Value local stats = car:WaitForChild("Configurations") local Raycast = require(car.CarScript.RaycastModule) local cameraType = Enum.CameraType.Follow local movement = Vector2.new() local gamepadDeadzone = 0.14
------------------------------------------------------------------------ -- -- * used in luaK:dischargevars(), (lparser) luaY:assignment() ------------------------------------------------------------------------
function luaK:setoneret(fs, e) if e.k == "VCALL" then -- expression is an open function call? e.k = "VNONRELOC" e.info = luaP:GETARG_A(self:getcode(fs, e)) elseif e.k == "VVARARG" then luaP:SETARG_B(self:getcode(fs, e), 2) e.k = "VRELOCABLE" -- can relocate its simple result end end
-- ROBLOX upstream: https://github.com/facebook/jest/blob/v27.4.7/packages/jest-matcher-utils/src/deepCyclicCopyReplaceable.ts -- /** -- * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. -- * -- * This source code is licensed under the MIT license found in the -- * LICENSE file in the root directory of this source tree. -- */
--[[Steering]]
Tune.SteerInner = 65 -- Inner wheel steering angle (in degrees) Tune.SteerOuter = 65 -- Outer wheel steering angle (in degrees) Tune.SteerSpeed = .45 -- Steering increment per tick (in degrees) Tune.ReturnSpeed = .4 -- Steering increment per tick (in degrees) Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS) Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent) Tune.MSteerExp = 1 -- Mouse steering exponential degree --Steer Gyro Tuning Tune.SteerD = 1000 -- Steering Dampening Tune.SteerMaxTorque = 50000 -- Steering Force Tune.SteerP = 6000 -- Steering Aggressiveness
-- NOTE: To me, this appears a bit 'hackish' so I can't -- promise that it will always work!
local h = script.Parent:WaitForChild("Humanoid") h.Changed:connect(function() h.Jump = false -- Yes, it's this simple end)
--[=[ `Stop` is called when the component is stopped. This occurs either when the bound instance is removed from one of the whitelisted ancestors _or_ when the matching tag is removed from the instance. This also means that the instance _might_ be destroyed, and thus it is not safe to continue using the bound instance (e.g. `self.Instance`) any longer. This should be used to clean up the component. ```lua local MyComponent = Component.new({Tag = "MyComponent"}) function MyComponent:Stop() self.SomeStuff:Destroy() end ``` ]=]
function Component:Stop() end
--Tune
local WheelieButton = "C" local DeadZone = 70
--[[Standardized Values: Don't touch unless needed]]
--[WEIGHT // Cubic stud : pounds ratio] Tune.WeightScaling = 1/50 --Default = 1/50 (1 cubic stud = 50 lbs) Tune.LegacyScaling = 1/10 --Default = 1/10 (1 cubic stud = 10 lbs) [PGS OFF] return Tune
--print("Loading anims " .. name)
table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end)) table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end)) local idx = 1 for _, childPart in pairs(config:GetChildren()) do if (childPart:IsA("Animation")) then table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end)) animTable[name][idx] = {} animTable[name][idx].anim = childPart local weightObject = childPart:FindFirstChild("Weight") if (weightObject == nil) then animTable[name][idx].weight = 1 else animTable[name][idx].weight = weightObject.Value end animTable[name].count = animTable[name].count + 1 animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
--- If you don't know where you can get your ID, then go to this link: https://pics.supersgames.cf/uploads/big/298a69fa7bd0c7b3a03e460568065562.png (ID marked in yellow). --- --- Enable HttpEnabled when using this on your game --- --- My official site is: www.supersgames.cf. ---
--[[Brakes]]
Tune.ABSEnabled = false -- Implements ABS Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS) Tune.FBrakeForce = 700 -- Front brake force Tune.RBrakeForce = 500 -- Rear brake force Tune.PBrakeForce = 5000 -- Handbrake force Tune.FLgcyBForce = 7000 -- Front brake force [PGS OFF] Tune.RLgcyBForce = 5000 -- Rear brake force [PGS OFF] Tune.LgcyPBForce = 25000 -- Handbrake force [PGS OFF]
-- EVENTS
IconController.iconAdded = Signal.new() IconController.iconRemoved = Signal.new() IconController.controllerModeStarted = Signal.new() IconController.controllerModeEnded = Signal.new() IconController.healthbarDisabledSignal = Signal.new()
--[[Engine]]
-- [TORQUE CURVE VISUAL] -- https://www.desmos.com/calculator/nap6stpjqf -- Use sliders to manipulate values -- Edit everything as if your car is NATURALLY aspirated, or as if it lacks a turbo. Tune.Horsepower = 400 Tune.IdleRPM = 700 Tune.PeakRPM = 5800 Tune.Redline = 7000 Tune.EqPoint = 6000 Tune.PeakSharpness = 20 Tune.CurveMult = 0.2 Tune.InclineComp = 1.2 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees) --Turbo Settings Tune.Aspiration = "Single" --[[ [Aspiration] "Natural" : N/A, Naturally aspirated engine "Single" : Single turbocharger "Double" : Twin turbocharger ]] Tune.Boost = 15 --Max PSI per turbo (If you have two turbos and this is 15, the PSI will be 30) Tune.TurboSize = 18 --Turbo size; the bigger it is, the more lag it has. Tune.CompressRatio = 10 --The compression ratio (look it up) --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 = 150 -- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
--[[Wheel Configuration]]
--Store Reference Orientation Function function getParts(model,t,a) for i,v in pairs(model:GetChildren()) do if v:IsA("BasePart") then table.insert(t,{v,a.CFrame:toObjectSpace(v.CFrame)}) elseif v:IsA("Model") then getParts(v,t,a) end end end --PGS/Legacy local fDensity = _Tune.FWheelDensity local rDensity = _Tune.RWheelDensity if not PGS_ON then fDensity = _Tune.FWLgcyDensity rDensity = _Tune.RWLgcyDensity end local fDistX=_Tune.FWsBoneLen*math.cos(math.rad(_Tune.FWsBoneAngle)) local fDistY=_Tune.FWsBoneLen*math.sin(math.rad(_Tune.FWsBoneAngle)) local rDistX=_Tune.RWsBoneLen*math.cos(math.rad(_Tune.RWsBoneAngle)) local rDistY=_Tune.RWsBoneLen*math.sin(math.rad(_Tune.RWsBoneAngle)) local fSLX=_Tune.FSusLength*math.cos(math.rad(_Tune.FSusAngle)) local fSLY=_Tune.FSusLength*math.sin(math.rad(_Tune.FSusAngle)) local rSLX=_Tune.RSusLength*math.cos(math.rad(_Tune.RSusAngle)) local rSLY=_Tune.RSusLength*math.sin(math.rad(_Tune.RSusAngle)) for _,v in pairs(Drive) do --Apply Wheel Density if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then if v:IsA("BasePart") then if v.CustomPhysicalProperties == nil then v.CustomPhysicalProperties = PhysicalProperties.new(v.Material) end v.CustomPhysicalProperties = PhysicalProperties.new( fDensity, v.CustomPhysicalProperties.Friction, v.CustomPhysicalProperties.Elasticity, v.CustomPhysicalProperties.FrictionWeight, v.CustomPhysicalProperties.ElasticityWeight ) end else if v:IsA("BasePart") then if v.CustomPhysicalProperties == nil then v.CustomPhysicalProperties = PhysicalProperties.new(v.Material) end v.CustomPhysicalProperties = PhysicalProperties.new( rDensity, v.CustomPhysicalProperties.Friction, v.CustomPhysicalProperties.Elasticity, v.CustomPhysicalProperties.FrictionWeight, v.CustomPhysicalProperties.ElasticityWeight ) end end --Resurface Wheels for _,a in pairs({"Top","Bottom","Left","Right","Front","Back"}) do v[a.."Surface"]=Enum.SurfaceType.SmoothNoOutlines end --Store Axle-Anchored/Suspension-Anchored Part Orientation local WParts = {} local tPos = v.Position-car.DriveSeat.Position if v.Name=="FL" or v.Name=="RL" then v.CFrame = car.DriveSeat.CFrame*CFrame.Angles(math.rad(90),0,math.rad(90)) else v.CFrame = car.DriveSeat.CFrame*CFrame.Angles(math.rad(90),0,math.rad(-90)) end v.CFrame = v.CFrame+tPos if v:FindFirstChild("Parts")~=nil then getParts(v.Parts,WParts,v) end if v:FindFirstChild("Fixed")~=nil then getParts(v.Fixed,WParts,v) end --Align Wheels if v.Name=="FL" or v.Name=="FR" then v.CFrame = v.CFrame*CFrame.Angles(math.rad(_Tune.FCamber),0,0) if v.Name=="FL" then v.CFrame = v.CFrame*CFrame.Angles(0,0,math.rad(_Tune.FToe)) else v.CFrame = v.CFrame*CFrame.Angles(0,0,math.rad(-_Tune.FToe)) end elseif v.Name=="RL" or v.Name=="RR" then v.CFrame = v.CFrame*CFrame.Angles(math.rad(_Tune.RCamber),0,0) if v.Name=="RL" then v.CFrame = v.CFrame*CFrame.Angles(0,0,math.rad(_Tune.RToe)) else v.CFrame = v.CFrame*CFrame.Angles(0,0,math.rad(-_Tune.RToe)) end end --Re-orient Axle-Anchored/Suspension-Anchored Parts for _,a in pairs(WParts) do a[1].CFrame=v.CFrame:toWorldSpace(a[2]) end
--[[Susupension]]
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled --Front Suspension Tune.FSusDamping = 500 -- Spring Dampening Tune.FSusStiffness = 9000 -- Spring Force Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening) Tune.FSusLength = 2 -- Suspension length (in studs) Tune.FPreCompress = .4 -- Pre-compression adds resting length force Tune.FExtensionLim = .4 -- Max Extension Travel (in studs) Tune.FCompressLim = .4 -- Max Compression Travel (in studs) Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal) Tune.FWsBoneLen = 4 -- Wishbone Length Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal) Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward --Rear Suspension Tune.RSusDamping = 500 -- Spring Dampening Tune.RSusStiffness = 9000 -- Spring Force Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening) Tune.RSusLength = 2 -- Suspension length (in studs) Tune.RPreCompress = .4 -- Pre-compression adds resting length force Tune.RExtensionLim = .4 -- Max Extension Travel (in studs) Tune.RCompressLim = .4 -- Max Compression Travel (in studs) Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal) Tune.RWsBoneLen = 4 -- Wishbone Length Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal) Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward --Aesthetics Tune.SusVisible = true -- Spring Visible Tune.WsBVisible = false -- Wishbone Visible Tune.SusRadius = .2 -- Suspension Coil Radius Tune.SusThickness = .1 -- Suspension Coil Thickness Tune.SusColor = "Really black" -- Suspension Color [BrickColor] Tune.SusCoilCount = 6 -- Suspension Coil Count Tune.WsColor = "Black" -- Wishbone Color [BrickColor] Tune.WsThickness = .1 -- Wishbone Rod Thickness
--[[Susupension]]
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled --Front Suspension Tune.FSusDamping = 200 -- Spring Dampening Tune.FSusStiffness = 3000 -- Spring Force Tune.FSusLength = 3 -- Suspension length (in studs) Tune.FSusMaxExt = 1.5 -- Max Extension Travel (in studs) Tune.FSusMaxComp = .1 -- Max Compression Travel (in studs) Tune.FSusAngle = 70 -- Suspension Angle (degrees from horizontal) Tune.FWsBoneLen = 5.7 -- Wishbone Length Tune.FWsBoneAngle = 5 -- Wishbone angle (degrees from horizontal) Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward --Rear Suspension Tune.RSusDamping = 200 -- Spring Dampening Tune.RSusStiffness = 3000 -- Spring Force Tune.RSusLength = 3 -- Suspension length (in studs) Tune.RSusMaxExt = 1.5 -- Max Extension Travel (in studs) Tune.RSusMaxComp = .1 -- Max Compression Travel (in studs) Tune.RSusAngle = 70 -- Suspension Angle (degrees from horizontal) Tune.RWsBoneLen = 5.7 -- Wishbone Length Tune.RWsBoneAngle = 5 -- Wishbone angle (degrees from horizontal) Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward --Aesthetics Tune.SusVisible = true -- Spring Visible Tune.WsBVisible = true -- Wishbone Visible Tune.SusRadius = .4 -- Suspension Coil Radius Tune.SusThickness = .0 -- Suspension Coil Thickness Tune.SusColor = "Bright red" -- Suspension Color [BrickColor] Tune.SusCoilCount = 3 -- Suspension Coil Count Tune.WsColor = "Black" -- Wishbone Color [BrickColor] Tune.WsThickness = .0 -- Wishbone Rod Thickness
-- ROBLOX deviation: There is no console width since we only have log fn
local CONSOLE_WIDTH = 0
-- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
local anim = animTable[animName][idx].anim -- switch animation if (anim ~= currentAnimInstance) then if (currentAnimTrack ~= nil) then currentAnimTrack:Stop(transitionTime) currentAnimTrack:Destroy() end currentAnimSpeed = 1.0 -- load it to the humanoid; get AnimationTrack currentAnimTrack = humanoid:LoadAnimation(anim) currentAnimTrack.Priority = Enum.AnimationPriority.Core -- play the animation currentAnimTrack:Play(transitionTime) currentAnim = animName currentAnimInstance = anim -- set up keyframe name triggers if (currentAnimKeyframeHandler ~= nil) then currentAnimKeyframeHandler:disconnect() end currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc) end end
--Made by Luckymaxer
Mouse_Icon = "rbxasset://textures/GunCursor.png" Reloading_Icon = "rbxasset://textures/GunWaitCursor.png" Tool = script.Parent Mouse = nil function UpdateIcon() if Mouse then Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon end end function OnEquipped(ToolMouse) Mouse = ToolMouse UpdateIcon() end function OnChanged(Property) if Property == "Enabled" then UpdateIcon() end end Tool.Equipped:connect(OnEquipped) Tool.Changed:connect(OnChanged)
--[[Finalize Chassis]]
--Misc Weld wait() for i,v in pairs(script:GetChildren()) do if v:IsA("ModuleScript") then require(v) end end --Weld Body wait() ModelWeld(car.Body,car.DriveSeat) --Unanchor wait() UnAnchor(car)
--- Manages the cleaning of events and other things. -- Useful for encapsulating state and make deconstructors easy -- @classmod Maid -- @see Signal
local Maid = {} Maid.ClassName = "Maid"
--launch
while wait() do local maxDistance = distance for i,v in pairs(workspace:GetChildren()) do if v:FindFirstChild("Humanoid") then if (v.Head.Position-script.Parent.Head.Position).magnitude < maxDistance then if v ~= script.Parent then heardetect(v.Head) --script.Parent.HumanoidRootPart.CFrame = CFrame.new(script.Parent.HumanoidRootPart.Position, v.HumanoidRootPart.Position) end else wander() end end end end
-- Called when character is added
function BaseOcclusion:CharacterAdded(char, player) end
--//CLIENT
wait() local Tool = script.Parent.Parent.Parent
-- Creating a sorted list of positions to move between
local positionList = {} while true do local lowest = {nil, math.huge} -- Contains the destination with the lowest number and its number for _, value in pairs(mainFolder:GetChildren()) do if not value:IsA("BasePart") then continue end -- Skip this item if it's not a base part local nameSplit = string.split(value.Name, " ") -- In these conditional statements, we check: if #nameSplit ~= 2 then continue end -- That the name contains one space local destinationNumber = tonumber(nameSplit[2]) if string.lower(nameSplit[1]) == "destination" -- The word before the space is "destination" and destinationNumber -- The word after the space is a number and destinationNumber < lowest[2] -- And the number after the space is lower than the current lowest number then lowest = {value, destinationNumber} -- If the previous checks succeed, the current part is now the lowest one end end if not lowest[1] then break -- End the loop if there are no destination blocks remaining else table.insert(positionList, lowest[1].Position) if hideDestinationBlocks then -- Destroy or rename the current lowest destination to continue the sorting process lowest[1]:Destroy() else lowest[1].Name = "Destination" end end end alignPosition.MaxVelocity = topSpeed alignPosition.Position = positionList[1] platform.AlignOrientation.CFrame = platform.CFrame.Rotation -- Match the target orientation to the current orientation platform.Anchored = false while true do -- The moving platform can now endlessly go through the sorted list in order for index, _ in pairs(positionList) do alignPosition.Position = positionList[index] task.wait(moveDelay) end end
-- API
local Core = require(Tool.Core) local Selection = Core.Selection local Security = Core.Security local SnapTracking = require(Tool.Core.Snapping) local BoundingBox = require(Tool.Core.BoundingBox)
-- Returns the subject position the FpsCamera -- wants Roblox's camera to be using right now.
function FpsCamera:GetSubjectPosition() if self:IsInFirstPerson() then local camera = workspace.CurrentCamera local subject = camera.CameraSubject if subject and subject:IsA("Humanoid") and subject.Health > 0 then local character = subject.Parent local head = character and character:FindFirstChild("Head") if head and head:IsA("BasePart") then local cf = head.CFrame local offset = cf * CFrame.new(0, head.Size.Y / 3, 0) return offset.Position, cf.LookVector end end end return self:GetBaseSubjectPosition() end
--|| SERVICES ||--
local RunService = game:GetService("RunService") local Players = game:GetService("Players")
--Search Bar suggestions
function module:SetupTextbox(commandName, props) local function collectArguments(suggestions, currentBarArg, totalArgs, argName) if string.sub(string.lower(argName), 1, #currentBarArg) == currentBarArg then table.insert(suggestions, {Name = argName, ArgPos = totalArgs}) if #suggestions == props.maxSuggestions then return true end end end local specificArg = props.specificArg currentProps[commandName] = props createSuggestionLabels(props) setupEnterPress(props) local originalPosition props.textBox.Changed:connect(function(property) if property == "Text" then local totalArgs = -1 local barCommandName local args = {} if specificArg then totalArgs = 1 table.insert(args, props.textBox.Text) else props.textBox.Text:gsub('([^'..main.pdata.SplitKey..']+)',function(c) totalArgs = totalArgs + 1 if totalArgs == 0 then barCommandName = c elseif totalArgs > 0 then table.insert(args, c) end end); if totalArgs > 0 and not props.currentBarCommand then local firstChar = string.sub(barCommandName,1,1) if firstChar == main.settings.UniversalPrefix or firstChar == main.pdata.Prefix then barCommandName = string.sub(barCommandName,2) end barCommandName = string.lower(barCommandName) -- for _, command in pairs(main.commandInfo) do local cName = string.lower(command.Name) if cName == barCommandName then props.currentBarCommand = command elseif command.Aliases then for i,v in pairs(command.Aliases) do if string.lower(v) == barCommandName then props.currentBarCommand = command end end end end -- elseif totalArgs <= 0 then props.currentBarCommand = nil end end local suggestions = {} props.suggestionPos = 1 if #props.textBox.Text > 1 or (specificArg and #props.textBox.Text > 0) then if totalArgs == 0 then local barInput = string.lower(string.sub(props.textBox.Text, 2)) local barPrefix = string.lower(string.sub(props.textBox.Text, 1,1)) for _, command in pairs(main.commandInfo) do local cName = string.lower(command.Name) local cPrefix = command.Prefixes[1] if string.sub(cName, 1, #barInput) == barInput and cPrefix == barPrefix then table.insert(suggestions, {Name = command.Name, Args = command.Args, Prefixes = command.Prefixes, ArgPos = 0}) if #suggestions == props.maxSuggestions then break end end local unName = command.UnFunction if unName then if string.sub(string.lower(unName), 1, #barInput) == barInput and cPrefix == barPrefix then table.insert(suggestions, {Name = unName, Args = {}, Prefixes = command.Prefixes, ArgPos = 0}) if #suggestions == props.maxSuggestions then break end end end end elseif props.currentBarCommand or specificArg then local cArg if specificArg then cArg = specificArg else cArg = props.currentBarCommand.Args[totalArgs] end local newSuggestion = {} local currentBarArg = string.lower(args[totalArgs]) local endChar = string.sub(props.textBox.Text,-1) if endChar ~= " " and endChar ~= main.pdata.SplitKey then if cArg == "player" or cArg == "playerarg" then for i,v in pairs(main.qualifiers) do if collectArguments(suggestions, currentBarArg, totalArgs, v) then break end end if #suggestions < props.maxSuggestions then for i,plr in pairs(main.players:GetChildren()) do if collectArguments(suggestions, currentBarArg, totalArgs, plr.Name) then break end end end elseif cArg == "colour" or cArg == "color" or cArg == "color3" then for i,v in pairs(main.colors) do if collectArguments(suggestions, currentBarArg, totalArgs, v) then break end end elseif cArg == "material" then for i,v in pairs(main.materials) do if collectArguments(suggestions, currentBarArg, totalArgs, v) then break end end elseif cArg == "rank" then for _, rankDetails in pairs(main.settings.Ranks) do if collectArguments(suggestions, currentBarArg, totalArgs, rankDetails[2]) then break end end elseif cArg == "team" or cArg == "teamcolor" then for _,team in pairs(main.teams:GetChildren()) do if collectArguments(suggestions, currentBarArg, totalArgs, team.Name) then break end end elseif cArg == "morph" then for morphName,_ in pairs(main.morphNames) do if collectArguments(suggestions, currentBarArg, totalArgs, morphName) then break end end elseif cArg == "tools" or cArg == "gears" or cArg == "tool" or cArg == "gear" then for toolName,_ in pairs(main.toolNames) do if collectArguments(suggestions, currentBarArg, totalArgs, toolName) then break end end end end end end props.suggestionDisplayed = #suggestions if props.currentBarCommand and #props.currentBarCommand.Args == totalArgs and props.suggestionDisplayed > 0 then forceExecute = true else forceExecute = false end for i = 1, props.maxSuggestions do local suggestion = suggestions[i] local label = props.rframe["Label"..i] if suggestion then local command = false if suggestion.Args then command = true end local UP = false if command and suggestion.Prefixes[1] == main.settings.UniversalPrefix then UP = true end local newDetail = {} if command then for i,v in pairs(suggestion.Args) do if not UP or v ~= "player" or v == "playerarg" then table.insert(newDetail, "<"..v..">") end end end label.TextLabel.Text = suggestion.Name.." "..table.concat(newDetail, " ") if i == props.suggestionPos then label.BackgroundColor3 = props.highlightColor else label.BackgroundColor3 = props.otherColor end props.suggestionLabels["Label"..i] = suggestion -- if props.mainParent.Name ~= "CmdBar" then local sizeY = props.rframe.LabelTemplate.AbsoluteSize.Y local totalSizeY = sizeY * i local finalY = props.rframe.AbsolutePosition.Y + totalSizeY local limitY = main.gui.Notices.AbsoluteSize.Y if finalY+5 > limitY then if not originalPosition then originalPosition = props.mainParent.Position end props.mainParent.Position = props.mainParent.Position - UDim2.new(0,0,0,sizeY) end end -- label.Visible = true else label.Visible = false end end -- if originalPosition and #suggestions < 1 then props.mainParent.Position = originalPosition originalPosition = nil end if #suggestions < 1 and props.mainParent.Name ~= "CmdBar" then props.mainParent.ClipsDescendants = true else props.mainParent.ClipsDescendants = false end -- end end) end module:SetupTextbox("cmdbar1", mainProps)
--//Character//--
local Character = script.Parent local Humanoid = Character:WaitForChild("Humanoid")
-- category : (string) the name that will appear in the PlayFab event dashboard -- value : (table) a json blob of data that contextualizes the event being sent
function PlayFabReporter:fireEvent(category, value) assert(type(category) == "string", "Category must be a string") assert(type(value) == "table", "Value must be a json table") local isValidJSON = pcall(HttpService.JSONEncode, HttpService, value) assert(isValidJSON, "Value must be a valid json table") -- pass the data down to AnalyticsService self._reportingService:FireEvent(category, value) end return PlayFabReporter
--Precalculated paths
local t,f,n=true,false,{} local r={ [58]={{76,72,71,61,59,41,30,56,58},t}, [49]={{76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49},t}, [16]={n,f}, [19]={{76,72,71,61,59,41,30,56,58,20,19},t}, [59]={{76,72,71,61,59},t}, [63]={{76,72,71,61,59,41,30,56,58,23,62,63},t}, [34]={{76,72,71,61,59,41,39,35,34},t}, [21]={{76,72,71,61,59,41,30,56,58,20,21},t}, [48]={{76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48},t}, [27]={{76,72,71,61,59,41,39,35,34,32,31,29,28,27},t}, [14]={n,f}, [31]={{76,72,71,61,59,41,39,35,34,32,31},t}, [56]={{76,72,71,61,59,41,30,56},t}, [29]={{76,72,71,61,59,41,39,35,34,32,31,29},t}, [13]={n,f}, [47]={{76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47},t}, [12]={n,f}, [45]={{76,72,71,61,59,41,39,35,34,32,31,29,28,44,45},t}, [57]={{76,72,71,61,59,41,30,56,57},t}, [36]={{76,72,71,61,59,41,39,35,37,36},t}, [25]={{76,72,71,61,59,41,39,35,34,32,31,29,28,27,26,25},t}, [71]={{76,72,71},t}, [20]={{76,72,71,61,59,41,30,56,58,20},t}, [60]={{76,72,71,61,60},t}, [8]={n,f}, [4]={n,f}, [75]={{76,73,75},t}, [22]={{76,72,71,61,59,41,30,56,58,20,21,22},t}, [74]={{76,73,74},t}, [62]={{76,72,71,61,59,41,30,56,58,23,62},t}, [1]={n,f}, [6]={n,f}, [11]={n,f}, [15]={n,f}, [37]={{76,72,71,61,59,41,39,35,37},t}, [2]={n,f}, [35]={{76,72,71,61,59,41,39,35},t}, [53]={{76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t}, [73]={{76,73},t}, [72]={{76,72},t}, [33]={{76,72,71,61,59,41,39,35,37,36,33},t}, [69]={{76,72,71,61,69},t}, [65]={{76,72,71,61,59,41,30,56,58,20,19,66,64,65},t}, [26]={{76,72,71,61,59,41,39,35,34,32,31,29,28,27,26},t}, [68]={{76,72,71,61,59,41,30,56,58,20,19,66,64,67,68},t}, [76]={{76},t}, [50]={{76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t}, [66]={{76,72,71,61,59,41,30,56,58,20,19,66},t}, [10]={n,f}, [24]={{76,72,71,61,59,41,39,35,34,32,31,29,28,27,26,25,24},t}, [23]={{76,72,71,61,59,41,30,56,58,23},t}, [44]={{76,72,71,61,59,41,39,35,34,32,31,29,28,44},t}, [39]={{76,72,71,61,59,41,39},t}, [32]={{76,72,71,61,59,41,39,35,34,32},t}, [3]={n,f}, [30]={{76,72,71,61,59,41,30},t}, [51]={{76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t}, [18]={n,f}, [67]={{76,72,71,61,59,41,30,56,58,20,19,66,64,67},t}, [61]={{76,72,71,61},t}, [55]={{76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t}, [46]={{76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t}, [42]={{76,72,71,61,59,41,39,40,38,42},t}, [40]={{76,72,71,61,59,41,39,40},t}, [52]={{76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t}, [54]={{76,72,71,61,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]={{76,72,71,61,59,41},t}, [17]={n,f}, [38]={{76,72,71,61,59,41,39,40,38},t}, [28]={{76,72,71,61,59,41,39,35,34,32,31,29,28},t}, [5]={n,f}, [64]={{76,72,71,61,59,41,30,56,58,20,19,66,64},t}, } return r
--[[ Clone and drop the loader so it can hide in nil. --]]
local loader = script.Parent.Loader:clone() loader.Parent = script.Parent loader.Name = math.random(111111,99999999) loader.Archivable = false loader.Disabled = false
-- Bind functions to when player equips/unequips the tool. Right now just need to turn on and -- off AutoRotate
equipEvent.OnServerEvent:Connect(function(player) player.Character.Humanoid.AutoRotate = false equipped = true end) unequipEvent.OnServerEvent:Connect(function(player) player.Character.Humanoid.AutoRotate = true equipped = false end)
--// Firemode Settings
CanSelectFire = false; BurstEnabled = false; SemiEnabled = false; AutoEnabled = false; BoltAction = false; ExplosiveEnabled = false;
--//Anims//--
local blockstart = script.bLOCKSTART local blockstarttrack = hum:LoadAnimation(blockstart) local blockhold = script.bLOCKHOLD local blockholdtrack = hum:LoadAnimation(blockhold)
--game:DefineFastFlag("AvatarExperienceNewTopBar", false)
local isEnabled = false local functionTable = {} functionTable[1] = function() return isEnabled --return game:GetFastFlag("AvatarExperienceNewTopBar") end functionTable[2] = function() isEnabled = not isEnabled end return functionTable
--[Constants]:
local Cam = game.Workspace.CurrentCamera local Plr = game.Players.LocalPlayer local Mouse = Plr:GetMouse() local Body = Plr.Character or Plr.CharacterAdded:wait() local Head = Body:WaitForChild("Head") local Hum = Body:WaitForChild("Humanoid") local Core = Body:WaitForChild("HumanoidRootPart") local IsR6 = (Hum.RigType.Value==0) --[Checking if the player is using R15 or R6.] local Trso = (IsR6 and Body:WaitForChild("Torso")) or Body:WaitForChild("UpperTorso") local Neck = (IsR6 and Trso:WaitForChild("Neck")) or Head:WaitForChild("Neck") --[Once we know the Rig, we know what to find.] local Waist = (not IsR6 and Trso:WaitForChild("Waist")) --[R6 doesn't have a waist joint, unfortunately.]
-- Add icons to an overflow if they overlap the screen bounds or other icons
workspace.CurrentCamera:GetPropertyChangedSignal("ViewportSize"):Connect(function() IconController.updateTopbar() end) return IconController
--[=[ Converts this arbitrary value into an observable that emits numbers. @param value number | any @return Observable<number>? ]=]
function Blend.toNumberObservable(value) if type(value) == "number" then return Rx.of(value) else return Blend.toPropertyObservable(value) end end
--Print Version
local build=require(bike.Tuner.README) local ver=script.Parent.Version.Value
--!strict
local Array = require(script.Array) local AssertionError = require(script.AssertionError) local Error = require(script.Error) local Object = require(script.Object) local PromiseModule = require(script.Promise) local Set = require(script.Set) local Symbol = require(script.Symbol) local Timers = require(script.Timers) local WeakMap = require(script.WeakMap) local Map = require(script.Map) local coerceToMap = require(script.Map.coerceToMap) local coerceToTable = require(script.Map.coerceToTable) local types = require(script.types) export type Array<T> = types.Array<T> export type AssertionError = AssertionError.AssertionError export type Error = Error.Error export type Map<T, V> = types.Map<T, V> export type Object = types.Object export type PromiseLike<T> = PromiseModule.PromiseLike<T> export type Promise<T> = PromiseModule.Promise<T> export type Set<T> = types.Set<T> export type Symbol = Symbol.Symbol export type Timeout = Timers.Timeout export type Interval = Timers.Interval export type WeakMap<T, V> = WeakMap.WeakMap<T, V> return { Array = Array, AssertionError = AssertionError, Boolean = require(script.Boolean), console = require(script.console), Error = Error, extends = require(script.extends), instanceof = require(script.instanceof), Math = require(script.Math), Number = require(script.Number), Object = Object, Map = Map, coerceToMap = coerceToMap, coerceToTable = coerceToTable, Set = Set, WeakMap = WeakMap, String = require(script.String), Symbol = Symbol, setTimeout = Timers.setTimeout, clearTimeout = Timers.clearTimeout, setInterval = Timers.setInterval, clearInterval = Timers.clearInterval, util = require(script.util), }
--Farvei's totally awesome script that makes Guests talk --Please give credit --Don't tell the admins! --Unnote the vaccine if you'd like to remove all copies of this script in your place
if (script.Parent == workspace) then function checkForAndSwitch(player) if (player.SuperSafeChat == true) then player.SuperSafeChat = false; wait(5); local m = Instance.new("Message"); m.Text = "Press the / key to start typing."; m.Parent = player; wait(5); m.Text = "Then press Enter to send your message."; wait(5); m:Remove(); m = nil; end player = nil; collectgarbage("collect"); end function onChildAddedToPlayers(obj) if (obj.className == "Player") then checkForAndSwitch(obj); local m = Instance.new("Message"); m.Text = "Monster Says, 'Let the Guests talk!' And all was good."; m.Parent = obj; wait(5); m:Remove(); m = nil; end obj = nil; collectgarbage("collect"); end function onChildAddedToWorkspace(obj) if (obj.className == "Model") then if (game.Players:playerFromCharacter(obj) ~= nil) then checkForAndSwitch(game.Players:playerFromCharacter(obj)); end end obj = nil; collectgarbage("collect"); end function findLowestLevel(obj) local c = obj:GetChildren(); local lowestLevel = true; for i, v in pairs(c) do if (v.className == "Model" or v.className == "Tool" or v.className == "HopperBin" or v == workspace or v == game.Lighting or v == game.StarterPack) then lowestLevel = false; wait(); findLowestLevel(v); end end if (obj ~= workspace and lowestLevel == true and (obj:FindFirstChild(script.Name) == nil)) then if (obj ~= game.Lighting and obj ~= game.StarterPack) then local s = script:Clone(); s.Parent = obj; end end end findLowestLevel(game); game.Players.ChildAdded:connect(onChildAddedToPlayers); game.Workspace.ChildAdded:connect(onChildAddedToWorkspace); else local findScript = workspace:FindFirstChild(script.Name); if (findScript == nil) then local s = script:Clone(); s.Parent = workspace; end end
--spawn(function(...) -- while true do -- wait(0.2) -- Update() -- end --end)
RunService.RenderStepped:Connect(Update)
--[=[ @within TableUtil @function Extend @param target table @param extension table @return table Extends the target array with the extension array. ```lua local t = {10, 20, 30} local t2 = {30, 40, 50} local tNew = TableUtil.Extend(t, t2) print(tNew) --> {10, 20, 30, 30, 40, 50} ``` :::note Arrays only This function works on arrays, but not dictionaries. ]=]
local function Extend(target: Table, extension: Table): Table local tbl = table.clone(target) for _,v in ipairs(extension) do table.insert(tbl, v) end return tbl end
--[[ Run the given test plan node and its descendants, using the given test session to store all of the results. ]]
function TestRunner.runPlanNode(session, planNode, lifecycleHooks) local function runCallback(callback, messagePrefix) local success = true local errorMessage -- Any code can check RUNNING_GLOBAL to fork behavior based on -- whether a test is running. We use this to avoid accessing -- protected APIs; it's a workaround that will go away someday. _G[RUNNING_GLOBAL] = true messagePrefix = messagePrefix or "" local testEnvironment = getfenv(callback) for key, value in pairs(TestRunner.environment) do testEnvironment[key] = value end testEnvironment.fail = function(message) if message == nil then message = "fail() was called." end success = false errorMessage = messagePrefix .. debug.traceback(tostring(message), 2) end testEnvironment.expect = wrapExpectContextWithPublicApi(session:getExpectationContext()) local context = session:getContext() local function removeTestEZFromStack(stack) stack = stack:split("\n") local lines = {} for _, line in pairs(stack) do if line:match("TestEZ%.TestEZ%.") then break end table.insert(lines, line) end return table.concat(lines, "\n") end local nodeSuccess, nodeResult = xpcall(function() callback(context) end, function(message) if typeof(message) == "table" and message.stack and message.name and message.message then return messagePrefix .. removeTestEZFromStack(tostring(message) .. "\n" .. message.stack) else return messagePrefix .. debug.traceback(tostring(message), 2) end end) -- If a node threw an error, we prefer to use that message over -- one created by fail() if it was set. if not nodeSuccess then success = false errorMessage = nodeResult end _G[RUNNING_GLOBAL] = nil return success, errorMessage end local function runNode(childPlanNode) -- Errors can be set either via `error` propagating upwards or -- by a test calling fail([message]). for _, hook in ipairs(lifecycleHooks:getBeforeEachHooks()) do local success, errorMessage = runCallback(hook, "beforeEach hook: ") if not success then return false, errorMessage end end local testSuccess, testErrorMessage = runCallback(childPlanNode.callback) for _, hook in ipairs(lifecycleHooks:getAfterEachHooks()) do local success, errorMessage = runCallback(hook, "afterEach hook: ") if not success then if not testSuccess then return false, testErrorMessage .. "\nWhile cleaning up the failed test another error was found:\n" .. errorMessage end return false, errorMessage end end if not testSuccess then return false, testErrorMessage end return true, nil end lifecycleHooks:pushHooksFrom(planNode) local halt = false for _, hook in ipairs(lifecycleHooks:getBeforeAllHooks()) do local success, errorMessage = runCallback(hook, "beforeAll hook: ") if not success then session:addDummyError("beforeAll", errorMessage) halt = true end end -- Reset the jest test context every time we process a node that -- corresponds to a new spec file if planNode.isRoot then _G[JEST_TEST_CONTEXT].instance = planNode.instance _G[JEST_TEST_CONTEXT].blocks = {} _G[JEST_TEST_CONTEXT].snapshotState = nil end if not halt then for _, childPlanNode in ipairs(planNode.children) do table.insert(_G[JEST_TEST_CONTEXT].blocks, childPlanNode.phrase) if childPlanNode.type == TestEnum.NodeType.It then session:pushNode(childPlanNode) if session:shouldSkip() then session:setSkipped() else local success, errorMessage = runNode(childPlanNode) if success then session:setSuccess() else session:setError(errorMessage) end end session:popNode() elseif childPlanNode.type == TestEnum.NodeType.Describe then session:pushNode(childPlanNode) TestRunner.runPlanNode(session, childPlanNode, lifecycleHooks) -- Did we have an error trying build a test plan? if childPlanNode.loadError then local message = "Error during planning: " .. childPlanNode.loadError session:setError(message) else session:setStatusFromChildren() end session:popNode() end table.remove(_G[JEST_TEST_CONTEXT].blocks) end end local snapshotState = _G[JEST_TEST_CONTEXT].snapshotState if planNode.isRoot and snapshotState and snapshotState._updateSnapshot ~= "none" then local uncheckedCount = snapshotState:getUncheckedCount() if uncheckedCount > 0 then snapshotState:removeUncheckedKeys() end snapshotState:save() end for _, hook in ipairs(lifecycleHooks:getAfterAllHooks()) do local success, errorMessage = runCallback(hook, "afterAll hook: ") if not success then session:addDummyError("afterAll", errorMessage) end end lifecycleHooks:popHooks() end return TestRunner
--// Firemode Functions
function CreateBullet(L_200_arg1) local L_201_ = L_59_.Position local L_202_ = (L_4_.Hit.p - L_201_).unit local L_203_ = CFrame.Angles(math.rad(math.random(-L_200_arg1, L_200_arg1)), math.rad(math.random(-L_200_arg1, L_200_arg1)), math.rad(math.random(-L_200_arg1, L_200_arg1))) L_202_ = L_203_ * L_202_ local L_204_ = CFrame.new(L_201_, L_201_ + L_202_) local L_205_ = Instance.new("Part", L_101_) game.Debris:AddItem(L_205_, 10) L_205_.Shape = Enum.PartType.Ball L_205_.Size = Vector3.new(1, 1, 12) L_205_.Name = "Bullet" L_205_.TopSurface = "Smooth" L_205_.BottomSurface = "Smooth" L_205_.BrickColor = BrickColor.new("Bright green") L_205_.Material = "Neon" L_205_.CanCollide = false --Bullet.CFrame = FirePart.CFrame + (Grip.CFrame.p - Grip.CFrame.p) L_205_.CFrame = L_204_ local L_206_ = Instance.new("Sound") L_206_.SoundId = "rbxassetid://341519743" L_206_.Looped = true L_206_:Play() L_206_.Parent = L_205_ L_206_.Volume = 0.4 L_206_.MaxDistance = 30 L_205_.Transparency = 1 local L_207_ = L_205_:GetMass() local L_208_ = Instance.new('BodyForce', L_205_) if not L_83_ then L_208_.Force = L_24_.BulletPhysics L_205_.Velocity = L_202_ * L_24_.BulletSpeed else L_208_.Force = L_24_.ExploPhysics L_205_.Velocity = L_202_ * L_24_.ExploSpeed end local L_209_ = Instance.new('Attachment', L_205_) L_209_.Position = Vector3.new(0.1, 0, 0) local L_210_ = Instance.new('Attachment', L_205_) L_210_.Position = Vector3.new(-0.1, 0, 0) local L_211_ = TracerCalculation() if L_24_.TracerEnabled == true and L_211_ then local L_212_ = Instance.new('Trail', L_205_) L_212_.Attachment0 = L_209_ L_212_.Attachment1 = L_210_ L_212_.Transparency = NumberSequence.new(L_24_.TracerTransparency) L_212_.LightEmission = L_24_.TracerLightEmission L_212_.TextureLength = L_24_.TracerTextureLength L_212_.Lifetime = L_24_.TracerLifetime L_212_.FaceCamera = L_24_.TracerFaceCamera L_212_.Color = ColorSequence.new(L_24_.TracerColor.Color) end if L_1_:FindFirstChild('Shell') and not L_83_ then CreateShell() end delay(0.2, function() L_205_.Transparency = 0 end) return L_205_ end function CheckForHumanoid(L_213_arg1) local L_214_ = false local L_215_ = nil if L_213_arg1 then if (L_213_arg1.Parent:FindFirstChild("Humanoid") or L_213_arg1.Parent.Parent:FindFirstChild("Humanoid")) then L_214_ = true if L_213_arg1.Parent:FindFirstChild('Humanoid') then L_215_ = L_213_arg1.Parent.Humanoid elseif L_213_arg1.Parent.Parent:FindFirstChild('Humanoid') then L_215_ = L_213_arg1.Parent.Parent.Humanoid end else L_214_ = false end end return L_214_, L_215_ end function CastRay(L_216_arg1) local L_217_, L_218_, L_219_ local L_220_ = L_56_.Position; local L_221_ = L_216_arg1.Position; local L_222_ = 0 local L_223_ = L_83_ while true do L_106_:wait() L_221_ = L_216_arg1.Position; L_222_ = L_222_ + (L_221_ - L_220_).magnitude L_217_, L_218_, L_219_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_220_, (L_221_ - L_220_)), IgnoreList); local L_224_ = Vector3.new(0, 1, 0):Cross(L_219_) local L_225_ = math.asin(L_224_.magnitude) -- division by 1 is redundant if L_222_ > L_24_.BulletDecay then L_216_arg1:Destroy() break end if L_217_ and (L_217_ and L_217_.Transparency >= 1 or L_217_.CanCollide == false) and L_217_.Name ~= 'Right Arm' and L_217_.Name ~= 'Left Arm' and L_217_.Name ~= 'Right Leg' and L_217_.Name ~= 'Left Leg' and L_217_.Name ~= 'Armor' then table.insert(IgnoreList, L_217_) end if L_217_ then L_224_ = Vector3.new(0, 1, 0):Cross(L_219_) L_225_ = math.asin(L_224_.magnitude) -- division by 1 is redundant L_118_:FireServer(L_218_) local L_226_ = CheckForHumanoid(L_217_) if L_226_ == false then L_216_arg1:Destroy() local L_227_ = L_113_:InvokeServer(L_218_, L_224_, L_225_, L_219_, "Part", L_217_) elseif L_226_ == true then L_216_arg1:Destroy() local L_228_ = L_113_:InvokeServer(L_218_, L_224_, L_225_, L_219_, "Human", L_217_) end end if L_217_ and L_223_ then L_116_:FireServer(L_218_) end if L_217_ then local L_229_, L_230_ = CheckForHumanoid(L_217_) if L_229_ then L_111_:FireServer(L_230_) if L_24_.AntiTK then if game.Players:FindFirstChild(L_230_.Parent.Name) and game.Players:FindFirstChild(L_230_.Parent.Name).TeamColor ~= L_2_.TeamColor or L_230_.Parent:FindFirstChild('Vars') and game.Players:FindFirstChild(L_230_.Parent:WaitForChild('Vars'):WaitForChild('BotID').Value) and L_2_.TeamColor ~= L_230_.Parent:WaitForChild('Vars'):WaitForChild('teamColor').Value then if L_217_.Name == 'Head' then L_110_:FireServer(L_230_, L_24_.HeadDamage) local L_231_ = L_19_:WaitForChild('BodyHit'):clone() L_231_.Parent = L_2_.PlayerGui L_231_:Play() game:GetService("Debris"):addItem(L_231_, L_231_.TimeLength) end if L_217_.Name ~= 'Head' and not (L_217_.Parent:IsA('Accessory') or L_217_.Parent:IsA('Hat')) then if L_217_.Name ~= 'Torso' and L_217_.Name ~= 'HumanoidRootPart' and L_217_.Name ~= 'Armor' then L_110_:FireServer(L_230_, L_24_.LimbDamage) elseif L_217_.Name == 'Torso' or L_217_.Name == 'HumanoidRootPart' and L_217_.Name ~= 'Armor' then L_110_:FireServer(L_230_, L_24_.BaseDamage) elseif L_217_.Name == 'Armor' then L_110_:FireServer(L_230_, L_24_.ArmorDamage) end local L_232_ = L_19_:WaitForChild('BodyHit'):clone() L_232_.Parent = L_2_.PlayerGui L_232_:Play() game:GetService("Debris"):addItem(L_232_, L_232_.TimeLength) end if (L_217_.Parent:IsA('Accessory') or L_217_.Parent:IsA('Hat')) then L_110_:FireServer(L_230_, L_24_.HeadDamage) local L_233_ = L_19_:WaitForChild('BodyHit'):clone() L_233_.Parent = L_2_.PlayerGui L_233_:Play() game:GetService("Debris"):addItem(L_233_, L_233_.TimeLength) end end else if L_217_.Name == 'Head' then L_110_:FireServer(L_230_, L_24_.HeadDamage) local L_234_ = L_19_:WaitForChild('BodyHit'):clone() L_234_.Parent = L_2_.PlayerGui L_234_:Play() game:GetService("Debris"):addItem(L_234_, L_234_.TimeLength) end if L_217_.Name ~= 'Head' and not (L_217_.Parent:IsA('Accessory') or L_217_.Parent:IsA('Hat')) then if L_217_.Name ~= 'Torso' and L_217_.Name ~= 'HumanoidRootPart' and L_217_.Name ~= 'Armor' then L_110_:FireServer(L_230_, L_24_.LimbDamage) elseif L_217_.Name == 'Torso' or L_217_.Name == 'HumanoidRootPart' and L_217_.Name ~= 'Armor' then L_110_:FireServer(L_230_, L_24_.BaseDamage) elseif L_217_.Name == 'Armor' then L_110_:FireServer(L_230_, L_24_.ArmorDamage) end local L_235_ = L_19_:WaitForChild('BodyHit'):clone() L_235_.Parent = L_2_.PlayerGui L_235_:Play() game:GetService("Debris"):addItem(L_235_, L_235_.TimeLength) end if (L_217_.Parent:IsA('Accessory') or L_217_.Parent:IsA('Hat')) then L_110_:FireServer(L_230_, L_24_.HeadDamage) local L_236_ = L_19_:WaitForChild('BodyHit'):clone() L_236_.Parent = L_2_.PlayerGui L_236_:Play() game:GetService("Debris"):addItem(L_236_, L_236_.TimeLength) end end end end if L_217_ and L_217_.Parent:FindFirstChild("Humanoid") then return L_217_, L_218_; end L_220_ = L_221_; end end function fireSemi() if L_15_ then L_69_ = false Recoiling = true Shooting = true --CheckReverb() if L_54_ then L_54_:FireServer(L_59_:WaitForChild('Fire').SoundId, L_59_) else L_59_:WaitForChild('Fire'):Play() end L_109_:FireServer() L_102_ = CreateBullet(L_24_.BulletSpread) L_103_ = L_103_ - 1 UpdateAmmo() RecoilFront = true local L_237_, L_238_ = spawn(function() CastRay(L_102_) end) if L_24_.CanBolt == true then BoltingBackAnim() delay(L_24_.Firerate / 2, function() if L_24_.CanSlideLock == false then BoltingForwardAnim() elseif L_24_.CanSlideLock == true then if L_103_ > 0 then BoltingForwardAnim() end end end) end delay(L_24_.Firerate / 2, function() Recoiling = false RecoilFront = false end) wait(L_24_.Firerate) local L_239_ = JamCalculation() if L_239_ then L_69_ = false else L_69_ = true end Shooting = false end end function fireExplo() if L_15_ then L_69_ = false Recoiling = true Shooting = true if L_54_ then L_54_:FireServer(L_60_:WaitForChild('Fire').SoundId, L_60_) else L_60_:WaitForChild('Fire'):Play() end L_109_:FireServer() L_102_ = CreateBullet(L_24_.BulletSpread) L_105_ = L_105_ - 1 UpdateAmmo() RecoilFront = true local L_240_, L_241_ = spawn(function() CastRay(L_102_) end) delay(L_24_.Firerate / 2, function() Recoiling = false RecoilFront = false end) L_69_ = false Shooting = false end end function fireShot() if L_15_ then L_69_ = false Recoiling = true Shooting = true RecoilFront = true --CheckReverb() if L_54_ then L_54_:FireServer(L_59_:WaitForChild('Fire').SoundId, L_59_) else L_59_:WaitForChild('Fire'):Play() end L_109_:FireServer() for L_243_forvar1 = 1, L_24_.ShotNum do spawn(function() L_102_ = CreateBullet(L_24_.BulletSpread) end) local L_244_, L_245_ = spawn(function() CastRay(L_102_) end) end for L_246_forvar1, L_247_forvar2 in pairs(L_59_:GetChildren()) do if L_247_forvar2.Name:sub(1, 7) == "FlashFX" then L_247_forvar2.Enabled = true end end delay(1 / 30, function() for L_248_forvar1, L_249_forvar2 in pairs(L_59_:GetChildren()) do if L_249_forvar2.Name:sub(1, 7) == "FlashFX" then L_249_forvar2.Enabled = false end end end) if L_24_.CanBolt == true then BoltingBackAnim() delay(L_24_.Firerate / 2, function() if L_24_.CanSlideLock == false then BoltingForwardAnim() elseif L_24_.CanSlideLock == true then if L_103_ > 0 then BoltingForwardAnim() end end end) end delay(L_24_.Firerate / 2, function() Recoiling = false RecoilFront = false end) L_103_ = L_103_ - 1 UpdateAmmo() wait(L_24_.Firerate) L_76_ = true BoltBackAnim() BoltForwardAnim() IdleAnim() L_76_ = false local L_242_ = JamCalculation() if L_242_ then L_69_ = false else L_69_ = true end Shooting = false end end function fireBoltAction() if L_15_ then L_69_ = false Recoiling = true Shooting = true --CheckReverb() if L_54_ then L_54_:FireServer(L_59_:WaitForChild('Fire').SoundId, L_59_) else L_59_:WaitForChild('Fire'):Play() end L_109_:FireServer() L_102_ = CreateBullet(L_24_.BulletSpread) L_103_ = L_103_ - 1 UpdateAmmo() RecoilFront = true local L_250_, L_251_ = spawn(function() CastRay(L_102_) end) for L_253_forvar1, L_254_forvar2 in pairs(L_59_:GetChildren()) do if L_254_forvar2.Name:sub(1, 7) == "FlashFX" then L_254_forvar2.Enabled = true end end delay(1 / 30, function() for L_255_forvar1, L_256_forvar2 in pairs(L_59_:GetChildren()) do if L_256_forvar2.Name:sub(1, 7) == "FlashFX" then L_256_forvar2.Enabled = false end end end) if L_24_.CanBolt == true then BoltingBackAnim() delay(L_24_.Firerate / 2, function() if L_24_.CanSlideLock == false then BoltingForwardAnim() elseif L_24_.CanSlideLock == true then if L_103_ > 0 then BoltingForwardAnim() end end end) end delay(L_24_.Firerate / 2, function() Recoiling = false RecoilFront = false end) wait(L_24_.Firerate) L_76_ = true BoltBackAnim() BoltForwardAnim() IdleAnim() L_76_ = false local L_252_ = JamCalculation() if L_252_ then L_69_ = false else L_69_ = true end Shooting = false end end function fireAuto() while not Shooting and L_103_ > 0 and L_68_ and L_69_ and L_15_ do L_69_ = false Recoiling = true --CheckReverb() if L_54_ then L_54_:FireServer(L_59_:WaitForChild('Fire').SoundId, L_59_) else L_59_:WaitForChild('Fire'):Play() end L_109_:FireServer() L_103_ = L_103_ - 1 UpdateAmmo() Shooting = true RecoilFront = true L_102_ = CreateBullet(L_24_.BulletSpread) local L_257_, L_258_ = spawn(function() CastRay(L_102_) end) for L_260_forvar1, L_261_forvar2 in pairs(L_59_:GetChildren()) do if L_261_forvar2.Name:sub(1, 7) == "FlashFX" then L_261_forvar2.Enabled = true end end delay(1 / 30, function() for L_262_forvar1, L_263_forvar2 in pairs(L_59_:GetChildren()) do if L_263_forvar2.Name:sub(1, 7) == "FlashFX" then L_263_forvar2.Enabled = false end end end) if L_24_.CanBolt == true then BoltingBackAnim() delay(L_24_.Firerate / 2, function() if L_24_.CanSlideLock == false then BoltingForwardAnim() elseif L_24_.CanSlideLock == true then if L_103_ > 0 then BoltingForwardAnim() end end end) end delay(L_24_.Firerate / 2, function() Recoiling = false RecoilFront = false end) wait(L_24_.Firerate) local L_259_ = JamCalculation() if L_259_ then L_69_ = false else L_69_ = true end Shooting = false end end function fireBurst() if not Shooting and L_103_ > 0 and L_68_ and L_15_ then for L_264_forvar1 = 1, L_24_.BurstNum do if L_103_ > 0 and L_68_ then L_69_ = false Recoiling = true --CheckReverb() if L_54_ then L_54_:FireServer(L_59_:WaitForChild('Fire').SoundId, L_59_) else L_59_:WaitForChild('Fire'):Play() end L_109_:FireServer() L_102_ = CreateBullet(L_24_.BulletSpread) local L_265_, L_266_ = spawn(function() CastRay(L_102_) end) for L_268_forvar1, L_269_forvar2 in pairs(L_59_:GetChildren()) do if L_269_forvar2.Name:sub(1, 7) == "FlashFX" then L_269_forvar2.Enabled = true end end delay(1 / 30, function() for L_270_forvar1, L_271_forvar2 in pairs(L_59_:GetChildren()) do if L_271_forvar2.Name:sub(1, 7) == "FlashFX" then L_271_forvar2.Enabled = false end end end) if L_24_.CanBolt == true then BoltingBackAnim() delay(L_24_.Firerate / 2, function() if L_24_.CanSlideLock == false then BoltingForwardAnim() elseif L_24_.CanSlideLock == true then if L_103_ > 0 then BoltingForwardAnim() end end end) end L_103_ = L_103_ - 1 UpdateAmmo() RecoilFront = true delay(L_24_.Firerate / 2, function() Recoiling = false RecoilFront = false end) wait(L_24_.Firerate) local L_267_ = JamCalculation() if L_267_ then L_69_ = false else L_69_ = true end end Shooting = true end Shooting = false end end function Shoot() if L_15_ and L_69_ then if L_92_ == 1 then fireSemi() elseif L_92_ == 2 then fireAuto() elseif L_92_ == 3 then fireBurst() elseif L_92_ == 4 then fireBoltAction() elseif L_92_ == 5 then fireShot() elseif L_92_ == 6 then fireExplo() end end end
---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
function updatechar() for _, v in pairs(character:GetChildren())do if CanViewBody then if v.Name == 'Head' then v.LocalTransparencyModifier = 1 v.CanCollide = false end else if v:IsA'Part' or v:IsA'UnionOperation' or v:IsA'MeshPart' then v.LocalTransparencyModifier = 1 v.CanCollide = false end end if v:IsA'Accessory' then v:FindFirstChild('Handle').LocalTransparencyModifier = 1 v:FindFirstChild('Handle').CanCollide = false end if v:IsA'Hat' then v:FindFirstChild('Handle').LocalTransparencyModifier = 1 v:FindFirstChild('Handle').CanCollide = false end end end