prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
-- ROBLOX deviation: wrap in function to pass jests methods (it, describe, etc)
local each = function(jestMethods_: Object?) local jestMethods = (if jestMethods_ ~= nil then jestMethods_ else {}) :: Object --[[ ROBLOX deviation START: TestEZ it/test/describe are functions, make them callable objects to handle them the same way as jest's API and support both. ]] Array.forEach(Object.keys(jestMethods), function(key) local maybeMethod = jestMethods[key] jestMethods[key] = if typeof(maybeMethod) == "function" then setmetatable({}, { __call = function(_self, ...) return maybeMethod(...) end, }) else maybeMethod end) -- ROBLOX deviation END return setmetatable({ withGlobal = function(g: Global) return function(table_: Global_EachTable, ...) return install(g, maybeHandleTemplateString(table_), ...) end end, }, { __call = function(_self, table_: Global_EachTable, ...): ReturnType<typeof(install)> -- ROBLOX deviation: jestMethods, are passed as parameters, not taken from global return install(jestMethods :: Global, maybeHandleTemplateString(table_), ...) end, }) end exports.bind = bind exports.default = each exports.NIL = NIL return exports
--HumanoidRootPart.Velocity = Velocity
script:Destroy()
--[[ Script Variables ]]
-- while not Players.LocalPlayer do wait() end local LocalPlayer = Players.LocalPlayer local DPadFrame = nil local TouchObject = nil local OnInputEnded = nil -- defined in Create()
--/Other
module.EnableLaser = true module.EnableFlashlight = false module.InfraRed = false
-- SETTINGS
local brakeColor_on = BrickColor.new("Really red") local brakeColor_off = BrickColor.new("Reddish brown") local lightColor_on = BrickColor.new("Institutional white") local lightColor_off = light_L.BrickColor print("headlight off color will be " .. lightColor_off.Name) local smokeOpacity_throttleOn = 0.5 local smokeOpacity_throttleOff = 0.1 local fireSize_big = 7 local fireSize_small = 3 function seatChildAddedHandler(child) if child.Name=="SeatWeld" then print("Turn car ON") driverInSeat = true smoke.Enabled = true smoke.Opacity = smokeOpacity_throttleOff light_L.BrickColor = lightColor_on light_R.BrickColor = lightColor_on fire.Size = fireSize_big fire.Enabled = true wait(0.3) fire.Size = fireSize_small if seat.Throttle==0 then fire.Enabled = false end end end function seatChildRemovedHandler(child) if child.Name=="SeatWeld" then print("Turn car OFF") driverInSeat = false smoke.Enabled = false light_L.BrickColor = lightColor_off light_R.BrickColor = lightColor_off end end function showBigFire() fire.Size = fireSize_big fire.Enabled = true wait(0.3) if seat.Throttle==1 then fire.Size = fireSize_small end wait(1) if seat.Throttle==1 then fire.Enabled = false end end local tiltForce = 84000 local tiltTime = 1 function tiltJeepBack() print("tiltJeepBack()") wait(tiltTime) end function tiltJeepForward() print("tiltJeepForward()") wait(tiltTime) end function seatChangedHandler(prop) if prop=="Throttle" then if seat.Throttle==1 then -- Throttle Forward brake_L.BrickColor = brakeColor_off brake_R.BrickColor = brakeColor_off smoke.Opacity = smokeOpacity_throttleOn local co = coroutine.create(showBigFire) coroutine.resume(co) local co2 = coroutine.create(tiltJeepBack) coroutine.resume(co2) elseif seat.Throttle==0 then -- Throttle Off brake_L.BrickColor = brakeColor_on brake_R.BrickColor = brakeColor_on smoke.Opacity = smokeOpacity_throttleOff fire.Enabled = false wait(0.9) if brake_L.BrickColor==brakeColor_on then brake_L.BrickColor = brakeColor_off end if brake_R.BrickColor==brakeColor_on then brake_R.BrickColor = brakeColor_off end elseif seat.Throttle==-1 then -- Throttle Reverse brake_L.BrickColor = lightColor_on brake_R.BrickColor = lightColor_on smoke.Opacity = smokeOpacity_throttleOff fire.Enabled = false local co = coroutine.create(tiltJeepForward) coroutine.resume(co) end end end
--Put in Starter Characater Script
local Human = script.Parent:WaitForChild("Humanoid") local LastHealth = Human.Health Human.Changed:Connect(function() if Human.Health > LastHealth then LastHealth = Human.Health end if Human.Health < LastHealth and LastHealth > 30 then LastHealth = Human.Health local Tracks = script:GetChildren() local RandomTracks = math.random(1,#Tracks) local ChosenTrack = Tracks[RandomTracks] if ChosenTrack ~= nil then ChosenTrack:play() end end end)
-- move back UI --
titleStart = {} titleStart.Position = UDim2.new(-1, 0, 0, 0) soloStart = {} soloStart.Position = UDim2.new(-1, 0, 0.4, 0) customizeStart = {} customizeStart.Position = UDim2.new(-1, 0 , 0.55, 0) achievementsStart = {} achievementsStart.Position = UDim2.new(-1, 0 , 0.7, 0) settingsStart = {} settingsStart.Position = UDim2.new(-1, 0 , 0.85, 0) backStart = {} backStart.Position = UDim2.new(0.5, 0, 0.85, 0)
-- How many times per second the gun can fire
local FireRate = 1 / 1.25
--[[function Global:SyncMemberWithClient(object,memberName,value,player) if player then game.ReplicatedStorage.PublicMembers.SyncMember:FireClient(player,object,memberName,value) else game.ReplicatedStorage.PublicMembers.SyncMember:FireAllClients(object,memberName,value) end end]]
return Global
--[[ The Module ]]
-- local TransparencyController = {} TransparencyController.__index = TransparencyController function TransparencyController.new() local self = setmetatable({}, TransparencyController) self.lastUpdate = tick() self.transparencyDirty = false self.enabled = false self.lastTransparency = nil self.descendantAddedConn, self.descendantRemovingConn = nil, nil self.toolDescendantAddedConns = {} self.toolDescendantRemovingConns = {} self.cachedParts = {} return self end function TransparencyController:HasToolAncestor(object: Instance) if object.Parent == nil then return false end return object.Parent:IsA('Tool') or self:HasToolAncestor(object.Parent) end function TransparencyController:IsValidPartToModify(part: BasePart) if part:IsA('BasePart') or part:IsA('Decal') then return not self:HasToolAncestor(part) end return false end function TransparencyController:CachePartsRecursive(object) if object then if self:IsValidPartToModify(object) then self.cachedParts[object] = true self.transparencyDirty = true end for _, child in pairs(object:GetChildren()) do self:CachePartsRecursive(child) end end end function TransparencyController:TeardownTransparency() for child, _ in pairs(self.cachedParts) do child.LocalTransparencyModifier = 0 end self.cachedParts = {} self.transparencyDirty = true self.lastTransparency = nil if self.descendantAddedConn then self.descendantAddedConn:disconnect() self.descendantAddedConn = nil end if self.descendantRemovingConn then self.descendantRemovingConn:disconnect() self.descendantRemovingConn = nil end for object, conn in pairs(self.toolDescendantAddedConns) do conn:Disconnect() self.toolDescendantAddedConns[object] = nil end for object, conn in pairs(self.toolDescendantRemovingConns) do conn:Disconnect() self.toolDescendantRemovingConns[object] = nil end end function TransparencyController:SetupTransparency(character) self:TeardownTransparency() if self.descendantAddedConn then self.descendantAddedConn:disconnect() end self.descendantAddedConn = character.DescendantAdded:Connect(function(object) -- This is a part we want to invisify if self:IsValidPartToModify(object) then self.cachedParts[object] = true self.transparencyDirty = true -- There is now a tool under the character elseif object:IsA('Tool') then if self.toolDescendantAddedConns[object] then self.toolDescendantAddedConns[object]:Disconnect() end self.toolDescendantAddedConns[object] = object.DescendantAdded:Connect(function(toolChild) self.cachedParts[toolChild] = nil if toolChild:IsA('BasePart') or toolChild:IsA('Decal') then -- Reset the transparency toolChild.LocalTransparencyModifier = 0 end end) if self.toolDescendantRemovingConns[object] then self.toolDescendantRemovingConns[object]:disconnect() end self.toolDescendantRemovingConns[object] = object.DescendantRemoving:Connect(function(formerToolChild) wait() -- wait for new parent if character and formerToolChild and formerToolChild:IsDescendantOf(character) then if self:IsValidPartToModify(formerToolChild) then self.cachedParts[formerToolChild] = true self.transparencyDirty = true end end end) end end) if self.descendantRemovingConn then self.descendantRemovingConn:disconnect() end self.descendantRemovingConn = character.DescendantRemoving:connect(function(object) if self.cachedParts[object] then self.cachedParts[object] = nil -- Reset the transparency object.LocalTransparencyModifier = 0 end end) self:CachePartsRecursive(character) end function TransparencyController:Enable(enable: boolean) if self.enabled ~= enable then self.enabled = enable self:Update() end end function TransparencyController:SetSubject(subject) local character = nil if subject and subject:IsA("Humanoid") then character = subject.Parent end if subject and subject:IsA("VehicleSeat") and subject.Occupant then character = subject.Occupant.Parent end if character then self:SetupTransparency(character) else self:TeardownTransparency() end end function TransparencyController:Update() local instant = false local now = tick() local currentCamera = workspace.CurrentCamera if currentCamera then local transparency = 0 if not self.enabled then instant = true else local distance = (currentCamera.Focus.p - currentCamera.CoordinateFrame.p).magnitude transparency = (distance<2) and (1.0-(distance-0.5)/1.5) or 0 --(7 - distance) / 5 if transparency < 0.5 then transparency = 0 end if self.lastTransparency then local deltaTransparency = transparency - self.lastTransparency -- Don't tween transparency if it is instant or your character was fully invisible last frame if not instant and transparency < 1 and self.lastTransparency < 0.95 then local maxDelta = MAX_TWEEN_RATE * (now - self.lastUpdate) deltaTransparency = math.clamp(deltaTransparency, -maxDelta, maxDelta) end transparency = self.lastTransparency + deltaTransparency else self.transparencyDirty = true end transparency = math.clamp(Util.Round(transparency, 2), 0, 1) end if self.transparencyDirty or self.lastTransparency ~= transparency then for child, _ in pairs(self.cachedParts) do child.LocalTransparencyModifier = transparency end self.transparencyDirty = false self.lastTransparency = transparency end end self.lastUpdate = now end return TransparencyController
--[[ Packs an array of numbers into a given animatable data type. If the type is not animatable, nil will be returned. FUTURE: When Luau supports singleton types, those could be used in conjunction with intersection types to make this function fully statically type checkable. ]]
local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local Oklab = require(Package.Colour.Oklab) local function packType(numbers: {number}, typeString: string): PubTypes.Animatable? if typeString == "number" then return numbers[1] elseif typeString == "CFrame" then return CFrame.new(numbers[1], numbers[2], numbers[3]) * CFrame.fromAxisAngle( Vector3.new(numbers[4], numbers[5], numbers[6]).Unit, numbers[7] ) elseif typeString == "Color3" then return Oklab.from( Vector3.new(numbers[1], numbers[2], numbers[3]), false ) elseif typeString == "ColorSequenceKeypoint" then return ColorSequenceKeypoint.new( numbers[4], Oklab.from( Vector3.new(numbers[1], numbers[2], numbers[3]), false ) ) elseif typeString == "DateTime" then return DateTime.fromUnixTimestampMillis(numbers[1]) elseif typeString == "NumberRange" then return NumberRange.new(numbers[1], numbers[2]) elseif typeString == "NumberSequenceKeypoint" then return NumberSequenceKeypoint.new(numbers[2], numbers[1], numbers[3]) elseif typeString == "PhysicalProperties" then return PhysicalProperties.new(numbers[1], numbers[2], numbers[3], numbers[4], numbers[5]) elseif typeString == "Ray" then return Ray.new( Vector3.new(numbers[1], numbers[2], numbers[3]), Vector3.new(numbers[4], numbers[5], numbers[6]) ) elseif typeString == "Rect" then return Rect.new(numbers[1], numbers[2], numbers[3], numbers[4]) elseif typeString == "Region3" then -- FUTURE: support rotated Region3s if/when they become constructable local position = Vector3.new(numbers[1], numbers[2], numbers[3]) local halfSize = Vector3.new(numbers[4] / 2, numbers[5] / 2, numbers[6] / 2) return Region3.new(position - halfSize, position + halfSize) elseif typeString == "Region3int16" then return Region3int16.new( Vector3int16.new(numbers[1], numbers[2], numbers[3]), Vector3int16.new(numbers[4], numbers[5], numbers[6]) ) elseif typeString == "UDim" then return UDim.new(numbers[1], numbers[2]) elseif typeString == "UDim2" then return UDim2.new(numbers[1], numbers[2], numbers[3], numbers[4]) elseif typeString == "Vector2" then return Vector2.new(numbers[1], numbers[2]) elseif typeString == "Vector2int16" then return Vector2int16.new(numbers[1], numbers[2]) elseif typeString == "Vector3" then return Vector3.new(numbers[1], numbers[2], numbers[3]) elseif typeString == "Vector3int16" then return Vector3int16.new(numbers[1], numbers[2], numbers[3]) else return nil end end return packType
------------------------------------------------------------
local TwinService = game:GetService("TweenService") local AnimationHighLight = TweenInfo.new(1, Enum.EasingStyle.Sine ,Enum.EasingDirection.InOut) local Info1 = {Position = Vector3.new(pos1,Positionn,pos3)} local Info2 = {Position = Vector3.new(pos1,Positionn2,pos3)} local AnimkaUp = TwinService:Create(Danger, AnimationHighLight, Info1 ) local AnimkaDown = TwinService:Create(Danger, AnimationHighLight, Info2 ) while true do AnimkaDown:Play() wait(2) AnimkaUp:Play() wait(2) end
--[[Engine]]
local fFD = _Tune.FinalDrive*_Tune.FDMult --Horsepower Curve local fgc_h=_Tune.Horsepower/100 local fgc_n=_Tune.PeakRPM/1000 local fgc_a=_Tune.PeakSharpness local fgc_c=_Tune.CurveMult function FGC(x) x=x/1000 return (((-(x-fgc_n)^2)*math.min(fgc_h/(fgc_n^2),fgc_c^(fgc_n/fgc_h)))+fgc_h)*(x-((x^fgc_a)/((fgc_a*fgc_n)^(fgc_a-1)))) end local PeakFGC = FGC(_Tune.PeakRPM) --Plot Current Horsepower local cGrav = workspace.Gravity/32.2 function GetCurve(x) local hp=math.max((FGC(x)*_Tune.Horsepower)/PeakFGC,0) local iComp =(car.DriveSeat.CFrame.lookVector.y)*_Tune.InclineComp*cGrav if _CGear==-1 then iComp=-iComp end return hp,hp*(_Tune.EqPoint/x)*_Tune.Ratios[_CGear+2]*fFD*math.max(1,(1+iComp))*hpScaling end --Powertrain function Engine() --Neutral Gear if _CGear==0 then _ClutchOn = false end --Car Is Off local revMin = _Tune.IdleRPM if not _IsOn then revMin = 0 _CGear = 0 _ClutchOn = false _GThrot = _Tune.IdleThrottle/100 end --Determine RPM local maxSpin=0 for i,v in pairs(Drive) do if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end end if _ClutchOn then local aRPM = math.max(math.min(maxSpin*_Tune.Ratios[_CGear+2]*fFD*30/math.pi,_Tune.Redline+100),revMin) local clutchP = math.min(math.abs(aRPM-_RPM)/_Tune.ClutchTol,.9) _RPM = _RPM*clutchP + aRPM*(1-clutchP) _HP,_OutTorque = GetCurve(_RPM) else if _GThrot-(_Tune.IdleThrottle/100)>0 then _RPM = math.min(_RPM+_Tune.RevAccel*_GThrot,_Tune.Redline+100) else _RPM = math.max(_RPM-_Tune.RevDecay,revMin) end _OutTorque = 0 end --Rev Limiter local spLimit = 0 if _RPM>_Tune.Redline then if _CGear<#_Tune.Ratios-2 then _RPM = _RPM-_Tune.RevBounce spLimit = 0 else _RPM = _RPM-_Tune.RevBounce*.5 end else spLimit = (_Tune.Redline+100)*math.pi/(30*_Tune.Ratios[_CGear+2]*fFD) end --Automatic Transmission if _TMode == "Auto" and _IsOn then _ClutchOn = true if _CGear == 0 then _CGear = 1 end if _CGear >= 1 then if _CGear==1 and _GBrake > 0 and car.DriveSeat.Velocity.Magnitude < 20 then _CGear = -1 else if _Tune.AutoShiftMode == "RPM" then if _RPM>(_Tune.PeakRPM+_Tune.AutoUpThresh) then _CGear=math.min(_CGear+1,#_Tune.Ratios-2) elseif math.max(math.min(maxSpin*_Tune.Ratios[_CGear+1]*fFD*30/math.pi,_Tune.Redline+100),_Tune.IdleRPM)<(_Tune.PeakRPM-_Tune.AutoDownThresh) then _CGear=math.max(_CGear-1,1) end else if car.DriveSeat.Velocity.Magnitude > math.ceil(wDia*math.pi*(_Tune.PeakRPM+_Tune.AutoUpThresh)/60/_Tune.Ratios[_CGear+2]/fFD) then _CGear=math.min(_CGear+1,#_Tune.Ratios-2) elseif car.DriveSeat.Velocity.Magnitude < math.ceil(wDia*math.pi*(_Tune.PeakRPM-_Tune.AutoDownThresh)/60/_Tune.Ratios[_CGear+1]/fFD) then _CGear=math.max(_CGear-1,1) end end end else if _GThrot-(_Tune.IdleThrottle/100) > 0 and car.DriveSeat.Velocity.Magnitude < 20 then _CGear = 1 end end end --Average Rotational Speed Calculation local fwspeed=0 local fwcount=0 local rwspeed=0 local rwcount=0 for i,v in pairs(car.Wheels:GetChildren()) do if v.Name=="FL" or v.Name=="FR" or v.Name == "F" then fwspeed=fwspeed+v.RotVelocity.Magnitude fwcount=fwcount+1 elseif v.Name=="RL" or v.Name=="RR" or v.Name == "R" then rwspeed=rwspeed+v.RotVelocity.Magnitude rwcount=rwcount+1 end end fwspeed=fwspeed/fwcount rwspeed=rwspeed/rwcount local cwspeed=(fwspeed+rwspeed)/2 --Update Wheels for i,v in pairs(car.Wheels:GetChildren()) do --Reference Wheel Orientation local Ref=(CFrame.new(v.Position-((v.Arm.CFrame*CFrame.Angles(math.pi/2,-math.pi/2,0)).lookVector),v.Position)*CFrame.Angles(0,math.pi,0)).lookVector local aRef=1 local diffMult=1 if v.Name=="FL" or v.Name=="RL" then aRef=-1 end --AWD Torque Scaling if _Tune.Config == "AWD" then _OutTorque = _OutTorque*(2^.5)/2 end --Differential/Torque-Vectoring if v.Name=="FL" or v.Name=="FR" then diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-fwspeed)/fwspeed)/(math.max(_Tune.FDiffSlipThres,1)/100))*((_Tune.FDiffLockThres-50)/50)))) if _Tune.Config == "AWD" then diffMult=math.max(0,math.min(1,diffMult*(1+((((fwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50))))) end elseif v.Name=="RL" or v.Name=="RR" then diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-rwspeed)/rwspeed)/(math.max(_Tune.RDiffSlipThres,1)/100))*((_Tune.RDiffLockThres-50)/50)))) if _Tune.Config == "AWD" then diffMult=math.max(0,math.min(1,diffMult*(1+((((rwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50))))) end end _TCSActive = false _ABSActive = false --Output if _PBrake and ((_Tune.Config ~= "FWD" and (((v.Name=="FL" or v.Name=="FR") and car.DriveSeat.Velocity.Magnitude<20) or ((v.Name=="RR" or v.Name=="RL") and car.DriveSeat.Velocity.Magnitude>=20))) or (_Tune.Config == "FWD" and (v.Name=="RR" or v.Name=="RL"))) then --PBrake if v["#AV"]:IsA("BodyAngularVelocity") then v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*PBrakeForce v["#AV"].angularvelocity=Vector3.new() else v["#AV"].MotorMaxTorque=PBrakeForce v["#AV"].AngularVelocity=0 end else --Apply Power if ((_TMode == "Manual" or _TMode == "Semi") and _GBrake==0) or (_TMode == "Auto" and ((_CGear>-1 and _GBrake==0 ) or (_CGear==-1 and _GThrot-(_Tune.IdleThrottle/100)==0 )))then local driven = false for _,a in pairs(Drive) do if a==v then driven = true end end if driven then local on=1 if not script.Parent.IsOn.Value then on=0 end local throt = _GThrot if _TMode == "Auto" and _CGear==-1 then throt = _GBrake end --Apply TCS local tqTCS = 1 if _TCS then tqTCS = 1-(math.min(math.max(0,math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.TCSThreshold)/_Tune.TCSGradient,1)*(1-(_Tune.TCSLimit/100))) end if tqTCS < 1 then _TCSActive = true end --Update Forces local dir = 1 if _CGear==-1 then dir = -1 end if v["#AV"]:IsA("BodyAngularVelocity") then v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*_OutTorque*(1+(v.RotVelocity.Magnitude/60)^1.15)*throt*tqTCS*diffMult*on v["#AV"].angularvelocity=Ref*aRef*spLimit*dir else if v.Name=="FR" or v.Name=="RR" then dir=-dir end v["#AV"].MotorMaxTorque =_OutTorque*(1+(v.RotVelocity.Magnitude/60)^1.15)*throt*tqTCS*diffMult*on v["#AV"].AngularVelocity=spLimit*dir end else if v["#AV"]:IsA("BodyAngularVelocity") then v["#AV"].maxTorque=Vector3.new() v["#AV"].angularvelocity=Vector3.new() else v["#AV"].MotorMaxTorque=0 v["#AV"].AngularVelocity=0 end end --Brakes else local brake = _GBrake if _TMode == "Auto" and _CGear==-1 then brake = _GThrot end --Apply ABS local tqABS = 1 if _ABS and math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.ABSThreshold>0 then tqABS = 0 end if tqABS < 1 then _ABSActive = true end --Update Forces if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then if v["#AV"]:IsA("BodyAngularVelocity") then v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*FBrakeForce*brake*tqABS else v["#AV"].MotorMaxTorque=FBrakeForce*brake*tqABS end else if v["#AV"]:IsA("BodyAngularVelocity") then v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*RBrakeForce*brake*tqABS else v["#AV"].MotorMaxTorque=RBrakeForce*brake*tqABS end end if v["#AV"]:IsA("BodyAngularVelocity") then v["#AV"].angularvelocity=Vector3.new() else v["#AV"].AngularVelocity=0 end end end end end
--| Object |--
local Access = Replicated.Access local Anims = Access.Animations local Remotes = Access.Remotes local State = script.Parent:WaitForChild("State")
----------------- --| Constants |-- -----------------
local GRAVITY_ACCELERATION = workspace.Gravity local RELOAD_TIME = 3 -- Seconds until tool can be used again local ROCKET_SPEED = 175 -- Speed of the projectile local MISSILE_MESH_ID = 'http://www.roblox.com/asset/?id=2251534' local MISSILE_MESH_SCALE = Vector3.new(0.35, 0.35, 0.25) local ROCKET_PART_SIZE = Vector3.new(1.2, 1.2, 3.27)
--Var
local ModuleCollection = {} local Modules = {} local StartQueue = {}
--//Remote Functions\\--
fire.OnServerEvent:Connect(function(player, mouseHit) local character = player.Character local humanoid = character:FindFirstChild("Humanoid") local weaponAccuracy = Vector3.new(math.random(-accuracy.Value * 2, accuracy.Value * 2), math.random(-accuracy.Value * 2, accuracy.Value * 2), math.random(-accuracy.Value * 2, accuracy.Value * 2)) if humanoid and humanoid ~= 0 then local projectile = Instance.new("Part", workspace) local trail = Instance.new("Trail", projectile) trail.FaceCamera = true trail.Lifetime = 0.3 trail.MinLength = 0.15 trail.LightEmission = 0.25 local attachment0 = Instance.new("Attachment", projectile) attachment0.Position = Vector3.new(0.35, 0, 0) attachment0.Name = "Attachment1" local attachment1 = Instance.new("Attachment", projectile) attachment1.Position = Vector3.new(-0.35, 0, 0) attachment1.Name = "Attachment1" trail.Attachment0 = attachment0 trail.Attachment1 = attachment1 projectile.Name = "Bullet" projectile.BrickColor = BrickColor.new("Smoky gray") projectile.Shape = "Ball" projectile.Material = Enum.Material.Metal projectile.TopSurface = 0 projectile.BottomSurface = 0 projectile.Size = Vector3.new(1, 1, 1) projectile.Transparency = 1 projectile.CFrame = CFrame.new(muzzle.CFrame.p, mouseHit.p) projectile.CanCollide = false local transparencyPoints = {} local startColor = Color3.new(255, 255, 0) local endColor = Color3.new(213, 115, 61) table.insert(transparencyPoints, NumberSequenceKeypoint.new(0, 1)) table.insert(transparencyPoints, NumberSequenceKeypoint.new(0.25, 0)) table.insert(transparencyPoints, NumberSequenceKeypoint.new(1, 1)) local determinedTransparency = NumberSequence.new(transparencyPoints) local determinedColors = ColorSequence.new(startColor, endColor) trail.Transparency = determinedTransparency trail.Color = determinedColors local bodyVelocity = Instance.new("BodyVelocity", projectile) bodyVelocity.MaxForce = Vector3.new(9e9, 9e9, 9e9) bodyVelocity.Velocity = (mouseHit.lookVector * velocity.Value) + weaponAccuracy debris:AddItem(projectile, 20) projectile.Touched:Connect(function(hit) local eHumanoid = hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:FindFirstChild("Humanoid") local damage = math.random(minDamage.Value, maxDamage.Value) if not eHumanoid and not hit.Anchored and not hit:IsDescendantOf(character) then projectile:Destroy() elseif eHumanoid and eHumanoid ~= humanoid and eHumanoid.Health > 0 and hit ~= projectile then if hit.Name == "Head" or hit:IsA("Hat") then damage = damage * 1.5 end local criticalPoint = maxDamage.Value DamageAndTagHumanoid(player, eHumanoid, damage) if showDamageText then DynamicText(damage, criticalPoint, eHumanoid) else end projectile:Destroy() elseif hit.CanCollide == true and not hit:IsDescendantOf(player.Character) and hit.Anchored == true then projectile:Destroy() end end) handle.Fire:Play() muzzleEffect.Visible = true muzzleEffect.Rotation = math.random(-360, 360) delay(0.1, function() muzzleEffect.Visible = false end) end end) activateSpecial.OnServerEvent:Connect(function(player) accuracy.Value, fireRate.Value = accuracy.Value / 2, fireRate.Value / 2 minDamage.Value, maxDamage.Value = minDamage.Value / 2, maxDamage.Value / 2 spawn(function() local chargeSound = Instance.new("Sound", player.PlayerGui) chargeSound.Name = "ChargeSound" chargeSound.SoundId = "rbxassetid://163619849" chargeSound:Play() chargeSound.Ended:Connect(function() chargeSound:Destroy() end) local sparkles = Instance.new("Sparkles", handle) sparkles.SparkleColor = Color3.fromRGB(248, 248, 248) local activatedGui = Instance.new("ScreenGui", player.PlayerGui) activatedGui.Name = "SpecialActivated" local textLabel = Instance.new("TextLabel", activatedGui) textLabel.TextColor3 = Color3.fromRGB(0, 180, 30) textLabel.Text = "CHAOS MODE" textLabel.Font = Enum.Font.SourceSans textLabel.TextScaled = true textLabel.TextStrokeTransparency = 0 textLabel.Size = UDim2.new(0, 300, 0, 50) textLabel.Position = UDim2.new(2.5, 0, 0.15, -10) textLabel.BackgroundTransparency = 1 textLabel:TweenPosition(UDim2.new(0.5, -(textLabel.Size.X.Offset / 2), 0.1, -10), Enum.EasingDirection.Out, Enum.EasingStyle.Back, 1) debris:AddItem(sparkles, specialDuration.Value) debris:AddItem(chargeSound, 3) wait(3) TextEffects(textLabel, 200, Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 1) end) for i = specialDuration.Value, 0, -1 do wait(1) print("Special activated: "..i) end accuracy.Value, fireRate.Value = accuracy.Value * 2, fireRate.Value * 2 minDamage.Value, maxDamage.Value = minDamage.Value * 2, maxDamage.Value * 2 activateSpecial:FireClient(player) end)
--[=[ Cleans up whatever `Object` was set to this namespace by the 3rd parameter of [Janitor.Add](#Add). ```lua local Obliterator = Janitor.new() Obliterator:Add(workspace.Baseplate, "Destroy", "Baseplate") Obliterator:Remove("Baseplate") ``` ```ts import { Workspace } from "@rbxts/services"; import { Janitor } from "@rbxts/janitor"; const Obliterator = new Janitor<{ Baseplate: Part }>(); Obliterator.Add(Workspace.FindFirstChild("Baseplate") as Part, "Destroy", "Baseplate"); Obliterator.Remove("Baseplate"); ``` @param Index any -- The index you want to remove. @return Janitor ]=]
function Janitor:Remove(Index: any) local This = self[IndicesReference] if This then local Object = This[Index] if Object then local MethodName = self[Object] if MethodName then if MethodName == true then Object() else local ObjectMethod = Object[MethodName] if ObjectMethod then ObjectMethod(Object) end end self[Object] = nil end This[Index] = nil end end return self end
-- Remotes
local Events = ReplicatedStorage.Events local NewPlayer = Events.NewPlayer
--[[** <description> Saves the data to the data store. Called when a player leaves. </description> **--]]
function DataStore:Save() if not self.valueUpdated then warn(("Data store %s was not saved as it was not updated."):format(self.name)) return end if game.VIPServerId ~= "" then return end if game:GetService("RunService"):IsStudio() and not SaveInStudio then warn(("Data store %s attempted to save in studio while SaveInStudio is false."):format(self.name)) if not SaveInStudioObject then warn("You can set the value of this by creating a BoolValue named SaveInStudio in ServerStorage.") end return end if self.backup then warn("This data store is a backup store, and thus will not be saved.") return end if self.value ~= nil then local save = clone(self.value) if self.beforeSave then local success, newSave = pcall(self.beforeSave, save, self) if success then save = newSave else warn("Error on BeforeSave: "..newSave) return end end if not Verifier.warnIfInvalid(save) then return warn("Invalid data while saving") end local key = (self.mostRecentKey or 0) + 1 self.dataStore:SetAsync(key, save) self.orderedDataStore:SetAsync(key, key) self.mostRecentKey = key for _, afterSave in pairs(self.afterSave) do local success, err = pcall(afterSave, save, self) if not success then warn("Error on AfterSave: "..err) end end print("saved "..self.name) end end
--// Input Connections
L_106_.InputBegan:connect(function(L_310_arg1, L_311_arg2) if not L_311_arg2 and L_15_ then if L_310_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_310_arg1.KeyCode == Enum.KeyCode.ButtonL2) and not L_78_ and not L_77_ and not L_76_ and L_24_.CanAim and not L_73_ and L_15_ and not L_65_ and not L_66_ then if not L_63_ then if not L_64_ then L_3_.Humanoid.WalkSpeed = 10 L_154_ = 10 L_153_ = 0.008 end if (L_3_.Head.Position - L_5_.CoordinateFrame.p).magnitude <= 2 then L_96_ = L_50_ end L_132_.target = L_55_.CFrame:toObjectSpace(L_44_.CFrame).p L_114_:FireServer(true) L_63_ = true end end; if L_310_arg1.KeyCode == Enum.KeyCode.E and L_15_ and not L_79_ and not L_80_ then L_79_ = true L_81_ = false L_80_ = true LeanRight() end if L_310_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and not L_79_ and not L_81_ then L_79_ = true L_80_ = false L_81_ = true LeanLeft() end if L_310_arg1.KeyCode == L_24_.AlternateAimKey and not L_78_ and not L_77_ and not L_76_ and L_24_.CanAim and not L_73_ and L_15_ and not L_65_ and not L_66_ then if not L_63_ then if not L_64_ then L_3_.Humanoid.WalkSpeed = 10 L_154_ = 10 L_153_ = 0.008 end L_96_ = L_50_ L_132_.target = L_55_.CFrame:toObjectSpace(L_44_.CFrame).p L_114_:FireServer(true) L_63_ = true end end; if L_310_arg1.UserInputType == (Enum.UserInputType.MouseButton1 or L_310_arg1.KeyCode == Enum.KeyCode.ButtonR2) and not L_78_ and not L_76_ and L_68_ and L_15_ and not L_65_ and not L_66_ and not L_73_ then L_67_ = true if not Shooting and L_15_ and not L_82_ then if L_102_ > 0 then Shoot() end elseif not Shooting and L_15_ and L_82_ then if L_104_ > 0 then Shoot() end end end; if L_310_arg1.KeyCode == (L_24_.LaserKey or L_310_arg1.KeyCode == Enum.KeyCode.DPadRight) and L_15_ and L_24_.LaserAttached then local L_312_ = L_1_:FindFirstChild("LaserLight") L_121_.KeyDown[1].Plugin() end; if L_310_arg1.KeyCode == (L_24_.LightKey or L_310_arg1.KeyCode == Enum.KeyCode.ButtonR3) and L_15_ and L_24_.LightAttached then local L_313_ = L_1_:FindFirstChild("FlashLight"):FindFirstChild('Light') local L_314_ = false L_313_.Enabled = not L_313_.Enabled end; if L_15_ and L_310_arg1.KeyCode == (L_24_.FireSelectKey or L_310_arg1.KeyCode == Enum.KeyCode.DPadUp) and not L_78_ and not L_69_ and not L_77_ then L_69_ = true if L_91_ == 1 then if Shooting then Shooting = false end if L_24_.AutoEnabled then L_91_ = 2 L_82_ = false L_68_ = L_83_ elseif not L_24_.AutoEnabled and L_24_.BurstEnabled then L_91_ = 3 L_82_ = false L_68_ = L_83_ elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then L_91_ = 4 L_82_ = false L_68_ = L_83_ elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then L_91_ = 6 L_82_ = true L_83_ = L_68_ L_68_ = L_84_ elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled then L_91_ = 1 L_82_ = false L_68_ = L_83_ end elseif L_91_ == 2 then if Shooting then Shooting = false end if L_24_.BurstEnabled then L_91_ = 3 L_82_ = false L_68_ = L_83_ elseif not L_24_.BurstEnabled and L_24_.BoltAction then L_91_ = 4 L_82_ = false L_68_ = L_83_ elseif not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then L_91_ = 6 L_82_ = true L_83_ = L_68_ L_68_ = L_84_ elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then L_91_ = 1 L_82_ = false L_68_ = L_83_ elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.SemiEnabled then L_91_ = 2 L_82_ = false L_68_ = L_83_ end elseif L_91_ == 3 then if Shooting then Shooting = false end if L_24_.BoltAction then L_91_ = 4 L_82_ = false L_68_ = L_83_ elseif not L_24_.BoltAction and L_24_.ExplosiveEnabled then L_91_ = 6 L_82_ = true L_83_ = L_68_ L_68_ = L_84_ elseif not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then L_91_ = 1 L_82_ = false L_68_ = L_83_ elseif not L_24_.BoltAction and not L_24_.SemiEnabled and L_24_.AutoEnabled then L_91_ = 2 L_82_ = false L_68_ = L_83_ elseif not L_24_.BoltAction and not L_24_.SemiEnabled and not L_24_.AutoEnabled then L_91_ = 3 L_82_ = false L_68_ = L_83_ end elseif L_91_ == 4 then if Shooting then Shooting = false end if L_24_.ExplosiveEnabled then L_91_ = 6 L_82_ = true L_83_ = L_68_ L_68_ = L_84_ elseif not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then L_91_ = 1 L_82_ = false L_68_ = L_83_ elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then L_91_ = 2 L_82_ = false L_68_ = L_83_ elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then L_91_ = 3 L_82_ = false L_68_ = L_83_ elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled then L_91_ = 4 L_82_ = false L_68_ = L_83_ end elseif L_91_ == 6 then if Shooting then Shooting = false end L_84_ = L_68_ if L_24_.SemiEnabled then L_91_ = 1 L_82_ = false L_68_ = L_83_ elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then L_91_ = 2 L_82_ = false L_68_ = L_83_ elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then L_91_ = 3 L_82_ = false L_68_ = L_83_ elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then L_91_ = 4 L_82_ = false L_68_ = L_83_ elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction then L_91_ = 6 L_82_ = true L_83_ = L_68_ L_68_ = L_84_ end end UpdateAmmo() FireModeAnim() IdleAnim() L_69_ = false end; if L_310_arg1.KeyCode == (Enum.KeyCode.F or L_310_arg1.KeyCode == Enum.KeyCode.DPadDown) and not L_78_ and not L_76_ and not L_77_ and not L_66_ and not L_69_ and not L_63_ and not L_65_ and not Shooting and not L_75_ then if not L_72_ and not L_73_ then L_73_ = true Shooting = false L_68_ = false L_134_ = time() delay(0.6, function() if L_102_ ~= L_24_.Ammo and L_102_ > 0 then CreateShell() end end) BoltBackAnim() L_72_ = true elseif L_72_ and L_73_ then BoltForwardAnim() Shooting = false L_68_ = true if L_102_ ~= L_24_.Ammo and L_102_ > 0 then L_102_ = L_102_ - 1 elseif L_102_ >= L_24_.Ammo then L_68_ = true end L_72_ = false L_73_ = false IdleAnim() L_74_ = false end UpdateAmmo() end; if L_310_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_310_arg1.KeyCode == Enum.KeyCode.ButtonL3) and not L_77_ and not L_76_ and L_145_ then L_70_ = true if L_15_ and not L_69_ and not L_66_ and L_70_ and not L_64_ and not L_73_ then Shooting = false L_63_ = false L_66_ = true delay(0, function() if L_66_ and not L_65_ then L_63_ = false L_71_ = true end end) L_96_ = 80 L_3_.Humanoid.WalkSpeed = L_24_.SprintSpeed L_154_ = L_24_.SprintSpeed L_153_ = 0.4 end end; if L_310_arg1.KeyCode == (Enum.KeyCode.R or L_310_arg1.KeyCode == Enum.KeyCode.ButtonX) and not L_78_ and not L_77_ and not L_76_ and L_15_ and not L_65_ and not L_63_ and not Shooting and not L_66_ and not L_73_ then if not L_82_ then if L_103_ > 0 and L_102_ < L_24_.Ammo then Shooting = false L_65_ = true for L_315_forvar1, L_316_forvar2 in pairs(game.Players:GetChildren()) do if L_316_forvar2 and L_316_forvar2:IsA('Player') and L_316_forvar2 ~= L_2_ and L_316_forvar2.TeamColor == L_2_.TeamColor then if (L_316_forvar2.Character.HumanoidRootPart.Position - L_3_.HumanoidRootPart.Position).magnitude <= 150 then if L_7_:FindFirstChild('AHH') and not L_7_.AHH.IsPlaying then L_118_:FireServer(L_7_.AHH, L_99_[math.random(0, 23)]) end end end end ReloadAnim() if L_102_ <= 0 then if not L_24_.CanSlideLock then BoltBackAnim() BoltForwardAnim() end end IdleAnim() L_68_ = true if L_102_ <= 0 then if (L_103_ - (L_24_.Ammo - L_102_)) < 0 then L_102_ = L_102_ + L_103_ L_103_ = 0 else L_103_ = L_103_ - (L_24_.Ammo - L_102_) L_102_ = L_24_.Ammo end elseif L_102_ > 0 then if (L_103_ - (L_24_.Ammo - L_102_)) < 0 then L_102_ = L_102_ + L_103_ + 1 L_103_ = 0 else L_103_ = L_103_ - (L_24_.Ammo - L_102_) L_102_ = L_24_.Ammo + 1 end end L_65_ = false if not L_74_ then L_68_ = true end end; elseif L_82_ then if L_104_ > 0 then Shooting = false L_65_ = true nadeReload() IdleAnim() L_65_ = false L_68_ = true end end; UpdateAmmo() end; if L_310_arg1.KeyCode == Enum.KeyCode.RightBracket and L_63_ then if (L_51_ < 1) then L_51_ = L_51_ + L_24_.SensitivityIncrement end end if L_310_arg1.KeyCode == Enum.KeyCode.LeftBracket and L_63_ then if (L_51_ > 0.1) then L_51_ = L_51_ - L_24_.SensitivityIncrement end end if L_310_arg1.KeyCode == (Enum.KeyCode.T or L_310_arg1.KeyCode == Enum.KeyCode.DPadLeft) and L_1_:FindFirstChild("AimPart2") then if not L_85_ then L_55_ = L_1_:WaitForChild("AimPart2") L_50_ = L_24_.CycleAimZoom if L_63_ then L_96_ = L_24_.CycleAimZoom end L_85_ = true else L_55_ = L_1_:FindFirstChild("AimPart") L_50_ = L_24_.AimZoom if L_63_ then L_96_ = L_24_.AimZoom end L_85_ = false end; end; if L_310_arg1.KeyCode == L_24_.InspectionKey and not L_78_ and not L_77_ then if not L_76_ then L_76_ = true InspectAnim() IdleAnim() L_76_ = false end end; if L_310_arg1.KeyCode == L_24_.AttachmentKey and not L_78_ and not L_76_ then if L_15_ then if not L_77_ then L_66_ = false L_63_ = false L_68_ = false L_77_ = true AttachAnim() elseif L_77_ then L_66_ = false L_63_ = false L_68_ = true L_77_ = false IdleAnim() end end end; if L_310_arg1.KeyCode == Enum.KeyCode.P and not L_76_ and not L_77_ and not L_63_ and not L_66_ and not L_64_ and not L_65_ and not Recoiling and not L_66_ then if not L_78_ then L_78_ = true L_14_:Create(L_45_, TweenInfo.new(0.2), { C1 = L_24_.SprintPos }):Play() wait(0.2) L_111_:FireServer("Patrol", L_24_.SprintPos) else L_78_ = false L_14_:Create(L_45_, TweenInfo.new(0.2), { C1 = CFrame.new() }):Play() wait(0.2) L_111_:FireServer("Unpatrol") end end; end end) L_106_.InputEnded:connect(function(L_317_arg1, L_318_arg2) if not L_318_arg2 and L_15_ then if L_317_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_317_arg1.KeyCode == Enum.KeyCode.ButtonL2) and not L_76_ and L_24_.CanAim and not L_77_ then if L_63_ then if not L_64_ then L_3_.Humanoid.WalkSpeed = 16 L_154_ = 17 L_153_ = .25 end L_96_ = 70 L_132_.target = Vector3.new() L_114_:FireServer(false) L_63_ = false end end; if L_317_arg1.KeyCode == Enum.KeyCode.E and L_15_ and L_79_ then Unlean() L_79_ = false L_81_ = false L_80_ = false end if L_317_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and L_79_ then Unlean() L_79_ = false L_81_ = false L_80_ = false end if L_317_arg1.KeyCode == L_24_.AlternateAimKey and not L_76_ and L_24_.CanAim then if L_63_ then if not L_64_ then L_3_.Humanoid.WalkSpeed = 16 L_154_ = 17 L_153_ = .25 end L_96_ = 70 L_132_.target = Vector3.new() L_114_:FireServer(false) L_63_ = false end end; if L_317_arg1.UserInputType == (Enum.UserInputType.MouseButton1 or L_317_arg1.KeyCode == Enum.KeyCode.ButtonR2) and not L_76_ then L_67_ = false if Shooting then Shooting = false end end; if L_317_arg1.KeyCode == Enum.KeyCode.E and L_15_ then local L_319_ = L_42_:WaitForChild('GameGui') if L_16_ then L_319_:WaitForChild('AmmoFrame').Visible = false L_16_ = false end end; if L_317_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_317_arg1.KeyCode == Enum.KeyCode.ButtonL3) and not L_76_ and not L_69_ and not L_64_ then -- SPRINT L_70_ = false if L_66_ and not L_63_ and not Shooting and not L_70_ then L_66_ = false L_71_ = false L_96_ = 70 L_3_.Humanoid.WalkSpeed = 16 L_154_ = 17 L_153_ = .25 end end; end end) L_106_.InputChanged:connect(function(L_320_arg1, L_321_arg2) if not L_321_arg2 and L_15_ and L_24_.FirstPersonOnly and L_63_ then if L_320_arg1.UserInputType == Enum.UserInputType.MouseWheel then if L_320_arg1.Position.Z == 1 and (L_51_ < 1) then L_51_ = L_51_ + L_24_.SensitivityIncrement elseif L_320_arg1.Position.Z == -1 and (L_51_ > 0.1) then L_51_ = L_51_ - L_24_.SensitivityIncrement end end end end) L_106_.InputChanged:connect(function(L_322_arg1, L_323_arg2) if not L_323_arg2 and L_15_ then local L_324_, L_325_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_55_.CFrame.p, (L_55_.CFrame.lookVector).unit * 10000), IgnoreList); if L_324_ then local L_326_ = (L_325_ - L_6_.Position).magnitude L_33_.Text = math.ceil(L_326_) .. ' m' end end end)
------------------------------------------------------------
local pos1 = Danger.Orientation.Y local pos2 = Danger.Orientation.X local pos3 = Danger.Orientation.Z
-- << LOCAL VARIABLES >>
local broadcastData = {} local pollData = {} local alertData = {} local pollCount = 0 local topics = { DisplayPollResultsToServer = "DisplayPollResultsToServer"; BeginPoll = "BeginPoll"; GetAmountOfServers = "GetAmountOfServers"; GlobalAlert = "GlobalAlert"; GlobalCommands = "GlobalCommands" }
-- Also set this to true if you want the thumbstick to not affect throttle, only triggers when a gamepad is conected
local onlyTriggersForThrottle = false local function onThrottleAccel(actionName, inputState, inputObject) MasterControl:AddToPlayerMovement(Vector3.new(0, 0, -CurrentThrottle)) CurrentThrottle = (inputState == Enum.UserInputState.End or Deccelerating) and 0 or -1 MasterControl:AddToPlayerMovement(Vector3.new(0, 0, CurrentThrottle)) Accelerating = not (inputState == Enum.UserInputState.End) if (inputState == Enum.UserInputState.End) and Deccelerating then CurrentThrottle = 1 MasterControl:AddToPlayerMovement(Vector3.new(0, 0, CurrentThrottle)) end end local function onThrottleDeccel(actionName, inputState, inputObject) MasterControl:AddToPlayerMovement(Vector3.new(0, 0, -CurrentThrottle)) CurrentThrottle = (inputState == Enum.UserInputState.End or Accelerating) and 0 or 1 MasterControl:AddToPlayerMovement(Vector3.new(0, 0, CurrentThrottle)) Deccelerating = not (inputState == Enum.UserInputState.End) if (inputState == Enum.UserInputState.End) and Accelerating then CurrentThrottle = -1 MasterControl:AddToPlayerMovement(Vector3.new(0, 0, CurrentThrottle)) end end local function onSteerRight(actionName, inputState, inputObject) MasterControl:AddToPlayerMovement(Vector3.new(-CurrentSteer, 0, 0)) CurrentSteer = (inputState == Enum.UserInputState.End or TurningLeft) and 0 or 1 MasterControl:AddToPlayerMovement(Vector3.new(CurrentSteer, 0, 0)) TurningRight = not (inputState == Enum.UserInputState.End) if (inputState == Enum.UserInputState.End) and TurningLeft then CurrentSteer = -1 MasterControl:AddToPlayerMovement(Vector3.new(CurrentSteer, 0, 0)) end end local function onSteerLeft(actionName, inputState, inputObject) MasterControl:AddToPlayerMovement(Vector3.new(-CurrentSteer, 0, 0)) CurrentSteer = (inputState == Enum.UserInputState.End or TurningRight) and 0 or -1 MasterControl:AddToPlayerMovement(Vector3.new(CurrentSteer, 0, 0)) TurningLeft = not (inputState == Enum.UserInputState.End) if (inputState == Enum.UserInputState.End) and TurningRight then CurrentSteer = 1 MasterControl:AddToPlayerMovement(Vector3.new(CurrentSteer, 0, 0)) end end local function getHumanoid() local character = LocalPlayer and LocalPlayer.Character if character then for _,child in pairs(character:GetChildren()) do if child:IsA('Humanoid') then return child end end end end local function getClosestFittingValue(value) if value > 0.5 then return 1 elseif value < -0.5 then return -1 end return 0 end local function onRenderStepped() if CurrentVehicleSeat then local moveValue = MasterControl:GetMoveVector() local didSetThrottleSteerFloat = false didSetThrottleSteerFloat = pcall(function() if game:GetService("UserInputService"):GetGamepadConnected(Enum.UserInputType.Gamepad1) and onlyTriggersForThrottle and useTriggersForThrottle then CurrentVehicleSeat.ThrottleFloat = -CurrentThrottle else CurrentVehicleSeat.ThrottleFloat = -moveValue.z end CurrentVehicleSeat.SteerFloat = moveValue.x end) if didSetThrottleSteerFloat == false then if game:GetService("UserInputService"):GetGamepadConnected(Enum.UserInputType.Gamepad1) and onlyTriggersForThrottle and useTriggersForThrottle then CurrentVehicleSeat.Throttle = -CurrentThrottle else CurrentVehicleSeat.Throttle = getClosestFittingValue(-moveValue.z) end CurrentVehicleSeat.Steer = getClosestFittingValue(moveValue.x) end end end local function onSeated(active, currentSeatPart) if active then if currentSeatPart and currentSeatPart:IsA('VehicleSeat') then CurrentVehicleSeat = currentSeatPart if useTriggersForThrottle then ContextActionService:BindAction("throttleAccel", onThrottleAccel, false, Enum.KeyCode.ButtonR2) ContextActionService:BindAction("throttleDeccel", onThrottleDeccel, false, Enum.KeyCode.ButtonL2) end ContextActionService:BindAction("arrowSteerRight", onSteerRight, false, Enum.KeyCode.Right) ContextActionService:BindAction("arrowSteerLeft", onSteerLeft, false, Enum.KeyCode.Left) local success = pcall(function() RunService:BindToRenderStep("VehicleControlStep", Enum.RenderPriority.Input.Value, onRenderStepped) end) if not success then if RenderSteppedCn then return end RenderSteppedCn = RunService.RenderStepped:connect(onRenderStepped) end end else CurrentVehicleSeat = nil if useTriggersForThrottle then ContextActionService:UnbindAction("throttleAccel") ContextActionService:UnbindAction("throttleDeccel") end ContextActionService:UnbindAction("arrowSteerRight") ContextActionService:UnbindAction("arrowSteerLeft") MasterControl:AddToPlayerMovement(Vector3.new(-CurrentSteer, 0, -CurrentThrottle)) CurrentThrottle = 0 CurrentSteer = 0 local success = pcall(function() RunService:UnbindFromRenderStep("VehicleControlStep") end) if not success and RenderSteppedCn then RenderSteppedCn:disconnect() RenderSteppedCn = nil end end end local function CharacterAdded(character) local humanoid = getHumanoid() while not humanoid do task.wait() humanoid = getHumanoid() end -- if HumanoidSeatedCn then HumanoidSeatedCn:disconnect() HumanoidSeatedCn = nil end HumanoidSeatedCn = humanoid.Seated:connect(onSeated) end if LocalPlayer.Character then CharacterAdded(LocalPlayer.Character) end LocalPlayer.CharacterAdded:connect(CharacterAdded) return VehicleController
--> Variables
local Timer = Fountain:GetAttribute("Timer") -- How long you must wait to heal (in seconds) local Cooldown = {}
--> Functions
local function MoveCamera(newCamPart) local camera = workspace.CurrentCamera camera.CFrame = newCamPart.CFrame end
-- Variables
local Animations = ServerStorage.Animations local replacementAnimations = { { name = "run", id = (Animations.WalkAnimationID.Value ~= "" and "http://www.roblox.com/asset/?id=" .. Animations.WalkAnimationID.Value) or "", isLoaded = false, }, { name = "idle", id = (Animations.IdleAnimationID.Value ~= "" and "http://www.roblox.com/asset/?id=" .. Animations.IdleAnimationID.Value) or "", isLoaded = false, }, { name = "cheer", id = (Animations.CheerAnimationID.Value ~= "" and "http://www.roblox.com/asset/?id=" .. Animations.CheerAnimationID.Value) or "", isLoaded = false, }, }
--[[ Camera Maths Utilities Library ]]
-- local Util = require(script.Parent:WaitForChild("CameraUtils"))
-- Note: DotProduct check in CoordinateFrame::lookAt() prevents using values within about -- 8.11 degrees of the +/- Y axis, that's why these limits are currently 80 degrees
local MIN_Y = math.rad(-80) local MAX_Y = math.rad(80) local VR_ANGLE = math.rad(15) local VR_LOW_INTENSITY_ROTATION = Vector2.new(math.rad(15), 0) local VR_HIGH_INTENSITY_ROTATION = Vector2.new(math.rad(45), 0) local VR_LOW_INTENSITY_REPEAT = 0.1 local VR_HIGH_INTENSITY_REPEAT = 0.4 local ZERO_VECTOR2 = Vector2.new(0,0) local ZERO_VECTOR3 = Vector3.new(0,0,0) local TOUCH_SENSITIVTY = Vector2.new( 0.002 * math.pi, 0.0015 * math.pi) local MOUSE_SENSITIVITY = Vector2.new( 0.002 * math.pi, 0.0015 * math.pi ) local MAX_TIME_FOR_DOUBLE_TAP = 1.5 local MAX_TAP_POS_DELTA = 15 local MAX_TAP_TIME_DELTA = 0.75 local SEAT_OFFSET = Vector3.new(0,5,0) local VR_SEAT_OFFSET = Vector3.new(0,4,0) local HEAD_OFFSET = Vector3.new(0,1.5,0) local R15_HEAD_OFFSET = Vector3.new(0,2,0) local bindAtPriorityFlagExists, bindAtPriorityFlagEnabled = pcall(function() return UserSettings():IsUserFeatureEnabled("UserPlayerScriptsBindAtPriority") end) local FFlagPlayerScriptsBindAtPriority = bindAtPriorityFlagExists and bindAtPriorityFlagEnabled local newDefaultCameraAngleFlagExists, newDefaultCameraAngleFlagEnabled = pcall(function() return UserSettings():IsUserFeatureEnabled("UserNewDefaultCameraAngle") end) local FFlagUserNewDefaultCameraAngle = newDefaultCameraAngleFlagExists and newDefaultCameraAngleFlagEnabled local Util = require(script.Parent:WaitForChild("CameraUtils")) local ZoomController = require(script.Parent:WaitForChild("ZoomController"))
--!strict
local Sift = script.Parent.Parent local None = require(Sift.None) local copyDeep = require(script.Parent.copyDeep)
--Declarations
local target = AItorso -- is of type torso local torsoPos = AItorso.Position local targpos = target.Position
-- Functions
local function getRotationBetween(u, v, axis) local dot, uxv = u:Dot(v), u:Cross(v) if (dot < -0.99999) then return CFrame.fromAxisAngle(axis, math.pi) end return CFrame.new(0, 0, 0, uxv.x, uxv.y, uxv.z, 1 + dot) end local function twistAngle(cf, direction) local axis, theta = cf:ToAxisAngle() local w, v = math.cos(theta/2), math.sin(theta/2)*axis local proj = v:Dot(direction)*direction local twist = CFrame.new(0, 0, 0, proj.x, proj.y, proj.z, w) local nAxis, nTheta = twist:ToAxisAngle() return math.sign(v:Dot(direction))*nTheta end
--[[ Constructs a new computed state object, which follows the value of another state object using a spring simulation. ]]
local Package = script.Parent.Parent local PubTypes = require(Package.PubTypes) local Types = require(Package.Types) local logError = require(Package.Logging.logError) local logErrorNonFatal = require(Package.Logging.logErrorNonFatal) local unpackType = require(Package.Animation.unpackType) local SpringScheduler = require(Package.Animation.SpringScheduler) local useDependency = require(Package.Dependencies.useDependency) local initDependency = require(Package.Dependencies.initDependency) local updateAll = require(Package.Dependencies.updateAll) local xtypeof = require(Package.Utility.xtypeof) local unwrap = require(Package.State.unwrap) local class = {} local CLASS_METATABLE = {__index = class} local WEAK_KEYS_METATABLE = {__mode = "k"}
-- Convenience function so that calling code does not have to first get the activeController -- and then call GetMoveVector on it. When there is no active controller, this function returns -- nil so that this case can be distinguished from no current movement (which returns zero vector).
function ControlModule:GetMoveVector() if self.activeController then return self.activeController:GetMoveVector() end return Vector3.new(0,0,0) end function ControlModule:GetActiveController() return self.activeController end function ControlModule:Enable(enable) if not self.activeController then return end if enable == nil then enable = true end if enable then if self.touchControlFrame then self.activeController:Enable(true, self.touchControlFrame) else if self.activeControlModule == ClickToMove then -- For ClickToMove, when it is the player's choice, we also enable the full keyboard controls. -- When the developer is forcing click to move, the most keyboard controls (WASD) are not available, only spacebar to jump. self.activeController:Enable(true, Players.LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.UserChoice) else self.activeController:Enable(true) end end else self:Disable() end end
--You can change the values below to suit your needs
local max_mode = 6 --The maximum amount of modes forwards. Set to 0 to disable forwards motion. local min_mode = -6 --The minimum amount of modes backwards. Set to 0 to disable backwards motion. local increment_speed = 0.5 --The amount in which the speed value increments with every mode.
-- When players fail to load data, their key is put in a list so that their -- data does not save and override existing data
local tempData = {}
--[[ Destroys all systems ]]
function SystemManager.destroySystems() for _, system in pairs(systems) do system:destroy() end end
--edit the function below to return true when you want this response/prompt to be valid --player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder) local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player) return plrData.Classes.Base.Smasher.XP.Value < 20 end
--local function lastInputTypeChanged(inputType) -- if inputType == Enum.UserInputType.Touch then
--[[ ___ _______ _ / _ |____/ ___/ / ___ ____ ___ (_)__ / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< /_/ |_| \___/_//_/\_,_/___/___/_/___/ SecondLogic @ Inspare ]]
local autoscaling = false --Estimates top speed local UNITS = { --Click on speed to change units --First unit is default { units = "MPH" , scaling = (10/12) * (60/88) , -- 1 stud : 10 inches | ft/s to MPH maxSpeed = 280 , spInc = 20 , -- Increment between labelled notches }, { units = "KM/H" , scaling = (10/12) * 1.09728 , -- 1 stud : 10 inches | ft/s to KP/H maxSpeed = 370 , spInc = 40 , -- Increment between labelled notches }, { units = "SPS" , scaling = 1 , -- Roblox standard maxSpeed = 400 , spInc = 40 , -- Increment between labelled notches } }
-------- OMG HAX
r = game:service("RunService") local damage = 5 local slash_damage = 12 local lunge_damage = 35 sword = script.Parent.Handle Tool = script.Parent local SlashSound = Instance.new("Sound") SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav" SlashSound.Parent = sword SlashSound.Volume = .7 local LungeSound = Instance.new("Sound") LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav" LungeSound.Parent = sword LungeSound.Volume = .6 local UnsheathSound = Instance.new("Sound") UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav" UnsheathSound.Parent = sword UnsheathSound.Volume = 1 function blow(hit) local humanoid = hit.Parent:findFirstChild("Humanoid") local vCharacter = Tool.Parent local vPlayer = game.Players:playerFromCharacter(vCharacter) local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character if humanoid~=nil and humanoid ~= hum and hum ~= nil then -- final check, make sure sword is in-hand local right_arm = vCharacter:FindFirstChild("Right Arm") if (right_arm ~= nil) then local joint = right_arm:FindFirstChild("RightGrip") if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then tagHumanoid(humanoid, vPlayer) humanoid:TakeDamage(damage) wait(1) untagHumanoid(humanoid) end end end end function tagHumanoid(humanoid, player) local creator_tag = Instance.new("ObjectValue") creator_tag.Value = player creator_tag.Name = "creator" creator_tag.Parent = humanoid end function untagHumanoid(humanoid) if humanoid ~= nil then local tag = humanoid:findFirstChild("creator") if tag ~= nil then tag.Parent = nil end end end function attack() damage = slash_damage SlashSound:play() local anim = Instance.new("StringValue") anim.Name = "toolanim" anim.Value = "Slash" anim.Parent = Tool end function lunge() damage = lunge_damage LungeSound:play() local anim = Instance.new("StringValue") anim.Name = "toolanim" anim.Value = "Lunge" anim.Parent = Tool force = Instance.new("BodyVelocity") force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80 force.Parent = Tool.Parent.Torso wait(.2) swordOut() wait(.2) force.Parent = nil wait(.4) swordUp() damage = slash_damage end function swordUp() Tool.GripForward = Vector3.new(-1,0,0) Tool.GripRight = Vector3.new(0,1,0) Tool.GripUp = Vector3.new(0,0,1) end function swordOut() Tool.GripForward = Vector3.new(0,0,1) Tool.GripRight = Vector3.new(0,1,0) Tool.GripUp = Vector3.new(1,0,0) end function swordAcross() -- parry end Tool.Enabled = true local last_attack = 0 function onActivated() if not Tool.Enabled then return end Tool.Enabled = false local character = Tool.Parent; local humanoid = character.Humanoid if humanoid == nil then print("Humanoid not found") return end t = r.Stepped:wait() if (t - last_attack < .2) then lunge() else attack() end last_attack = t --wait(.5) Tool.Enabled = true end function onEquipped() UnsheathSound:play() end script.Parent.Activated:connect(onActivated) script.Parent.Equipped:connect(onEquipped) connection = sword.Touched:connect(blow)
-----
local plr = game.Players.LocalPlayer local char = plr.Character local hum = char:WaitForChild("Humanoid") local gaurdingAnimation = hum.Animator:LoadAnimation(RS.Animations.Combat.Player:WaitForChild("Block")) local CD = 1
------------------------------------[[PLAYLIST]---------------------------------------------------------------------------------------------------------------------
song1 = "http://www.roblox.com/asset/?id=4924940868" --insert the ID number after the "/?id=" song2 = "http://www.roblox.com/asset/?id=2087798404" song3 = "http://www.roblox.com/asset/?id=1608398085" song4 = "http://www.roblox.com/asset/?id=1327798905" song5 = "http://www.roblox.com/asset/?id=2868925132" song6 = "http://www.roblox.com/asset/?id=5466929560" song7 = "http://www.roblox.com/asset/?id=1572404379" song8 = "http://www.roblox.com/asset/?id=1859222085" song9 = "http://www.roblox.com/asset/?id=4924940868" song10 = "http://www.roblox.com/asset/?id=5625100862" song11 = "http://www.roblox.com/asset/?id=2023642240" song12 = "http://www.roblox.com/asset/?id=1572323159"
--[[ CameraModule - This ModuleScript implements a singleton class to manage the selection, activation, and deactivation of the current camera controller, character occlusion controller, and transparency controller. This script binds to RenderStepped at Camera priority and calls the Update() methods on the active controller instances. The camera controller ModuleScripts implement classes which are instantiated and activated as-needed, they are no longer all instantiated up front as they were in the previous generation of PlayerScripts. 2018 PlayerScripts Update - AllYourBlox --]]
local CameraModule = {} CameraModule.__index = CameraModule local FFlagUserRemoveTheCameraApi do local success, result = pcall(function() return UserSettings():IsUserFeatureEnabled("UserRemoveTheCameraApi") end) FFlagUserRemoveTheCameraApi = success and result end
--EDIT BELOW----------------------------------------------------------------------
settings.PianoSoundRange = 150 settings.KeyAesthetics = true settings.PianoSounds = { "269058581", "269058744", "269058842", "269058899", "269058974", "269059048" }
--// Ammo Settings
Ammo = 15; StoredAmmo = 15; MagCount = 8; -- If you want infinate ammo, set to math.huge EX. MagCount = math.huge; ExplosiveAmmo = 3; --// Damage Setting BaseDamage = script.Parent.Damage.Value; -- Torso Damage LimbDamage = 35; -- Arms and Legs ArmorDamage = 35; -- How much damage is dealt against armor (Name the armor "Armor") HeadDamage = 60; -- If you set this to 100, there's a chance the player won't die because of the heal script
-- Returns the common parts of the given paths or {} if no -- common parts were found.
function Path:_commonParts(...: string) local common_parts: Array<string> = {} local paths: Array<string> = { ... } local split_paths = {} for _, path in ipairs(paths) do table.insert(split_paths, self:_splitBySeparators(path)) end for part_i = 1, #split_paths[1] do local test_part = split_paths[1][part_i] for path_i = 2, #split_paths do local part = split_paths[path_i][part_i] if not self:pathsEqual(test_part, part) then return common_parts end end table.insert(common_parts, test_part) end return common_parts end
-------------------------
mouse.KeyDown:connect(function (key) key = string.lower(key) if key == "k" then --Camera controls if cam == ("car") then Camera.CameraSubject = player.Character.Humanoid Camera.CameraType = ("Custom") cam = ("freeplr") Camera.FieldOfView = 70 elseif cam == ("freeplr") then Camera.CameraSubject = player.Character.Humanoid Camera.CameraType = ("Attach") cam = ("lockplr") Camera.FieldOfView = 45 elseif cam == ("lockplr") then Camera.CameraSubject = carSeat Camera.CameraType = ("Custom") cam = ("car") Camera.FieldOfView = 70 end elseif key == "[" then -- volume down if carSeat.Parent.Body.MP.Sound.Volume >= 0 then handler:FireServer('volumedown', true) carSeat.Parent.Body.Dash.Screen.G.Main.Icon.Vol.Text = ("Vol: "..carSeat.Parent.MPL.Sound.Volume) end elseif key == "]" then -- volume up if carSeat.Parent.Body.MP.Sound.Volume <= 10 then handler:FireServer('volumeup', true) carSeat.Parent.Body.Dash.Screen.G.Main.Icon.Vol.Text = ("Vol: "..carSeat.Parent.MPL.Sound.Volume) end elseif key == "u" then handler:FireServer("Radio") elseif key == "g" then handler:FireServer("Delete") elseif key == "n" then handler:FireServer("Tabs") end end) HUB.Sport.MouseButton1Click:connect(function() --Hide tracker names handler:FireServer('Sport') end) HUB.Comfort.MouseButton1Click:connect(function() --Hide tracker names handler:FireServer('Comfort') end) HUB.Dynamic.MouseButton1Click:connect(function() --Hide tracker names handler:FireServer('Dynamic') end) carSeat.Indicator.Changed:connect(function() if carSeat.Indicator.Value == true then script.Parent.Indicator:Play() else script.Parent.Indicator2:Play() end end) game.Lighting.Changed:connect(function(prop) if prop == "TimeOfDay" then handler:FireServer('TimeUpdate') end end) if game.Workspace.FilteringEnabled == true then handler:FireServer('feON') elseif game.Workspace.FilteringEnabled == false then handler:FireServer('feOFF') end carSeat.LI.Changed:connect(function() if carSeat.LI.Value == true then carSeat.Parent.Body.Dash.Spd.G.Indicator.Visible = true script.Parent.HUB.Left.Visible = true else carSeat.Parent.Body.Dash.Spd.G.Indicator.Visible = false script.Parent.HUB.Left.Visible = false end end) carSeat.RI.Changed:connect(function() if carSeat.RI.Value == true then carSeat.Parent.Body.Dash.Tac.G.Indicator.Visible = true script.Parent.HUB.Right.Visible = true else carSeat.Parent.Body.Dash.Tac.G.Indicator.Visible = false script.Parent.HUB.Right.Visible = false end end) while wait() do carSeat.Parent.Body.Dash.DashSc.G.Spd.Text = (math.floor(carSeat.Velocity.magnitude*((10/12) * (60/88))).." mph") carSeat.Parent.Body.Dash.Screen.G.Screen.StatusBar.Time.Text = game.Lighting.TimeOfDay carSeat.Parent.Body.Dash.DashSc2.G.Time.Text = game.Lighting.TimeOfDay end
--Precalculated paths
local t,f,n=true,false,{} local r={ [58]={{25,26,27,28,29,31,32,34,35,39,41,30,56,58},t}, [49]={{25,26,27,28,44,45,49},t}, [16]={n,f}, [19]={{25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,19},t}, [59]={{25,26,27,28,29,31,32,34,35,39,41,59},t}, [63]={{25,26,27,28,29,31,32,34,35,39,41,30,56,58,23,62,63},t}, [34]={{25,26,27,28,29,31,32,34},t}, [21]={{25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,21},t}, [48]={{25,26,27,28,44,45,49,48},t}, [27]={{25,26,27},t}, [14]={n,f}, [31]={{25,26,27,28,29,31},t}, [56]={{25,26,27,28,29,31,32,34,35,39,41,30,56},t}, [29]={{25,26,27,28,29},t}, [13]={n,f}, [47]={{25,26,27,28,44,45,49,48,47},t}, [12]={n,f}, [45]={{25,26,27,28,44,45},t}, [57]={{25,26,27,28,29,31,32,34,35,39,41,30,56,57},t}, [36]={{25,26,27,28,29,31,32,33,36},t}, [25]={{25},t}, [71]={{25,26,27,28,29,31,32,34,35,39,41,59,61,71},t}, [20]={{25,26,27,28,29,31,32,34,35,39,41,30,56,58,20},t}, [60]={{25,26,27,28,29,31,32,34,35,39,41,60},t}, [8]={n,f}, [4]={n,f}, [75]={{25,26,27,28,29,31,32,34,35,39,41,59,61,71,72,76,73,75},t}, [22]={{25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,21,22},t}, [74]={{25,26,27,28,29,31,32,34,35,39,41,59,61,71,72,76,73,74},t}, [62]={{25,26,27,28,29,31,32,34,35,39,41,30,56,58,23,62},t}, [1]={n,f}, [6]={n,f}, [11]={n,f}, [15]={n,f}, [37]={{25,26,27,28,29,31,32,33,36,37},t}, [2]={n,f}, [35]={{25,26,27,28,29,31,32,34,35},t}, [53]={{25,26,27,28,44,45,49,48,47,52,53},t}, [73]={{25,26,27,28,29,31,32,34,35,39,41,59,61,71,72,76,73},t}, [72]={{25,26,27,28,29,31,32,34,35,39,41,59,61,71,72},t}, [33]={{25,26,27,28,29,31,32,33},t}, [69]={{25,26,27,28,29,31,32,34,35,39,41,60,69},t}, [65]={{25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,65},t}, [26]={{25,26},t}, [68]={{25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67,68},t}, [76]={{25,26,27,28,29,31,32,34,35,39,41,59,61,71,72,76},t}, [50]={{25,26,27,28,44,45,49,48,47,50},t}, [66]={{25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,19,66},t}, [10]={n,f}, [24]={{25,24},t}, [23]={{25,26,27,28,29,31,32,34,35,39,41,30,56,58,23},t}, [44]={{25,26,27,28,44},t}, [39]={{25,26,27,28,29,31,32,34,35,39},t}, [32]={{25,26,27,28,29,31,32},t}, [3]={n,f}, [30]={{25,26,27,28,29,31,32,34,35,39,41,30},t}, [51]={{25,26,27,28,44,45,49,48,47,50,51},t}, [18]={n,f}, [67]={{25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67},t}, [61]={{25,26,27,28,29,31,32,34,35,39,41,59,61},t}, [55]={{25,26,27,28,44,45,49,48,47,52,53,54,55},t}, [46]={{25,26,27,28,44,45,49,48,47,46},t}, [42]={{25,26,27,28,29,31,32,34,35,38,42},t}, [40]={{25,26,27,28,29,31,32,34,35,40},t}, [52]={{25,26,27,28,44,45,49,48,47,52},t}, [54]={{25,26,27,28,44,45,49,48,47,52,53,54},t}, [43]={n,f}, [7]={n,f}, [9]={n,f}, [41]={{25,26,27,28,29,31,32,34,35,39,41},t}, [17]={n,f}, [38]={{25,26,27,28,29,31,32,34,35,38},t}, [28]={{25,26,27,28},t}, [5]={n,f}, [64]={{25,26,27,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64},t}, } return r
--[=[ @param instance Instance @return RBXScriptConnection Attaches the trove to a Roblox instance. Once this instance is removed from the game (parent or ancestor's parent set to `nil`), the trove will automatically clean up. :::caution Will throw an error if `instance` is not a descendant of the game hierarchy. ::: ]=]
function Trove:AttachToInstance(instance: Instance) if self._cleaning then error("Cannot call trove:AttachToInstance() while cleaning", 2) elseif not instance:IsDescendantOf(game) then error("Instance is not a descendant of the game hierarchy", 2) end return self:Connect(instance.Destroying, function() self:Destroy() end) end
--Main Settings:
HANDBRAKE = true PADDLE_SHIFTER = true PEDALS = true SHIFTER = true STEERING_WHEEL = true
--[[ Returns the height offset from the bottom of a character to the middle of its HumanoidRootPart --]]
local function getHumanoidRootPartOffset(humanoid: Humanoid) local rootPart = humanoid.RootPart assert(rootPart, "Humanoid has no RootPart set") return (rootPart.Size.Y * 0.5) + humanoid.HipHeight end return getHumanoidRootPartOffset
---[[ Fade Out and In Settings ]]
module.ChatWindowBackgroundFadeOutTime = 0.5 --Chat background will fade out after this many seconds. module.ChatWindowTextFadeOutTime = 30 --Chat text will fade out after this many seconds. module.ChatDefaultFadeDuration = 0.8 module.ChatShouldFadeInFromNewInformation = true module.ChatAnimationFPS = 60.0
--// Tables
local L_75_ = { "285421759"; "151130102"; "151130171"; "285421804"; "287769483"; "287769415"; "285421687"; "287769261"; "287772525"; "287772445"; "287772351"; "285421819"; "287772163"; } local L_76_ = workspace:FindFirstChild("BulletModel: " .. L_2_.Name) or Instance.new("Folder", workspace) L_76_.Name = "BulletModel: " .. L_2_.Name local L_77_ local L_78_ = L_23_.Ammo local L_79_ = L_23_.StoredAmmo * L_23_.MagCount local L_80_ = L_23_.ExplosiveAmmo IgnoreList = { L_3_, L_76_, L_5_ }
-- listen for jumping and landing and apply Sway and camera mvoement to the Viewmodel
Humanoid.StateChanged:Connect(function(oldstate, newstate) if isFirstPerson == true and IncludeJumpSway == true then -- dont apply camera/Viewmodel changes if we aren't in first person if newstate == Enum.HumanoidStateType.Landed then -- animate the camera's landing "thump" -- -- tween a dummy cframe value for camera recoil local camedit = Instance.new("CFrameValue") camedit.Value = CFrame.new(0,0,0)*CFrame.Angles(math.rad(-0.75)*SwaySize,0,0) local landedrecoil = TweenService:Create(camedit, TweenInfo.new((0.03*6)/Sensitivity, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)}) ; landedrecoil:Play() ; game.Debris:AddItem(landedrecoil, 2) landedrecoil.Completed:Connect(function() camedit.Value = CFrame.new(0,0,0)*CFrame.Angles(math.rad(0.225)*SwaySize,0,0) local landedrecovery = TweenService:Create(camedit, TweenInfo.new((0.03*24)/Sensitivity, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)}) ; landedrecovery:Play(); game.Debris:AddItem(landedrecovery, 3) end) -- apply the camera adjustments spawn(function() for i = 1,60 do Camera.CFrame = Camera.CFrame*camedit.Value RunService.Heartbeat:Wait() end end) -- animate the jump Sway to make the Viewmodel thump down on landing local viewmodelrecoil = TweenService:Create(JumpSwayGoal, TweenInfo.new(0.15/Sensitivity, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)*CFrame.Angles(-math.rad(5)*SwaySize,0,0)}) ; viewmodelrecoil:Play(); game.Debris:AddItem(viewmodelrecoil, 2) viewmodelrecoil.Completed:Connect(function() local viewmodelrecovery = TweenService:Create(JumpSwayGoal, TweenInfo.new(0.7/Sensitivity, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)}) ; viewmodelrecovery:Play() ; game.Debris:AddItem(viewmodelrecovery, 2) end) elseif newstate == Enum.HumanoidStateType.Freefall then -- animate jump Sway when the Character is falling or jumping local viewmodeljump = TweenService:Create(JumpSwayGoal, TweenInfo.new(0.5/Sensitivity, Enum.EasingStyle.Sine), {Value = CFrame.new(0,0,0)*CFrame.Angles(math.rad(7.5)*SwaySize,0,0)}) ; viewmodeljump:Play() ; game.Debris:AddItem(viewmodeljump, 2) end end end) local ArmCoroutine
-- Get the policy info for the user
local success, result = pcall(PolicyService.GetPolicyInfoForPlayerAsync, PolicyService, player) if success and result then if not result.AreAdsAllowed then -- Destroy all Main Portal Template instances on the user's client if ads are not allowed mainPortal:Destroy() mainImageAdUnit:Destroy() end else print("Failed to get policy for player", player.Name, "Exception:", result) end
-----------------------------------------------| Save Stats |------------------------------------------------------------
local DataStoreService = game:GetService("DataStoreService") local myDataStore = DataStoreService:GetDataStore("myDataStore") game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player local Time = Instance.new("IntValue") Time.Name = "Time" Time.Parent = leaderstats local playerUserId = "Player"..player.UserId local data local success, errormessage = pcall(function() data = myDataStore:GetAsync(playerUserId) end) if success then Time.Value = data end while wait(1) do player.leaderstats.Time.Value = player.leaderstats.Time.Value + 0 --Don't change it or it will make it go up twice end end) game.Players.PlayerRemoving:Connect(function(player) local playerUserId = "Player"..player.UserId local data = player.leaderstats.Time.Value myDataStore:SetAsync(playerUserId, data) end)
--!nonstrict --[[ -- Original By Kip Turner, Copyright Roblox 2014 -- Updated by Garnold to utilize the new PathfindingService API, 2017 -- 2018 PlayerScripts Update - AllYourBlox --]]
--!strict
local PhysicsService = game:GetService("PhysicsService") local OPT_CREATE_GROUPS = true local OPT_GROUP_ATTRIBUTE = "CollisionGroup" local ERR_NO_GROUP = "No %q attribute has been set on %s" local fmt = string.format local Util = {} Util.__index = Util function Util.new(instance: Instance) local self = setmetatable({}, Util) self._events = {} self._target = instance self._group = instance:GetAttribute(OPT_GROUP_ATTRIBUTE) if type(self._group) ~= "string" then error(fmt(ERR_NO_GROUP, OPT_GROUP_ATTRIBUTE, instance:GetFullName()), 2) end self:ApplyCollisionGroup() table.insert(self._events, self._target.DescendantAdded:Connect(function(child) if child:IsA("BasePart") then self:ApplyCollisionGroupToPart(child::BasePart) end end)) return self end function Util:CreateCollisionGroupIfNotExists() if OPT_CREATE_GROUPS == false then return end if not PhysicsService:GetCollisionGroupId(self._group) then PhysicsService:CreateCollisionGroup(self._group) end end function Util:ApplyCollisionGroupToPart(part: BasePart) PhysicsService:SetPartCollisionGroup(part, self._group) end function Util:ApplyCollisionGroup() self:CreateCollisionGroupIfNotExists() if self._target:IsA("BasePart") then self:ApplyCollisionGroupToPart(self._target::BasePart) else for _, child: BasePart in ipairs(self._target:GetDescendants()) do if not child:IsA("BasePart") then continue end self:ApplyCollisionGroupToPart(child) end end end function Util:Destroy() for _, event: RBXScriptConnection in ipairs(self._events) do event:Disconnect() end end return Util
--[[ Provides a client API to connect and disconnect UILayers from Zones. A connected UILayer opens on the local player's screen when the player enters the connected zone. --]]
local CollectionService = game:GetService("CollectionService") local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local UIHandler = require(script.Parent.UIHandler) local UILayerId = require(ReplicatedStorage.Source.SharedConstants.UILayerId) local ZoneIdTag = require(ReplicatedStorage.Source.SharedConstants.CollectionServiceTag.ZoneIdTag) local localPlayer = Players.LocalPlayer :: Player type ConnectionsByName = { -- [ConnectionName] = Connection [string]: RBXScriptConnection, } type ConnectionsByLayerId = { -- [UILayerId] [string]: ConnectionsByName, } type ConnectionsByZoneId = { -- [ZoneId] [string]: ConnectionsByLayerId, } local UIZoneHandler = {} UIZoneHandler._uiConnectionsByZoneId = {} :: ConnectionsByZoneId function UIZoneHandler.connectUiToZone(uiLayerId: UILayerId.EnumType, zoneId: ZoneIdTag.EnumType) local characterMaybe = localPlayer.Character if characterMaybe and CollectionService:HasTag(characterMaybe, zoneId) then UIHandler.show(uiLayerId) else UIHandler.hide(uiLayerId) end local connectionsByLayerId: ConnectionsByLayerId = UIZoneHandler._uiConnectionsByZoneId[zoneId] or {} local connectionsByName: ConnectionsByName = connectionsByLayerId[uiLayerId] or {} if not connectionsByName.instanceAddedSignal then connectionsByName.instanceAddedSignal = CollectionService:GetInstanceAddedSignal(zoneId) :Connect(function(instance: Instance) if instance ~= localPlayer.Character then return end UIHandler.show(uiLayerId) end) end if not connectionsByName.instanceRemovedSignal then connectionsByName.instanceRemovedSignal = CollectionService:GetInstanceRemovedSignal(zoneId) :Connect(function(instance: Instance) if instance ~= localPlayer.Character then return end UIHandler.hide(uiLayerId) end) end connectionsByLayerId[uiLayerId] = connectionsByName UIZoneHandler._uiConnectionsByZoneId[zoneId] = connectionsByLayerId end function UIZoneHandler.disconnectUiFromZone(uiLayerId: UILayerId.EnumType, zoneId: ZoneIdTag.EnumType) local connectionsByLayerId = UIZoneHandler._uiConnectionsByZoneId[zoneId] if not connectionsByLayerId then return end local connectionsByName = connectionsByLayerId[uiLayerId] if not connectionsByName then return end for _, connection in pairs(connectionsByName) do connection:Disconnect() end connectionsByLayerId[uiLayerId] = nil end return UIZoneHandler
-- весь интерфейс GUI размещать во фрейме frmContext -- весьма желательно с якорем в (0.5,0.5) от центра формы
me.ramka.Size = UDim2.new(1,0,1,0) me.Visible=false
-- ================================================================================ -- Settings - Overdrive -- ================================================================================
local Settings = {} Settings.DefaultSpeed = 250 -- Speed when not boosted [Studs/second, Range 50-300] Settings.BoostSpeed = 400 -- Speed when boosted [Studs/second, Maximum: 400] Settings.BoostAmount = 4 -- Duration of boost in seconds Settings.Steering = 5 -- How quickly the speeder turns [Range: 1-10]
-- Deprecated in favour of GetMessageModeTextButton -- Retained for compatibility reasons.
function methods:GetMessageModeTextLabel() return self:GetMessageModeTextButton() end function methods:IsFocused() if self.UserHasChatOff then return false end return self:GetTextBox():IsFocused() end function methods:GetVisible() return self.GuiObject.Visible end function methods:CaptureFocus() if not self.UserHasChatOff then self:GetTextBox():CaptureFocus() end end function methods:ReleaseFocus(didRelease) self:GetTextBox():ReleaseFocus(didRelease) end function methods:ResetText() self:GetTextBox().Text = "" end function methods:SetText(text) self:GetTextBox().Text = text end function methods:GetEnabled() return self.GuiObject.Visible end function methods:SetEnabled(enabled) if self.UserHasChatOff then -- The chat bar can not be removed if a user has chat turned off so that -- the chat bar can display a message explaining that chat is turned off. self.GuiObject.Visible = true else self.GuiObject.Visible = enabled end end function methods:SetTextLabelText(text) if not self.UserHasChatOff then self.TextLabel.Text = text end end function methods:SetTextBoxText(text) self.TextBox.Text = text end function methods:GetTextBoxText() return self.TextBox.Text end function methods:ResetSize() self.TargetYSize = 0 self:TweenToTargetYSize() end function methods:CalculateSize() if self.CalculatingSizeLock then return end self.CalculatingSizeLock = true local lastPos = self.GuiObject.Size self.GuiObject.Size = UDim2.new(1, 0, 0, 46) local textSize = nil local bounds = nil if self:IsFocused() or self.TextBox.Text ~= "" then textSize = self.TextBox.textSize bounds = self.TextBox.TextBounds.Y else textSize = self.TextLabel.textSize bounds = self.TextLabel.TextBounds.Y end self.GuiObject.Size = lastPos local newTargetYSize = bounds - textSize if (self.TargetYSize ~= newTargetYSize) then self.TargetYSize = newTargetYSize self:TweenToTargetYSize() end self.CalculatingSizeLock = false end function methods:TweenToTargetYSize() local endSize = UDim2.new(1, 0, 1, self.TargetYSize) local curSize = self.GuiObject.Size local curAbsoluteSizeY = self.GuiObject.AbsoluteSize.Y self.GuiObject.Size = endSize local endAbsoluteSizeY = self.GuiObject.AbsoluteSize.Y self.GuiObject.Size = curSize local pixelDistance = math.abs(endAbsoluteSizeY - curAbsoluteSizeY) local tweeningTime = math.min(1, (pixelDistance * (1 / self.TweenPixelsPerSecond))) -- pixelDistance * (seconds per pixels) local success = pcall(function() self.GuiObject:TweenSize(endSize, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, tweeningTime, true) end) if (not success) then self.GuiObject.Size = endSize end end function methods:SetTextSize(textSize) if not self:IsInCustomState() then if self.TextBox then self.TextBox.TextSize = textSize end if self.TextLabel then self.TextLabel.TextSize = textSize end end end function methods:GetDefaultChannelNameColor() if ChatSettings.DefaultChannelNameColor then return ChatSettings.DefaultChannelNameColor end return Color3.fromRGB(35, 76, 142) end function methods:SetChannelTarget(targetChannel) local messageModeTextButton = self.GuiObjects.MessageModeTextButton local textBox = self.TextBox local textLabel = self.TextLabel self.TargetChannel = targetChannel if not self:IsInCustomState() then if targetChannel ~= ChatSettings.GeneralChannelName then messageModeTextButton.Size = UDim2.new(0, 1000, 1, 0) messageModeTextButton.Text = string.format("[%s] ", targetChannel) local channelNameColor = self:GetChannelNameColor(targetChannel) if channelNameColor then messageModeTextButton.TextColor3 = channelNameColor else messageModeTextButton.TextColor3 = self:GetDefaultChannelNameColor() end local xSize = messageModeTextButton.TextBounds.X messageModeTextButton.Size = UDim2.new(0, xSize, 1, 0) textBox.Size = UDim2.new(1, -xSize, 1, 0) textBox.Position = UDim2.new(0, xSize, 0, 0) textLabel.Size = UDim2.new(1, -xSize, 1, 0) textLabel.Position = UDim2.new(0, xSize, 0, 0) else messageModeTextButton.Text = "" messageModeTextButton.Size = UDim2.new(0, 0, 0, 0) textBox.Size = UDim2.new(1, 0, 1, 0) textBox.Position = UDim2.new(0, 0, 0, 0) textLabel.Size = UDim2.new(1, 0, 1, 0) textLabel.Position = UDim2.new(0, 0, 0, 0) end end end function methods:IsInCustomState() return self.InCustomState end function methods:ResetCustomState() if self.InCustomState then self.CustomState:Destroy() self.CustomState = nil self.InCustomState = false self.ChatBarParentFrame:ClearAllChildren() self:CreateGuiObjects(self.ChatBarParentFrame) self:SetTextLabelText( ChatLocalization:Get( "GameChat_ChatMain_ChatBarText", 'To chat click here or press "/" key' ) ) end end function methods:GetCustomMessage() if self.InCustomState then return self.CustomState:GetMessage() end return nil end function methods:CustomStateProcessCompletedMessage(message) if self.InCustomState then return self.CustomState:ProcessCompletedMessage() end return false end function methods:FadeOutBackground(duration) self.AnimParams.Background_TargetTransparency = 1 self.AnimParams.Background_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration) self:FadeOutText(duration) end function methods:FadeInBackground(duration) self.AnimParams.Background_TargetTransparency = 0.6 self.AnimParams.Background_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration) self:FadeInText(duration) end function methods:FadeOutText(duration) self.AnimParams.Text_TargetTransparency = 1 self.AnimParams.Text_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration) end function methods:FadeInText(duration) self.AnimParams.Text_TargetTransparency = 0.4 self.AnimParams.Text_NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration) end function methods:AnimGuiObjects() self.GuiObject.BackgroundTransparency = self.AnimParams.Background_CurrentTransparency self.GuiObjects.TextBoxFrame.BackgroundTransparency = self.AnimParams.Background_CurrentTransparency self.GuiObjects.TextLabel.TextTransparency = self.AnimParams.Text_CurrentTransparency self.GuiObjects.TextBox.TextTransparency = self.AnimParams.Text_CurrentTransparency self.GuiObjects.MessageModeTextButton.TextTransparency = self.AnimParams.Text_CurrentTransparency end function methods:InitializeAnimParams() self.AnimParams.Text_TargetTransparency = 0.4 self.AnimParams.Text_CurrentTransparency = 0.4 self.AnimParams.Text_NormalizedExptValue = 1 self.AnimParams.Background_TargetTransparency = 0.6 self.AnimParams.Background_CurrentTransparency = 0.6 self.AnimParams.Background_NormalizedExptValue = 1 end function methods:Update(dtScale) self.AnimParams.Text_CurrentTransparency = CurveUtil:Expt( self.AnimParams.Text_CurrentTransparency, self.AnimParams.Text_TargetTransparency, self.AnimParams.Text_NormalizedExptValue, dtScale ) self.AnimParams.Background_CurrentTransparency = CurveUtil:Expt( self.AnimParams.Background_CurrentTransparency, self.AnimParams.Background_TargetTransparency, self.AnimParams.Background_NormalizedExptValue, dtScale ) self:AnimGuiObjects() end function methods:SetChannelNameColor(channelName, channelNameColor) self.ChannelNameColors[channelName] = channelNameColor if self.GuiObjects.MessageModeTextButton.Text == channelName then self.GuiObjects.MessageModeTextButton.TextColor3 = channelNameColor end end function methods:GetChannelNameColor(channelName) return self.ChannelNameColors[channelName] end
--Create the viewport camera
local Camera = instance("Camera") local ValidClasses = { ["MeshPart"] = true; ["Part"] = true; ["Accoutrement"] = true; ["Pants"] = true; ["Shirt"] = true; ["Humanoid"] = true; ["UnionOperation"] = true; } local function RenderHumanoid(Model, Parent, MainModel) local ModelParts = Model:GetDescendants() for i=1, #ModelParts do local Part = ModelParts[i] if ValidClasses[Part.ClassName] then local a = Part.Archivable Part.Archivable = true local RenderClone = Part:Clone() Part.Archivable = a if (RenderClone.ClassName == "Part" or RenderClone.ClassName == "MeshPart") then RenderClone.CanCollide = false; --RenderClone.Anchored = true; end if Part.ClassName == "MeshPart" or Part.ClassName == "Part" then PartUpdater = RunService.Heartbeat:Connect(function() if Part then RenderClone.CFrame = Part.CFrame else RenderClone:Destroy() PartUpdater:Disconnect() end end) elseif Part:IsA("Accoutrement") then PartUpdater = RunService.Heartbeat:Connect(function() if Part then if RenderClone.Handle then RenderClone.Handle.CFrame = Part.Handle.CFrame end else RenderClone:Destroy() PartUpdater:Disconnect() end end) elseif Part.ClassName == "Humanoid" then --Disable all states. We only want it for clothing wrapping, not for stupid @$$ performance issues RenderClone:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false) RenderClone:SetStateEnabled(Enum.HumanoidStateType.Running, false) RenderClone:SetStateEnabled(Enum.HumanoidStateType.RunningNoPhysics, false) RenderClone:SetStateEnabled(Enum.HumanoidStateType.Climbing, false) RenderClone:SetStateEnabled(Enum.HumanoidStateType.StrafingNoPhysics, false) RenderClone:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false) RenderClone:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false) RenderClone:SetStateEnabled(Enum.HumanoidStateType.Jumping, false) RenderClone:SetStateEnabled(Enum.HumanoidStateType.Landed, false) RenderClone:SetStateEnabled(Enum.HumanoidStateType.Flying, false) RenderClone:SetStateEnabled(Enum.HumanoidStateType.Freefall, false) RenderClone:SetStateEnabled(Enum.HumanoidStateType.Seated, false) RenderClone:SetStateEnabled(Enum.HumanoidStateType.PlatformStanding, false) RenderClone:SetStateEnabled(Enum.HumanoidStateType.Dead, false) RenderClone:SetStateEnabled(Enum.HumanoidStateType.Swimming, false) RenderClone:SetStateEnabled(Enum.HumanoidStateType.Physics, false) end RenderClone.Parent = Parent end end end
--Change sound id to the id you want to play
debounce = false script.Parent.Touched:connect(function(hit) if not debounce then debounce = true if(hit.Parent:FindFirstChild("Humanoid")~=nil)then local player = game.Players:GetPlayerFromCharacter(hit.Parent) local sound = script.Parent.Sound:Clone() sound.Parent = player.PlayerGui sound:Play() wait(0.1)--change to how long before the sound plays again after retouching it end debounce = false end end)
--[[ If you add more parts titled "Destination 3" or "Destination 4" etc. Then the platform will work with those new destinations. Use Ctrl + D to duplicate a destination block while it is selected, which keeps the duplicate under the same folder. If a destination is outside the folder, then it won't be added to the destination list. SETTINGS - Edit the settings to change how the platform works. ------------------------------------------------------------------------------------------------------------------------------]]
moveDelay = 4 -- The delay (in seconds) for moving between destinations. topSpeed = 30 -- The maximum speed that the platform can move at.
---Controls UI
script.Parent.Parent:WaitForChild("Controls") script.Parent.Parent:WaitForChild("ControlsOpen") script.Parent:WaitForChild("Window") script.Parent:WaitForChild("Toggle") local car = script.Parent.Parent.Car.Value local _Tune = require(car["A-Chassis Tune"]) local UserInputService = game:GetService("UserInputService") local cPanel = script.Parent local Controls = script.Parent.Parent.Controls local ver = require(car["A-Chassis Tune"].README) cPanel.Window["//INSPARE"].Text = "A-Chassis "..ver.." // INSPARE" local controlsOpen = false local cInputB = nil local cInputT = nil local cInput = false local UIS1 = nil local UIS2 = nil for i,v in pairs(_Tune.Peripherals) do script.Parent.Parent.Controls:WaitForChild(i) local slider = cPanel.Window.Content[i] slider.Text = v.."%" slider.S.CanvasPosition=Vector2.new(v*(slider.S.CanvasSize.X.Offset-slider.S.Size.X.Offset)/100,0) slider.S.Changed:connect(function(property) if property=="CanvasPosition" then Controls[i].Value = math.floor(100*slider.S.CanvasPosition.x/(slider.S.CanvasSize.X.Offset-slider.S.Size.X.Offset)) slider.Text = Controls[i].Value.."%" end end) end for i,v in pairs(_Tune.Controls) do script.Parent.Parent.Controls:WaitForChild(i) local button = cPanel.Window.Content[i] button.Text = v.Name button.MouseButton1Click:connect(function() if UIS1 ~= nil then UIS1:disconnect() end if UIS2 ~= nil then UIS2:disconnect() end UIS1 = UserInputService.InputBegan:connect(function(input) if cInput then cInputB = input.KeyCode cInputT = input.UserInputType end end) UIS2 = UserInputService.InputChanged:connect(function(input) if cInput and (input.KeyCode==Enum.KeyCode.Thumbstick1 or input.KeyCode==Enum.KeyCode.Thumbstick2) then cInputB = input.KeyCode cInputT = input.UserInputType end end) script.Parent.Parent.ControlsOpen.Value = true cPanel.Window.Overlay.Visible = true cInput = true repeat wait() until cInputB~=nil if UIS1 ~= nil then UIS1:disconnect() end if UIS2 ~= nil then UIS2:disconnect() end if cInputB == Enum.KeyCode.Return or cInputB == Enum.KeyCode.KeypadEnter then --do nothing elseif string.find(i,"Contlr")~=nil then if cInputT.Name:find("Gamepad") then Controls[i].Value = cInputB.Name button.Text = cInputB.Name else cPanel.Window.Error.Visible = true end elseif i=="MouseThrottle" or i=="MouseBrake" then if cInputT == Enum.UserInputType.MouseButton1 or cInputT == Enum.UserInputType.MouseButton2 then Controls[i].Value = cInputT.Name button.Text = cInputT.Name elseif cInputT == Enum.UserInputType.Keyboard then Controls[i].Value = cInputB.Name button.Text = cInputB.Name else cPanel.Window.Error.Visible = true end else if cInputT == Enum.UserInputType.Keyboard then Controls[i].Value = cInputB.Name button.Text = cInputB.Name else cPanel.Window.Error.Visible = true end end cInputB = nil cInputT = nil cInput = false wait(.2) cPanel.Window.Overlay.Visible = false script.Parent.Parent.ControlsOpen.Value = false end) end cPanel.Window.Error.Changed:connect(function(property) if property == "Visible" then wait(3) cPanel.Window.Error.Visible = false end end) cPanel.Toggle.MouseButton1Click:connect(function() controlsOpen = not controlsOpen if controlsOpen then cPanel.Toggle.BackgroundColor3 = Color3.new(0, 0, 0) cPanel.Window:TweenPosition(UDim2.new(0.5, -250,0.5, -250),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.7,true) else if UIS1 ~= nil then UIS1:disconnect() end if UIS2 ~= nil then UIS2:disconnect() end cPanel.Toggle.BackgroundColor3 = Color3.new(0, 0, 0) cPanel.Window:TweenPosition(UDim2.new(0.5, -250,0, -500),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.7,true) end end) cPanel.Window.Tabs.Keyboard.MouseButton1Click:connect(function() cPanel.Window.Content:TweenPosition(UDim2.new(0, 0, 0, 60),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true) cPanel.Window.Tabs.Keyboard:TweenPosition(UDim2.new(0, 5, 0, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true) cPanel.Window.Tabs.Mouse:TweenPosition(UDim2.new(0, 120, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true) cPanel.Window.Tabs.Controller:TweenPosition(UDim2.new(0, 235, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true) end) cPanel.Window.Tabs.Mouse.MouseButton1Click:connect(function() cPanel.Window.Content:TweenPosition(UDim2.new(-1, 0, 0, 60),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true) cPanel.Window.Tabs.Keyboard:TweenPosition(UDim2.new(0, 5, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true) cPanel.Window.Tabs.Mouse:TweenPosition(UDim2.new(0, 120, 0, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true) cPanel.Window.Tabs.Controller:TweenPosition(UDim2.new(0, 235, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true) end) cPanel.Window.Tabs.Controller.MouseButton1Click:connect(function() cPanel.Window.Content:TweenPosition(UDim2.new(-2, 0, 0, 60),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true) cPanel.Window.Tabs.Keyboard:TweenPosition(UDim2.new(0, 5, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true) cPanel.Window.Tabs.Mouse:TweenPosition(UDim2.new(0, 120, 0, -5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true) cPanel.Window.Tabs.Controller:TweenPosition(UDim2.new(0, 235, 0, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,true) end) wait(.5) cPanel.Toggle:TweenPosition(UDim2.new(0.5, -50, 1, -25),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.4,false) for i=1,6 do cPanel.Toggle.BackgroundColor3 = Color3.new(0, 0, 0) wait(.2) if controlsOpen then cPanel.Toggle.BackgroundColor3 = Color3.new(0, 0, 0) else cPanel.Toggle.BackgroundColor3 = Color3.new(0, 0, 0) end wait(.2) end
--[[ signal = Signal.new([maid: Maid]) signal = Signal.Proxy(rbxSignal: RBXScriptSignal [, maid: Maid]) Signal.Is(object: any): boolean signal:Fire(...) signal:Wait() signal:WaitPromise() signal:Destroy() signal:DisconnectAll() connection = signal:Connect((...) -> void) connection:Disconnect() connection:IsConnected() --]]
local Promise = require(script.Parent.Promise) local Connection = {} Connection.__index = Connection function Connection.new(signal, connection) local self = setmetatable({ _signal = signal; _conn = connection; Connected = true; }, Connection) return self end function Connection:Disconnect() if (self._conn) then self._conn:Disconnect() self._conn = nil end if (not self._signal) then return end self.Connected = false local connections = self._signal._connections local connectionIndex = table.find(connections, self) if (connectionIndex) then local n = #connections connections[connectionIndex] = connections[n] connections[n] = nil end self._signal = nil end function Connection:IsConnected() if (self._conn) then return self._conn.Connected end return false end Connection.Destroy = Connection.Disconnect
-- functions
function onRunning(speed) if speed>0 then pose = "Running" else pose = "Standing" end end function onDied() pose = "Dead" end function onJumping() pose = "Jumping" end function onClimbing() pose = "Climbing" end function onGettingUp() pose = "GettingUp" end function onFreeFall() pose = "FreeFall" end function onFallingDown() pose = "FallingDown" end function onSeated() pose = "Seated" end function onPlatformStanding() pose = "PlatformStanding" end function onSwimming(speed) if speed>0 then pose = "Running" else pose = "Standing" end end function moveJump() RightShoulder.MaxVelocity = 0.5 LeftShoulder.MaxVelocity = 0.5 RightShoulder:SetDesiredAngle(3.14) LeftShoulder:SetDesiredAngle(-3.14) RightHip:SetDesiredAngle(0) LeftHip:SetDesiredAngle(0) end
--[[ -- player.User.Id = 1266073872 -- мир в который зашёл local lastWorld = DataStore2("lastWorld", player) -- связывание переменной со значением в БД local lw = lastWorld:Get("") -- по умолчанию пустая строка warn("lw: " .. lw) pltmp = {} pltmp.Character = player.Character pltmp.UserId = string.sub(lw,35) pltmp.Name = player.Name ]]
function meAdded(param) -- warn("build", param,"added") local creator = player.Name local object = script.Parent:FindFirstChild(param.Name) -- ищем добавленную постройку if object then -- если не найдём нам тут делать не чего local obj_name = object:FindFirstChild("name") --WaitForChild() if obj_name then local _obj = obj_name.Value local _cframe = tostring(object:GetPrimaryPartCFrame()) if _obj and _cframe then local _var = _obj .. ", " .. _cframe -- значение build[object.Name] = _var DataStore2.Combine(BaseName, "building") -- совмещение базы с ключами local tmp = DataStore2("building", player) -- связывание переменной со значением в БД -- !!!!! local tmp = DataStore2("building", lw) -- связывание переменной со значением в БД local lc = tmp:Set(build) -- сохраняем end else warn("build",param,"no found name") end else warn("build",param,"not found") end -- print("build table:",build) end function meRemove(param) -- warn("build", param,"remove") build[param.Name] = nil -- print("build ", build) DataStore2.Combine(BaseName, "building") -- совмещение базы с ключами local tmp = DataStore2("building", player) -- связывание переменной со значением в БД -- !!!! local tmp = DataStore2("building", lw) -- связывание переменной со значением в БД local lc = tmp:Set(build) -- сохраняем end me.ChildAdded:Connect(meAdded) me.ChildRemoved:Connect(meRemove)
--[=[ @within Shake @prop SustainTime number How long it takes for the shake sustains itself after fading in and before fading out. To sustain a shake indefinitely, set `Sustain` to `true`, and call the `StopSustain()` method to stop the sustain and fade out the shake effect. Defaults to `0`. ]=]
-- [ LOCALS ] --
local Notification = ReplicatedStorage:WaitForChild("Notification")
--[[ signal = Signal.new() signal:Fire(...) signal:Wait() signal:WaitPromise() signal:Destroy() signal:DisconnectAll() connection = signal:Connect(functionHandler) connection.Connected connection:Disconnect() connection:IsConnected() --]]
local Promise local Connection = {} Connection.__index = Connection function Connection.new(signal, connection) local self = setmetatable({ _signal = signal; _conn = connection; Connected = true; }, Connection) return self end function Connection:Disconnect() if (self._conn) then self._conn:Disconnect() self._conn = nil end if (not self._signal) then return end self.Connected = false local connections = self._signal._connections local connectionIndex = table.find(connections, self) if (connectionIndex) then local n = #connections connections[connectionIndex] = connections[n] connections[n] = nil end self._signal = nil end function Connection:IsConnected() if (self._conn) then return self._conn.Connected end return false end Connection.Destroy = Connection.Disconnect
--[[ Packages up the internals of Roact and exposes a public API for it. ]]
local GlobalConfig = require(script.GlobalConfig) local createReconciler = require(script.createReconciler) local createReconcilerCompat = require(script.createReconcilerCompat) local RobloxRenderer = require(script.RobloxRenderer) local strict = require(script.strict) local Binding = require(script.Binding) local robloxReconciler = createReconciler(RobloxRenderer) local reconcilerCompat = createReconcilerCompat(robloxReconciler) local Roact = strict { Component = require(script.Component), createElement = require(script.createElement), createFragment = require(script.createFragment), oneChild = require(script.oneChild), PureComponent = require(script.PureComponent), None = require(script.None), Portal = require(script.Portal), createRef = require(script.createRef), createBinding = Binding.create, joinBindings = Binding.join, Change = require(script.PropMarkers.Change), Children = require(script.PropMarkers.Children), Event = require(script.PropMarkers.Event), Ref = require(script.PropMarkers.Ref), mount = robloxReconciler.mountVirtualTree, unmount = robloxReconciler.unmountVirtualTree, update = robloxReconciler.updateVirtualTree, reify = reconcilerCompat.reify, teardown = reconcilerCompat.teardown, reconcile = reconcilerCompat.reconcile, setGlobalConfig = GlobalConfig.set, -- APIs that may change in the future without warning UNSTABLE = { }, } return Roact
--// # key, ManOn
mouse.KeyDown:connect(function(key) if key=="h" then veh.Lightbar.middle.Man:Play() veh.Lightbar.middle.Wail.Volume = 0 veh.Lightbar.middle.Yelp.Volume = 0 veh.Lightbar.middle.Priority.Volume = 0 script.Parent.Parent.Sirens.Man.BackgroundColor3 = Color3.fromRGB(215, 135, 110) end end)
-- regeneration
function regenHealth() if regening then return end regening = true while Humanoid.Health < Humanoid.MaxHealth do local s = wait(1) local health = Humanoid.Health if health~=0 and health < Humanoid.MaxHealth then local newHealthDelta = 0.01 * s * Humanoid.MaxHealth health = health + newHealthDelta Humanoid.Health = math.min(health,Humanoid.MaxHealth) end end if Humanoid.Health > Humanoid.MaxHealth then Humanoid.Health = Humanoid.MaxHealth end regening = false end Humanoid.HealthChanged:connect(regenHealth)
---------------------------------------------------------------------- --------------------[ GUNSETUP HANDLING ]----------------------------- ----------------------------------------------------------------------
local gunSetup = script:WaitForChild("gunSetup") function gunSetup.OnServerInvoke(Player, Vars) --------------------[ CREATING IGNORE MODELS ]-------------------------------- local gunIgnore = Instance.new("Model") gunIgnore.Name = "gunIgnore_"..Player.Name gunIgnore.Parent = Vars.ignoreModel --------------------[ MODIFYING THE PLAYER ]---------------------------------- Vars.Humanoid.AutoRotate = false Vars.Shoulders.Right.Part1 = nil Vars.Shoulders.Left.Part1 = nil local playerFolder = Instance.new("Model") playerFolder.Name = "playerFolder" playerFolder.Parent = gunIgnore local headBase = Instance.new("Part") headBase.Transparency = 1 headBase.Name = "headBase" headBase.CanCollide = false headBase.FormFactor = Enum.FormFactor.Custom headBase.Size = V3(0.2, 0.2, 0.2) headBase.BottomSurface = Enum.SurfaceType.Smooth headBase.TopSurface = Enum.SurfaceType.Smooth headBase.Parent = playerFolder local headWeld = Instance.new("Weld") headWeld.Part0 = Vars.Torso headWeld.Part1 = headBase headWeld.C0 = CF(0, 1.5, 0) headWeld.Parent = Vars.Torso local headWeld2 = Instance.new("Weld") headWeld2.Part0 = headBase headWeld2.Part1 = Vars.Head headWeld2.Parent = headBase local animBase = Instance.new("Part") animBase.Transparency = 1 animBase.Name = "animBase" animBase.CanCollide = false animBase.FormFactor = Enum.FormFactor.Custom animBase.Size = V3(0.2, 0.2, 0.2) animBase.BottomSurface = Enum.SurfaceType.Smooth animBase.TopSurface = Enum.SurfaceType.Smooth animBase.Parent = playerFolder local animWeld = Instance.new("Weld") animWeld.Part0 = animBase animWeld.Part1 = headBase animWeld.Parent = animBase local armBase = Instance.new("Part") armBase.Transparency = 1 armBase.Name = "ArmBase" armBase.CanCollide = false armBase.FormFactor = Enum.FormFactor.Custom armBase.Size = V3(0.2, 0.2, 0.2) armBase.BottomSurface = Enum.SurfaceType.Smooth armBase.TopSurface = Enum.SurfaceType.Smooth armBase.Parent = playerFolder local ABWeld = Instance.new("Weld") ABWeld.Part0 = armBase ABWeld.Part1 = animBase ABWeld.Parent = armBase local LArmBase = Instance.new("Part") LArmBase.Transparency = 1 LArmBase.Name = "LArmBase" LArmBase.CanCollide = false LArmBase.FormFactor = Enum.FormFactor.Custom LArmBase.Size = V3(0.2, 0.2, 0.2) LArmBase.BottomSurface = Enum.SurfaceType.Smooth LArmBase.TopSurface = Enum.SurfaceType.Smooth LArmBase.Parent = playerFolder local RArmBase = Instance.new("Part") RArmBase.Transparency = 1 RArmBase.Name = "RArmBase" RArmBase.CanCollide = false RArmBase.FormFactor = Enum.FormFactor.Custom RArmBase.Size = V3(0.2, 0.2, 0.2) RArmBase.BottomSurface = Enum.SurfaceType.Smooth RArmBase.TopSurface = Enum.SurfaceType.Smooth RArmBase.Parent = playerFolder local LWeld = Instance.new("Weld") LWeld.Name = "LWeld" LWeld.Part0 = armBase LWeld.Part1 = LArmBase LWeld.C0 = Vars.armC0[1] LWeld.C1 = Vars.leftArmC1 LWeld.Parent = armBase local RWeld = Instance.new("Weld") RWeld.Name = "RWeld" RWeld.Part0 = armBase RWeld.Part1 = RArmBase RWeld.C0 = Vars.armC0[2] RWeld.C1 = Vars.rightArmC1 RWeld.Parent = armBase local LWeld2 = Instance.new("Weld") LWeld2.Name = "LWeld" LWeld2.Part0 = LArmBase LWeld2.Part1 = Vars.LArm LWeld2.Parent = LArmBase local RWeld2 = Instance.new("Weld") RWeld2.Name = "RWeld" RWeld2.Part0 = RArmBase RWeld2.Part1 = Vars.RArm RWeld2.Parent = RArmBase local LLegWeld = Instance.new("Weld") LLegWeld.Name = "LLegWeld" LLegWeld.Part0 = Vars.Torso LLegWeld.Part1 = nil LLegWeld.C0 = CF(-0.5, -2, 0) LLegWeld.Parent = Vars.Torso local RLegWeld = Instance.new("Weld") RLegWeld.Name = "RLegWeld" RLegWeld.Part0 = Vars.Torso RLegWeld.Part1 = nil RLegWeld.C0 = CF(0.5, -2, 0) RLegWeld.Parent = Vars.Torso for _, Tab in pairs(Vars.gunParts) do Tab.Obj.Anchored = false local Weld = Instance.new("Weld") Weld.Name = "mainWeld" Weld.Part0 = Vars.Handle Weld.Part1 = Tab.Obj Weld.C0 = Tab.Obj.weldCF.Value Weld.Parent = Vars.Handle Tab.Weld = Weld end return gunIgnore, playerFolder, headWeld, headWeld2, animWeld, ABWeld, LWeld, RWeld, LWeld2, RWeld2, LLegWeld, RLegWeld, Vars.gunParts end
-- Camera mod
local Camera = require(cameraModule) Camera.UpVector = Vector3.new(0, 1, 0) Camera.TransitionRate = 0.15 Camera.UpCFrame = IDENTITYCF function Camera:GetUpVector(oldUpVector) return oldUpVector end function Camera:CalculateUpCFrame() local oldUpVector = self.UpVector local newUpVector = self:GetUpVector(oldUpVector) local backup = game.Workspace.CurrentCamera.CFrame.RightVector local transitionCF = getRotationBetween(oldUpVector, newUpVector, backup) local vecSlerpCF = IDENTITYCF:Lerp(transitionCF, self.TransitionRate) self.UpVector = vecSlerpCF * oldUpVector self.UpCFrame = vecSlerpCF * self.UpCFrame end function Camera:Update(dt) if self.activeCameraController then local newCameraCFrame, newCameraFocus = self.activeCameraController:Update(dt) self.activeCameraController:ApplyVRTransform() self:CalculateUpCFrame() self.activeCameraController:UpdateUpCFrame(self.UpCFrame) local offset = newCameraFocus:Inverse() * newCameraCFrame newCameraCFrame = newCameraFocus * self.UpCFrame * offset if self.activeOcclusionModule then newCameraCFrame, newCameraFocus = self.activeOcclusionModule:Update(dt, newCameraCFrame, newCameraFocus) end game.Workspace.CurrentCamera.CFrame = newCameraCFrame game.Workspace.CurrentCamera.Focus = newCameraFocus if self.activeTransparencyController then self.activeTransparencyController:Update() end end end
--------------------------------------------------------------------
mouse.KeyDown:connect(function(key) if key == camkey and enabled == false then enabled = true local character = char.Parent local descendants = character:GetDescendants() for index, descendant in pairs(descendants) do if descendant:IsA("Accessory") then descendant.Handle.Transparency = 1 end end elseif key == camkey and enabled == true then enabled = false local character = char.Parent local descendants = character:GetDescendants() for index, descendant in pairs(descendants) do if descendant:IsA("Accessory") then descendant.Handle.Transparency = 0 end end end end) car.DriveSeat.ChildRemoved:Connect(function(child) if child.Name == "SeatWeld" then local character = child.Part1.Parent local descendants = character:GetDescendants() for index, descendant in pairs(descendants) do if descendant:IsA("Accessory") then descendant.Handle.Transparency = 0 end end end end)
--// Handling Settings
Firerate = 60 / 1100; -- 60 = 1 Minute, 700 = Rounds per that 60 seconds. DO NOT TOUCH THE 60! FireMode = 2; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive
--[[ TouchThumbpad --]]
local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local GuiService = game:GetService("GuiService")
--[[Weight and CG]]
Tune.Weight = 2000 -- Total weight (in pounds) Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable) --[[Width]] 6 , --[[Height]] 3.5 , --[[Length]] 14 } Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100) Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels) Tune.WBVisible = false -- Makes the weight brick visible --Unsprung Weight Tune.FWheelDensity = .1 -- Front Wheel Density Tune.RWheelDensity = .1 -- Rear Wheel Density Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF] Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF] Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight) Tune.AxleDensity = .1 -- Density of structural members
--========================CAMERA========================--
input.InputBegan:connect(function(inp,CanWork) if inp.KeyCode == Settings.CameraKey and CanWork == false then if CamV == ("second") then cam.CameraType = "Custom" cam.FieldOfView = 70 cam.CameraSubject = plane.PilotSeat CamV = ("third") script.Parent.HUD.Visible = false run=false elseif CamV == ("third") then run=true CamV = ("first") cam.FieldOfView = 100 script.Parent.HUD.Visible = true elseif CamV == ("first") then run=true CamV = ("second") cam.FieldOfView = 100 end end end)
-- Ring3 ascending
for l = 1,#lifts3 do if (lifts3[l].className == "Part") then lifts3[l].BodyPosition.position = Vector3.new((lifts3[l].BodyPosition.position.x),(lifts3[l].BodyPosition.position.y+4),(lifts3[l].BodyPosition.position.z)) end end wait(0.1) for p = 1,#parts3 do parts3[p].CanCollide = true end wait(0.5)
-- Protected!
function DataStoreStage:_afterLoadGetAndApplyStagedData(name, data, defaultValue) if self._dataToSave and self._dataToSave[name] ~= nil then if self._dataToSave[name] == DataStoreDeleteToken then return defaultValue else return self._dataToSave[name] end elseif self._stores[name] then if self._stores[name]:HasWritableData() then local writer = self._stores[name]:GetNewWriter() local original = Table.deepCopy(data[name] or {}) writer:WriteMerge(original) return original end end if data[name] == nil then return defaultValue else return data[name] end end
--[=[ Whenever the ValueObject changes, stores the resulting value in that entry. @param name string @param valueObj Instance -- ValueBase object to store on @return MaidTask ]=]
function DataStoreStage:StoreOnValueChange(name, valueObj) assert(type(name) == "string", "Bad name") assert(typeof(valueObj) == "Instance", "Bad valueObj") if self._takenKeys[name] then error(("[DataStoreStage] - Already have a writer for %q"):format(name)) end self._takenKeys[name] = true local conn = valueObj.Changed:Connect(function() self:_doStore(name, valueObj.Value) end) self._maid:GiveTask(conn) return conn end
--Link to online Chat Voice code - not for editing.
if game:findFirstChild("NetworkServer") == nil then error("Chat Voice 2.0 can only work in online mode!") else require(294547006)(script, Chat_Voice_Settings) end
--Math
function Util.normalize(normMin, normMax, value, realMin, realMax) if realMin == nil then realMin = 0 end if realMax == nil then realMax = 1 end local value = (value - realMin)/(realMax - realMin) * (normMax - normMin) + normMin return value end function Util.denormalize(min, max, value) return (value * (max - (min)) + (min)) end function Util.invertValue(value, largestValue, smallestValue) return (largestValue - value) + smallestValue end
-- Game Services
local Configurations = require(game.ServerStorage.Configurations) local Events = game.ReplicatedStorage.Events local ResetMouseIcon = Events.ResetMouseIcon local TeamManager = require(script.Parent.TeamManager) local DisplayManager = require(script.Parent.DisplayManager)
-- Do not edit the below.
script.Parent.Changed:connect(function(child) SingleDriverMode = script.Parent.SingleMode.Value if SingleDriverMode == true then if script.Parent.Occupant ~= nil then if script.Parent.Occupant.Parent.Name ~= AllowedDriver then wait(0.15) script.Parent.Occupant.Jump = true else end end else for i,v in pairs(Blacklist) do if script.Parent.Occupant ~= nil then if script.Parent.Occupant.Parent.Name == Blacklist[i] then if script.Parent.Occupant.Parent.Name ~= AllowedDriver then wait(0.15) script.Parent.Occupant.Jump = true end else end end end end end)
--------------| SYSTEM SETTINGS |--------------
Prefix = ":"; -- The character you use before every command (e.g. ';jump me'). SplitKey = " "; -- The character inbetween command arguments (e.g. setting it to '/' would change ';jump me' to ';jump/me'). BatchKey = ""; -- The character inbetween batch commands (e.g. setting it to '|' would change ';jump me ;fire me ;smoke me' to ';jump me | ;fire me | ;smoke me' QualifierBatchKey = ","; -- The character used to split up qualifiers (e.g. ;jump player1,player2,player3) Theme = "Blue"; -- The default UI theme. NoticeSoundId = 2865227271; -- The SoundId for notices. NoticeVolume = 0.1; -- The Volume for notices. NoticePitch = 1; -- The Pitch/PlaybackSpeed for notices. ErrorSoundId = 2865228021; -- The SoundId for error notifications. ErrorVolume = 0.1; -- The Volume for error notifications. ErrorPitch = 1; -- The Pitch/PlaybackSpeed for error notifications. AlertSoundId = 9161622880; -- The SoundId for alerts. AlertVolume = 0.5; -- The Volume for alerts. AlertPitch = 1; -- The Pitch/PlaybackSpeed for alerts. WelcomeBadgeId = 0; -- Award new players a badge, such as 'Welcome to the game!'. Set to 0 for no badge. CommandDebounce = true; -- Wait until the command effect is over to use again. Helps to limit abuse & lag. Set to 'false' to disable. SaveRank = true; -- Saves a player's rank in the server they received it. (e.g. ;rank plrName rank). Use ';permRank plrName rank' to permanently save a rank. Set to 'false' to disable. LoopCommands = 3; -- The minimum rank required to use LoopCommands. MusicList = {}; -- Songs which automatically appear in a user's radio. Type '!radio' to display the radio. ThemeColors = { -- The colours players can set their HD Admin UI (in the 'Settings' menu). | Format: {ThemeName, ThemeColor3Value}; {"Red", Color3.fromRGB(150, 0, 0), }; {"Orange", Color3.fromRGB(150, 75, 0), }; {"Brown", Color3.fromRGB(120, 80, 30), }; {"Yellow", Color3.fromRGB(130, 120, 0), }; {"Green", Color3.fromRGB(0, 120, 0), }; {"Blue", Color3.fromRGB(0, 100, 150), }; {"Purple", Color3.fromRGB(100, 0, 150), }; {"Pink", Color3.fromRGB(150, 0, 100), }; {"Black", Color3.fromRGB(60, 60, 60), }; }; Colors = { -- The colours for ChatColors and command arguments. | Format: {"ShortName", "FullName", Color3Value}; {"r", "Red", Color3.fromRGB(255, 0, 0) }; {"o", "Orange", Color3.fromRGB(250, 100, 0) }; {"y", "Yellow", Color3.fromRGB(255, 255, 0) }; {"g", "Green" , Color3.fromRGB(0, 255, 0) }; {"dg", "DarkGreen" , Color3.fromRGB(0, 125, 0) }; {"b", "Blue", Color3.fromRGB(0, 255, 255) }; {"db", "DarkBlue", Color3.fromRGB(0, 50, 255) }; {"p", "Purple", Color3.fromRGB(150, 0, 255) }; {"pk", "Pink", Color3.fromRGB(255, 85, 185) }; {"bk", "Black", Color3.fromRGB(0, 0, 0) }; {"w", "White", Color3.fromRGB(255, 255, 255) }; }; ChatColors = { -- The colour a player's chat will appear depending on their rank. '["Owner"] = "Yellow";' makes the owner's chat yellow. [5] = "Yellow"; }; Cmdbar = 1; -- The minimum rank required to use the Cmdbar. Cmdbar2 = 3; -- The minimum rank required to use the Cmdbar2. ViewBanland = 3; -- The minimum rank required to view the banland. OnlyShowUsableCommands = false; -- Only display commands equal to or below the user's rank on the Commands page. RankRequiredToViewPage = { -- || The pages on the main menu || ["Commands"] = 0; ["Admin"] = 0; ["Settings"] = 0; }; RankRequiredToViewRank = { -- || The rank categories on the 'Ranks' subPage under Admin || ["Owner"] = 0; ["HeadAdmin"] = 0; ["Admin"] = 0; ["Mod"] = 0; ["VIP"] = 0; }; RankRequiredToViewRankType = { -- || The collection of loader-rank-rewarders on the 'Ranks' subPage under Admin || ["Owner"] = 0; ["SpecificUsers"] = 5; ["Gamepasses"] = 0; ["Assets"] = 0; ["Groups"] = 0; ["Friends"] = 0; ["FreeAdmin"] = 0; ["VipServerOwner"] = 0; }; RankRequiredToViewIcon = 0; WelcomeRankNotice = true; -- The 'You're a [rankName]' notice that appears when you join the game. Set to false to disable. WelcomeDonorNotice = true; -- The 'You're a Donor' notice that appears when you join the game. Set to false to disable. WarnIncorrectPrefix = true; -- Warn the user if using the wrong prefix | "Invalid prefix! Try using [correctPrefix][commandName] instead!" DisableAllNotices = false; -- Set to true to disable all HD Admin notices. ScaleLimit = 4; -- The maximum size players with a rank lower than 'IgnoreScaleLimit' can scale theirself. For example, players will be limited to ;size me 4 (if limit is 4) - any number above is blocked. IgnoreScaleLimit = 3; -- Any ranks equal or above this value will ignore 'ScaleLimit' CommandLimits = { -- Enables you to set limits for commands which have a number argument. Ranks equal to or higher than 'IgnoreLimit' will not be affected by Limit. ["fly"] = { Limit = 10000; IgnoreLimit = 3; }; ["fly2"] = { Limit = 10000; IgnoreLimit = 3; }; ["noclip"] = { Limit = 10000; IgnoreLimit = 3; }; ["noclip2"] = { Limit = 10000; IgnoreLimit = 3; }; ["speed"] = { Limit = 10000; IgnoreLimit = 3; }; ["jumpPower"] = { Limit = 10000; IgnoreLimit = 3; }; }; VIPServerCommandBlacklist = {"permRank", "permBan", "globalAnnouncement"}; -- Commands players are probihited from using in VIP Servers. GearBlacklist = {67798397}; -- The IDs of gear items to block when using the ;gear command. IgnoreGearBlacklist = 4; -- The minimum rank required to ignore the gear blacklist. PlayerDataStoreVersion = "V1.0"; -- Data about the player (i.e. permRanks, custom settings, etc). Changing the Version name will reset all PlayerData. SystemDataStoreVersion = "V1.0"; -- Data about the game (i.e. the banland, universal message system, etc). Changing the Version name will reset all SystemData. CoreNotices = { -- Modify core notices. You can find a table of all CoreNotices under [MainModule > Client > SharedModules > CoreNotices] --NoticeName = NoticeDetails; };
---
if script.Parent.Parent.Parent.IsOn.Value then script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true) end script.Parent.Parent.Parent.IsOn.Changed:connect(function() if script.Parent.Parent.Parent.IsOn.Value then script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true) end end) script.Parent.MouseButton1Click:connect(function() if car.Misc.Popups.Parts.L.L.L.Enabled == false and car.Body.Lights.H.L.L.Enabled == false then script.Parent.BackgroundColor3 = Color3.new(0,255/255,0) script.Parent.TextStrokeColor3 = Color3.new(0,255/255,0) car.Body.Lights.R.L.L.Enabled = true car.Body.Lights.PLATE.L.GUI.Enabled = true for index, child in pairs(car.Misc.Popups.Parts.L:GetChildren()) do child.Material = Enum.Material.Neon child.L.Enabled = true end for index, child in pairs(car.Body.Lights.R:GetChildren()) do child.Material = Enum.Material.Neon end for index, child in pairs(car.Body.Lights.H:GetChildren()) do child.Material = Enum.Material.SmoothPlastic child.L.Enabled = false end elseif car.Misc.Popups.Parts.L.L.L.Enabled == true and car.Body.Lights.H.L.L.Enabled == false then script.Parent.BackgroundColor3 = Color3.new(0,0,255/255) script.Parent.TextStrokeColor3 = Color3.new(0,0,255/255) car.Body.Lights.R.L.L.Enabled = true car.Body.Lights.PLATE.L.GUI.Enabled = true for index, child in pairs(car.Misc.Popups.Parts.L:GetChildren()) do child.Material = Enum.Material.Neon child.L.Enabled = true end for index, child in pairs(car.Body.Lights.R:GetChildren()) do child.Material = Enum.Material.Neon end for index, child in pairs(car.Body.Lights.H:GetChildren()) do child.Material = Enum.Material.Neon child.L.Enabled = true end elseif car.Misc.Popups.Parts.L.L.L.Enabled == true and car.Body.Lights.H.L.L.Enabled == true then script.Parent.BackgroundColor3 = Color3.new(0,0,0) script.Parent.TextStrokeColor3 = Color3.new(0,0,0) car.Body.Lights.R.L.L.Enabled = false car.Body.Lights.PLATE.L.GUI.Enabled = false for index, child in pairs(car.Misc.Popups.Parts.L:GetChildren()) do child.Material = Enum.Material.SmoothPlastic child.L.Enabled = false end for index, child in pairs(car.Body.Lights.R:GetChildren()) do child.Material = Enum.Material.SmoothPlastic end for index, child in pairs(car.Body.Lights.H:GetChildren()) do child.Material = Enum.Material.SmoothPlastic child.L.Enabled = false end end end) script.Parent.Parent.Parent.Values.Brake.Changed:connect(function() if script.Parent.Parent.Parent.Values.Brake.Value ~= 1 and script.Parent.Parent.Parent.IsOn.Value then for index, child in pairs(car.Body.Lights.B:GetChildren()) do child.Material = Enum.Material.SmoothPlastic end car.Body.Lights.B.L.L.Enabled = false else for index, child in pairs(car.Body.Lights.B:GetChildren()) do child.Material = Enum.Material.Neon end car.Body.Lights.B.L.L.Enabled = true end end) script.Parent.Parent.Parent.Values.Brake.Changed:connect(function() if script.Parent.Parent.Parent.Values.Brake.Value ~= 1 then for index, child in pairs(car.Body.Lights.B:GetChildren()) do child.Material = Enum.Material.SmoothPlastic end car.Body.Lights.B.L.L.Enabled = false car.Body.a1.Enabled = false car.Body.a2.Enabled = false car.Body.a3.Enabled = false else for index, child in pairs(car.Body.Lights.B:GetChildren()) do child.Material = Enum.Material.Neon end car.Body.Lights.B.L.L.Enabled = true car.Body.a1.Enabled = true car.Body.a2.Enabled = true car.Body.a3.Enabled = true end end) script.Parent.Parent.Parent.Values.Gear.Changed:connect(function() if script.Parent.Parent.Parent.Values.Gear.Value == -1 then for index, child in pairs(car.Body.Lights.Rev:GetChildren()) do child.Material = Enum.Material.Neon car.DriveSeat.Reverse:Play() end else for index, child in pairs(car.Body.Lights.Rev:GetChildren()) do child.Material = Enum.Material.SmoothPlastic car.DriveSeat.Reverse:Stop() end end end) while wait() do if (car.DriveSeat.Velocity.magnitude/40)+0.300 < 1.3 then car.DriveSeat.Reverse.Pitch = (car.DriveSeat.Velocity.magnitude/40)+0.300 car.DriveSeat.Reverse.Volume = (car.DriveSeat.Velocity.magnitude/150) else car.DriveSeat.Reverse.Pitch = 1.3 car.DriveSeat.Reverse.Volume = .2 end end
-- Hold:Play() -- HoldClose:Stop()
elseif not PlayIdle then
--- Drops the bag full of money onto the ground. ---@param Player Player ---@param Amount number
local function Handler(Player, Amount) local Character = Player.Character --// Sanity checks if (Player.Data.Silver.Value < Amount or Amount < 1 or math.sign(Amount) ~= 1) then return end --// Takes away the cash you just dropped from your data Player.Data.Silver.Value -= Amount --// I split a lot of the components of this up because it *sucks* looking at a huge wall of property changes, this makes it a bit easier. local Dropped: BasePart = script.ItemTemplate:Clone() Dropped.Name = Player.Name.."'s Dropped Silver" Dropped.BillboardGui.Enabled = true Amount = math.floor(Amount) Dropped.BillboardGui.ToolName.Text = Amount Dropped.CFrame = Character.HumanoidRootPart.CFrame * CFrame.new(0,-2,-3) Dropped.Parent = workspace.DroppedBags local HasHit = false local Connection; --// Moved down here because I literally thought this was a global at first. Connection = Dropped.Touched:Connect(function(Hit) if (HasHit) then return end if (IsCharacter(Hit.Parent)) then HasHit = GiveSilver(Amount, Hit.Parent); --// We know GiveSilver returns a boolean, so we can just set 'HasHit' to it. if (HasHit) then Dropped:Destroy() Connection:Disconnect() end end end) end Event.OnServerEvent:Connect(Handler)
-- goro7
local plr = game.Players.LocalPlayer script.Parent.ItemIcon.MouseButton1Click:connect(function() -- Play sound plr.PlayerGui.GUIClick:Play() -- Set as preview plr.PlayerGui.MainGui.Shop.MainFrame.Preview.Item.Value = script.Parent.Item.Value end)
--// SS3 b controls for AC6 by Itzt, originally for 2009 Kawasaki 1400 GTR.
wait(0.1) local player = game.Players.LocalPlayer local HUB = script.Parent.HUB local standButton = HUB.Stand local lightOn = false local Camera = game.Workspace.CurrentCamera local cam = script.Parent.nxtcam.Value local carSeat = script.Parent.CarSeat.Value local mouse = game.Players.LocalPlayer:GetMouse() local windows = false local W = script.Parent.W local ks = carSeat.Parent.Body.KW.swag local wheel1 = carSeat.Parent.Wheels.F local wheel2 = carSeat.Parent.Wheels.R local speed = carSeat.Velocity.magnitude local speedw = wheel2.RotVelocity.magnitude local speedw2 = wheel1.RotVelocity.magnitude local diff = math.abs(((speedw-speed)/190)/(speed/25))+.1 local Burnout = 0 local left = false local right = false
--TODO add map slices
Map[1] = Vector3.new(0,1,1) Map[2] = Vector3.new(0,1,1) WaitUntil(6) RegenMap() Map[3] = Vector3.new(1,0,1) WaitUntil(2) RegenMap()
--[[ Public API ]]
-- function MasterControl:Init() RunService:BindToRenderStep("MasterControlStep", Enum.RenderPriority.Input.Value, updateMovement) end function MasterControl:Enable() areControlsEnabled = true isJumpEnabled = true if self.ControlState.Current then self.ControlState.Current:Enable() end end function MasterControl:Disable() if self.ControlState.Current then self.ControlState.Current:Disable() end --After current control state is disabled, moveValue has been set to zero, --Call updateMovement one last time to make sure this propagates to the engine - --Otherwise if disabled while humanoid is moving, humanoid won't stop moving. updateMovement() isJumping = false areControlsEnabled = false end function MasterControl:EnableJump() isJumpEnabled = true if areControlsEnabled and self.ControlState:IsTouchJumpModuleUsed() then self.TouchJumpModule:Enable() end end function MasterControl:DisableJump() isJumpEnabled = false if self.ControlState:IsTouchJumpModuleUsed() then self.TouchJumpModule:Disable() end end function MasterControl:AddToPlayerMovement(playerMoveVector) moveValue = Vector3.new(moveValue.X + playerMoveVector.X, moveValue.Y + playerMoveVector.Y, 0) end function MasterControl:GetMoveVector() return moveValue end function MasterControl:SetIsJumping(jumping) if not isJumpEnabled then return end isJumping = jumping local humanoid = self:GetHumanoid() if humanoid and not humanoid.PlatformStand then humanoid.Jump = isJumping end end function MasterControl:DoJump() if not isJumpEnabled then return end local humanoid = self:GetHumanoid() if humanoid then humanoid.Jump = true end end function MasterControl:GetClickToMoveFailStateChanged() return clickToMoveFailStateChanged end return MasterControl
--[=[ Returns an observable that takes in a tuple, and emits that tuple, then completes. ```lua Rx.packed("a", "b") :Subscribe(function(first, second) print(first, second) --> a, b end) ``` @param ... any @return Observable ]=]
function Rx.packed(...) local args = table.pack(...) return Observable.new(function(sub) sub:Fire(unpack(args, 1, args.n)) sub:Complete() end) end
-- Private
function ViewportWindow:_createVPF(name, zindex) local vpf = Instance.new("ViewportFrame") vpf.LightColor = Color3.new(0, 0, 0) vpf.Size = UDim2.new(1, 0, 1, 0) vpf.Position = UDim2.new(0, 0, 0, 0) vpf.AnchorPoint = Vector2.new(0, 0) vpf.BackgroundTransparency = 1 vpf.LightDirection = -Lighting:GetSunDirection() vpf.Ambient = Lighting.Ambient vpf.Name = name vpf.ZIndex = zindex vpf.CurrentCamera = self.camera vpf.Parent = self.surfaceGui return vpf end function ViewportWindow:_refreshVisibility(cameraCFrame, surfaceCFrame, surfaceSize, marginOfError) local aabbCF, aabbSize = Helpers.getAABB({ surfaceCFrame * Vector3.new(-surfaceSize.X / 2 + marginOfError, surfaceSize.Y / 2 - marginOfError, -marginOfError), surfaceCFrame * Vector3.new(surfaceSize.X / 2 - marginOfError, surfaceSize.Y / 2 - marginOfError, -marginOfError), surfaceCFrame * Vector3.new(surfaceSize.X / 2 - marginOfError, -surfaceSize.Y / 2 + marginOfError, -marginOfError), surfaceCFrame* Vector3.new(-surfaceSize.X / 2 + marginOfError, -surfaceSize.Y / 2 + marginOfError, -marginOfError), cameraCFrame.Position, }) -- region3 is more performant tmk over newer API which allows rotation (which we don't need) -- local overlap = self.worldRoot:GetPartBoundsInBox(aabbCF, aabbSize) local overlap = self.worldRoot:FindPartsInRegion3(Region3.new( aabbCF.Position + aabbSize / 2, aabbCF.Position - aabbSize / 2 ), nil, math.huge) local overlapped = {} for _, part in pairs(overlap) do part.LocalTransparencyModifier = 1 overlapped[part] = true end for _, instance in pairs(self.worldRoot:GetDescendants()) do if instance:IsA("BasePart") and not overlapped[instance] then instance.LocalTransparencyModifier = 0 end end end