prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
local hitPart = script.Parent local debounce = true local tool = game.ServerStorage.CookieSword -- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage hitPart.Touched:Connect(function(hit) if debounce == true then if hit.Parent:FindFirstChild("Humanoid") then local plr = game.Players:FindFirstChild(hit.Parent.Name) if plr then debounce = false hitPart.BrickColor = BrickColor.new("Bright red") tool:Clone().Parent = plr.Backpack wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again debounce = true hitPart.BrickColor = BrickColor.new("Bright green") end end end end)
-- ================================================================================ -- PUBLIC FUNCTIONS -- ================================================================================
function ArrowGuide.new(targets) local arrow = Instance.new("Part") arrow.Name = "Arrow" arrow.Size = Vector3.new(2, 1, 5) arrow.Color = Color3.new(252/255, 1/255, 7/255) -- Red arrow.CanCollide = false local mesh = Instance.new("SpecialMesh") mesh.MeshId = "http://www.roblox.com/asset/?id=14656345" -- Arrow mesh mesh.Scale = Vector3.new(0.2, 0.4, 0.2) mesh.Parent = arrow arrow.Position = character.PrimaryPart.Position + Vector3.new(0, character.PrimaryPart.Size.Y + OFFSET, 0) local arrowWeld = Instance.new("Weld") arrowWeld.Part0 = arrow arrowWeld.Part1 = character.PrimaryPart arrow.Parent = character RunService:BindToRenderStep("UpdateDirection", 1, function() if targets == 0 then return end local checkpoint = targets[1]:FindFirstChild("Checkpoint") local closestDistance = (arrow.Position - checkpoint.Position).magnitude local closestTarget = checkpoint -- Find nearest target for _, target in ipairs(targets) do local hit = target:FindFirstChild("Hit") if (not hit or hit.Value == false) then checkpoint = target:FindFirstChild("Checkpoint") local distance = (arrow.Position - checkpoint.Position).magnitude if distance < closestDistance then closestTarget = checkpoint end end end -- Point arrow at nearest target local newPos = character.PrimaryPart.Position + Vector3.new(0, character.PrimaryPart.Size.Y + OFFSET, 0) arrow.CFrame = CFrame.new(newPos, closestTarget.Position) end) return arrow end -- ArrowGuide.new()
-- module
local INPUT = {} function INPUT.GetActionInput(self, action) local input = "nil" if actions[action] then local primary, secondary = actions[action].Primary, actions[action].Secondary if primary then input = primary.Name elseif secondary then input = secondary.Name end end if REPLACEMENTS[input] then input = REPLACEMENTS[input] end return string.upper(input) end function INPUT.GetAllActionInputs(self, action) local inputP, inputS = "nil", "nil" if actions[action] then local primary, secondary = actions[action].Primary, actions[action].Secondary if primary then inputP = primary.Name end if secondary then inputS = secondary.Name end end if REPLACEMENTS[inputP] then inputP = REPLACEMENTS[inputP] end if REPLACEMENTS[inputS] then inputS = REPLACEMENTS[inputS] end return string.upper(inputP), string.upper(inputS) end if not initialized then local keybindChanged = Instance.new("BindableEvent") INPUT.KeybindChanged = keybindChanged.Event actionBegan = Instance.new("BindableEvent") actionEnded = Instance.new("BindableEvent") INPUT.ActionBegan = actionBegan.Event INPUT.ActionEnded = actionEnded.Event -- register actions local playerData = PLAYER_DATA:WaitForChild(PLAYER.Name) local keybinds = playerData:WaitForChild("Keybinds") local function Register(action, bindP, bindS) local primary, secondary if bindP then local A, B = string.match(bindP, "(.-)%.(.+)") if A and B then primary = Enum[A][B] end end if bindS then local A, B = string.match(bindS, "(.-)%.(.+)") if A and B then secondary = Enum[A][B] end end RegisterAction(action, primary, secondary) keybindChanged:Fire(action) end local function Handle(keybind) local action = keybind.Name local bind = keybind.Value if string.match(bind, ";") then local bindP, bindS = string.match(bind, "(.-);(.+)") if bindP and bindS then Register(action, bindP, bindS) elseif bindP then Register(action, bindP) elseif bindS then Register(action, nil, bindS) end else Register(action, bind) end end keybinds.ChildAdded:connect(function(keybind) keybind.Changed:connect(function() Handle(keybind) end) RunService.Stepped:wait() Handle(keybind) end) repeat RunService.Stepped:wait() until #keybinds:GetChildren() > 0 for _, keybind in pairs(keybinds:GetChildren()) do keybind.Changed:connect(function() Handle(keybind) end) Handle(keybind) end initialized = true end return INPUT
--[[Transmission]]
Tune.TransModes = {"Auto", "Semi"} --[[ [Modes] "Auto" : Automatic shifting "Semi" : Clutchless manual shifting, dual clutch transmission "Manual" : Manual shifting with clutch >Include within brackets eg: {"Semi"} or {"Auto", "Manual"} >First mode is default mode ]] --Automatic Settings Tune.AutoShiftMode = "Speed" --[[ [Modes] "Speed" : Shifts based on wheel speed "RPM" : Shifts based on RPM ]] Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev) Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev) --Gear Ratios Tune.FinalDrive = 3.9 -- Gearing determines top speed and wheel torque Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed --[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear --[[Neutral]] 0 , -- Ratios can also be deleted --[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required --[[ 2 ]] 2.04 , --[[ 3 ]] 1.38 , --[[ 4 ]] 1.03 , --[[ 5 ]] 0.81 , --[[ 6 ]] 0.64 , --[[ 7 ]] 0.50 , } Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
-- Compiled with roblox-ts v2.1.0 --[[ * * Represents a connection to a signal. ]]
local Connection do Connection = setmetatable({}, { __tostring = function() return "Connection" end, }) Connection.__index = Connection function Connection.new(...) local self = setmetatable({}, Connection) return self:constructor(...) or self end function Connection:constructor(signal, fn) self.signal = signal self.Connected = true self._fn = fn end function Connection:Disconnect() if not self.Connected then return nil end self.Connected = false if self.signal._handlerListHead == self then self.signal._handlerListHead = self._next else local prev = self.signal._handlerListHead while prev and prev._next ~= self do prev = prev._next end if prev then prev._next = self._next end end end function Connection:Destroy() self:Disconnect() end end
--Don't worry about the rest of the code, except for line 25.
game.Players.PlayerAdded:connect(function(player) local leader = Instance.new("Folder",player) leader.Name = "leaderstats" local Cash = Instance.new("IntValue",leader) Cash.Name = stat Cash.Value = ds:GetAsync(player.UserId) or startamount ds:SetAsync(player.UserId, Cash.Value) Cash.Changed:connect(function() ds:SetAsync(player.UserId, Cash.Value) end) end) game.Players.PlayerRemoving:connect(function(player) ds:SetAsync(player.UserId, player.leaderstats.Money.Value) --Change "Points" to the name of your leaderstat. end)
--/////////-- --Utilities-- --/////////--
local function isInRegion(Region, Position) local Extents = Region.Size /2 local Offset = GetOffset(Region, Position) return Offset.X < Extents.X and Offset.Y < Extents.Y and Offset.Z < Extents.Z end local function isInRegionIgnoreY(Region, Position) local Extents = Region.Size /2 local Offset = GetOffset(Region, Position) return Offset.X < Extents.X and Offset.Z < Extents.Z end
--// Ammo Settings
Ammo = 15; StoredAmmo = 15; MagCount = 30; -- If you want infinate ammo, set to math.huge EX. MagCount = math.huge; ExplosiveAmmo = 0;
---
local Paint = false script.Parent.MouseButton1Click:connect(function() Paint = not Paint handler:FireServer("Lavender",Paint) end)
-- Uber l33t maths to calcluate the angle needed to throw a projectile a distance, given the altitude of the end point and the projectile's velocity
function AngleOfReach(distance, altitude, velocity) local gravity = workspace.Gravity local theta = math.atan((velocity^2 + math.sqrt(velocity^4 -gravity*(gravity*distance^2 + 2*altitude*velocity^2)))/(gravity*distance)) if theta ~= theta then theta = math.pi/4 end return(theta) end
--~strict --[[ Packages up the internals of Roact and exposes a public API for it. ]]
local GlobalConfig = require(script.GlobalConfig) local createReconciler = require(script.createReconciler) local createReconcilerCompat = require(script.createReconcilerCompat) local RobloxRenderer = require(script.RobloxRenderer) local strict = require(script.strict) local Binding = require(script.Binding) local robloxReconciler = createReconciler(RobloxRenderer) local reconcilerCompat = createReconcilerCompat(robloxReconciler) local Roact = strict({ Component = require(script.Component), createElement = require(script.createElement), createFragment = require(script.createFragment), oneChild = require(script.oneChild), PureComponent = require(script.PureComponent), None = require(script.None), Portal = require(script.Portal), createRef = require(script.createRef), forwardRef = require(script.forwardRef), createBinding = Binding.create, joinBindings = Binding.join, createContext = require(script.createContext), Change = require(script.PropMarkers.Change), Children = require(script.PropMarkers.Children), Event = require(script.PropMarkers.Event), Ref = require(script.PropMarkers.Ref), mount = robloxReconciler.mountVirtualTree, unmount = robloxReconciler.unmountVirtualTree, update = robloxReconciler.updateVirtualTree, reify = reconcilerCompat.reify, teardown = reconcilerCompat.teardown, reconcile = reconcilerCompat.reconcile, setGlobalConfig = GlobalConfig.set, -- APIs that may change in the future without warning UNSTABLE = {}, }) return Roact
--[=[ Observes all descendants that match a predicate as a brio @param parent Instance @param predicate ((value: Instance) -> boolean)? -- Optional filter @return Observable<Brio<Instance>> ]=]
function RxInstanceUtils.observeDescendantsBrio(parent, predicate) assert(typeof(parent) == "Instance", "Bad parent") assert(type(predicate) == "function" or predicate == nil, "Bad predicate") return Observable.new(function(sub) local maid = Maid.new() local function handleDescendant(descendant) if not predicate or predicate(descendant) then local value = Brio.new(descendant) maid[descendant] = value sub:Fire(value) end end maid:GiveTask(parent.DescendantAdded:Connect(handleDescendant)) maid:GiveTask(parent.DescendantRemoving:Connect(function(descendant) maid[descendant] = nil end)) for _, descendant in pairs(parent:GetDescendants()) do handleDescendant(descendant) end return maid end) end
-- Ask server to give points randomly:
PointsService.GiveMePoints:Fire()
--Rescripted by Luckymaxer --Updated for R15 avatars by StarWars
Character = script.Parent Humanoid = Character:FindFirstChild("Humanoid") Head = Character:FindFirstChild("Head") Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("UpperTorso") Players = game:GetService("Players") Debris = game:GetService("Debris") Player = Players:GetPlayerFromCharacter(Character) Sounds = { Explosion = script:WaitForChild("Explosion"), } function DestroyScript() Debris:AddItem(script, 0.5) script:Destroy() end if not Head or not Torso or not Humanoid or Humanoid.Health == 0 or not Player then DestroyScript() return end Duration = 30 Humanoid.WalkSpeed = (16 * 1.6) Sparkles = Instance.new("Sparkles") Sparkles.SparkleColor = Color3.new(0.8, 0, 0.8) Sparkles.Enabled = true Debris:AddItem(Sparkles, Duration) Sparkles.Parent = Torso Count = script:FindFirstChild("CoffeeCount") if not Count then Count = Instance.new("IntValue") Count.Name = "CoffeeCount" Count.Value = 1 Count.Parent = script else if (Count.Value > 3) then if (math.random() > 0.5) then ExplosionSound = Sounds.Explosion:Clone() Debris:AddItem(ExplosionSound, 5) ExplosionSound.Parent = Head ExplosionSound:Play() local Explosion = Instance.new("Explosion") Explosion.ExplosionType = Enum.ExplosionType.NoCraters Explosion.BlastRadius = 2 Explosion.BlastPressure = 1000000 Explosion.Position = Torso.Position Explosion.Parent = game:GetService("Workspace") end end Count.Value = (Count.Value + 1) end wait(Duration) Humanoid.WalkSpeed = 16 DestroyScript()
-- Returns the Levenshtein distance between the two given strings
local utf8_len = utf8.len -- I'm not even sure if this is faster localized, thanks Luau and your massive inconsistency. local utf8_codes = utf8.codes local function Levenshtein(String1, String2) if String1 == String2 then return 0 end local Length1 = utf8_len(String1) local Length2 = utf8_len(String2) if Length1 == 0 then return Length2 elseif Length2 == 0 then return Length1 end local Matrix = {} -- Would love to use table.create for this, but it starts at 0. for Index = 0, Length1 do Matrix[Index] = {[0] = Index} end for Index = 0, Length2 do Matrix[0][Index] = Index end local Index = 1 local IndexSub1 for _, Code1 in utf8_codes(String1) do local Jndex = 1 local JndexSub1 for _, Code2 in utf8_codes(String2) do local Cost = Code1 == Code2 and 0 or 1 IndexSub1 = Index - 1 JndexSub1 = Jndex - 1 Matrix[Index][Jndex] = math.min(Matrix[IndexSub1][Jndex] + 1, Matrix[Index][JndexSub1] + 1, Matrix[IndexSub1][JndexSub1] + Cost) Jndex = Jndex + 1 end Index = Index + 1 end return Matrix[Length1][Length2] end local function SortResults(A, B) return A.Distance < B.Distance end local function FuzzySearch(String, ArrayOfStrings, MaxResults) local Results = table.create(#ArrayOfStrings) for Index, Value in ipairs(ArrayOfStrings) do Results[Index] = { String = Value; Distance = Levenshtein(String, Value); } end table.sort(Results, SortResults) return Results end return FuzzySearch
--- Runs embedded commands and replaces them
function Util.RunEmbeddedCommands(dispatcher, str) str = encodeCommandEscape(str) local results = {} -- We need to do this because you can't yield in the gsub function for text in str:gmatch("$(%b{})") do local doQuotes = true local commandString = text:sub(2, #text-1) if commandString:match("^{.+}$") then -- Allow double curly for literal replacement doQuotes = false commandString = commandString:sub(2, #commandString-1) end results[text] = Util.RunCommandString(dispatcher, commandString) if doQuotes then if results[text]:find("%s") or results[text] == "" then results[text] = string.format("%q", results[text]) end end end return decodeCommandEscape(str:gsub("$(%b{})", results)) end
-- [[ Dummiez's Data Store Score Board ]] -- This script updates the Data store with the values from the remote function.
wait(1) local score = game:GetService("DataStoreService"):GetOrderedDataStore(script.DataStore.Value) function script.UploadScore.OnServerInvoke(player) local inv = player:FindFirstChild(script.Original.Value) score:SetAsync(player.Name, inv:FindFirstChild(script.Score.Value).Value) end
----------------- --| Constants |-- -----------------
local COOLDOWN = 5 -- Seconds until tool can be used again
--[[if JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then]]-- --[[JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();]]-- --[[end;]]
-- local JeffTheKillerHumanoid; for _,Child in pairs(JeffTheKiller:GetChildren())do if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then JeffTheKillerHumanoid=Child; end; end; local AttackDebounce=false; local JeffTheKillerKnife=JeffTheKiller:FindFirstChild("Knife"); local JeffTheKillerHead=JeffTheKiller:FindFirstChild("Head"); local JeffTheKillerHumanoidRootPart=JeffTheKiller:FindFirstChild("HumanoidRootPart"); local WalkDebounce=false; local Notice=false; local JeffLaughDebounce=false; local MusicDebounce=false; local NoticeDebounce=false; local ChosenMusic; JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0); local OriginalC0=JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0; function FindNearestBae() local NoticeDistance=99999999999999999999999999999999999999; local TargetMain; for _,TargetModel in pairs(Game:GetService("Workspace"):GetChildren())do if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and TargetModel.className=="Model"and TargetModel~=JeffTheKiller and TargetModel.Name~=JeffTheKiller.Name and TargetModel:FindFirstChild("Torso")and TargetModel:FindFirstChild("Head")then local TargetPart=TargetModel:FindFirstChild("Torso"); local FoundHumanoid; for _,Child in pairs(TargetModel:GetChildren())do if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then FoundHumanoid=Child; end; end; if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<NoticeDistance then TargetMain=TargetPart; NoticeDistance=(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude; local hit,pos=raycast(JeffTheKillerHumanoidRootPart.Position,(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).unit,500) if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("Torso")and hit.Parent:FindFirstChild("Head")then if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<9 and not AttackDebounce then Spawn(function() AttackDebounce=true; local SwingAnimation=JeffTheKillerHumanoid:LoadAnimation(JeffTheKiller:FindFirstChild("Swing")); local SwingChoice=math.random(1,2); local HitChoice=math.random(1,3); SwingAnimation:Play(); SwingAnimation:AdjustSpeed(1.5+(math.random()*0.1)); if JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Swing")then local SwingSound=JeffTheKillerKnife:FindFirstChild("Swing"); SwingSound.Pitch=1+(math.random()*0.04); SwingSound:Play(); end; Wait(0.3); if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<8 then FoundHumanoid:TakeDamage(999999999999999999999999); if HitChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit1")then local HitSound=JeffTheKillerKnife:FindFirstChild("Hit1"); HitSound.Pitch=1+(math.random()*0.04); HitSound:Play(); elseif HitChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit2")then local HitSound=JeffTheKillerKnife:FindFirstChild("Hit2"); HitSound.Pitch=1+(math.random()*0.04); HitSound:Play(); elseif HitChoice==3 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit3")then local HitSound=JeffTheKillerKnife:FindFirstChild("Hit3"); HitSound.Pitch=1+(math.random()*0.04); HitSound:Play(); end; end; Wait(0.1); AttackDebounce=false; end); end; end; end; end; end; return TargetMain; end; while Wait(0)do local TargetPoint=JeffTheKillerHumanoid.TargetPoint; local Blockage,BlockagePos=RayCast((JeffTheKillerHumanoidRootPart.CFrame+CFrame.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(TargetPoint.X,JeffTheKillerHumanoidRootPart.Position.Y,TargetPoint.Z)).lookVector*(JeffTheKillerHumanoidRootPart.Size.Z/2)).p,JeffTheKillerHumanoidRootPart.CFrame.lookVector,(JeffTheKillerHumanoidRootPart.Size.Z*2.5),{JeffTheKiller,JeffTheKiller}) local Jumpable=false; if Blockage then Jumpable=true; if Blockage and Blockage.Parent and Blockage.Parent.ClassName~="Workspace"then local BlockageHumanoid; for _,Child in pairs(Blockage.Parent:GetChildren())do if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then BlockageHumanoid=Child; end; end; if Blockage and Blockage:IsA("Terrain")then local CellPos=Blockage:WorldToCellPreferSolid((BlockagePos-Vector3.new(0,2,0))); local CellMaterial,CellShape,CellOrientation=Blockage:GetCell(CellPos.X,CellPos.Y,CellPos.Z); if CellMaterial==Enum.CellMaterial.Water then Jumpable=false; end; elseif BlockageHumanoid or Blockage.ClassName=="TrussPart"or Blockage.ClassName=="WedgePart"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Hat"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Tool"then Jumpable=false; end; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and not JeffTheKillerHumanoid.Sit and Jumpable then JeffTheKillerHumanoid.Jump=true; end; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHumanoidRootPart and JeffTheKillerHead:FindFirstChild("Jeff_Step")and (JeffTheKillerHumanoidRootPart.Velocity-Vector3.new(0,JeffTheKillerHumanoidRootPart.Velocity.y,0)).magnitude>=5 and not WalkDebounce and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then Spawn(function() WalkDebounce=true; local FiredRay=Ray.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(0,-4,0)); local RayTarget,endPoint=Game:GetService("Workspace"):FindPartOnRay(FiredRay,JeffTheKiller); if RayTarget then local JeffTheKillerHeadFootStepClone=JeffTheKillerHead:FindFirstChild("Jeff_Step"):Clone(); JeffTheKillerHeadFootStepClone.Parent=JeffTheKillerHead; JeffTheKillerHeadFootStepClone:Play(); JeffTheKillerHeadFootStepClone:Destroy(); if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed<17 then Wait(0.4); elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed>17 then Wait(0.15); end end; WalkDebounce=false; end); end; local MainTarget=FindNearestBae(); local FoundHumanoid; if MainTarget then for _,Child in pairs(MainTarget.Parent:GetChildren())do if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then FoundHumanoid=Child; end; end; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and MainTarget.Parent and FoundHumanoid and FoundHumanoid.Jump then JeffTheKillerHumanoid.Jump=true; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<25 then if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and not JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=1; JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Play(); end; elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>25 then if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then if not JeffLaughDebounce then Spawn(function() JeffLaughDebounce=true; repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0; JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0; JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop(); JeffLaughDebounce=false; end); end; end; end; if not ChosenMusic and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<50 then local MusicChoice=math.random(1,2); if MusicChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1")then ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1"); elseif MusicChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2")then ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2"); end; if JeffTheKillerScript and JeffTheKiller and ChosenMusic and not ChosenMusic.IsPlaying then ChosenMusic.Volume=0.5; ChosenMusic:Play(); end; elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>50 then if JeffTheKillerScript and JeffTheKiller and ChosenMusic and ChosenMusic.IsPlaying then if not MusicDebounce then Spawn(function() MusicDebounce=true; repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0; if ChosenMusic then ChosenMusic.Volume=1; ChosenMusic:Stop(); end; ChosenMusic=nil; MusicDebounce=false; end); end; end; end; if not MainTarget and not JeffLaughDebounce then Spawn(function() JeffLaughDebounce=true; repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0; JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0; JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop(); JeffLaughDebounce=false; end); end; if not MainTarget and not MusicDebounce then Spawn(function() MusicDebounce=true; repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0; if ChosenMusic then ChosenMusic.Volume=0; ChosenMusic:Stop(); end; ChosenMusic=nil; MusicDebounce=false; end); end; if MainTarget then Notice=true; if Notice and not NoticeDebounce and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Susto2")then JeffTheKillerHead:FindFirstChild("Jeff_Susto2"):Play(); NoticeDebounce=true; end if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then if MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>5 then JeffTheKillerHumanoid.WalkSpeed=15; elseif MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<5 then JeffTheKillerHumanoid.WalkSpeed=0.004; end; JeffTheKillerHumanoid:MoveTo(MainTarget.Position+(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).unit*2,Game:GetService("Workspace"):FindFirstChild("Terrain")); local NeckRotation=(JeffTheKiller:FindFirstChild("Torso").Position.Y-MainTarget.Parent:FindFirstChild("Head").Position.Y)/10; if NeckRotation>-1.5 and NeckRotation<1.5 then JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=OriginalC0*CFrame.fromEulerAnglesXYZ(NeckRotation,0,0); end; if NeckRotation<-1.5 then JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,-0.993636549,0.112633869,0,0.112633869,0.993636549); elseif NeckRotation>1.5 then JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0.996671617,0.081521146,0,0.081521146,-0.996671617); end; else end; else Notice=false; NoticeDebounce=false; JeffTheKiller:FindFirstChild("Torso"):FindFirstChild("Neck").C0=CFrame.new(0,1,0,-1,0,0,0,0,1,0,1,-0); local RandomWalk=math.random(1,150); if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then JeffTheKillerHumanoid.WalkSpeed=12; if RandomWalk==1 then JeffTheKillerHumanoid:MoveTo(Game:GetService("Workspace"):FindFirstChild("Terrain").Position+Vector3.new(math.random(-2048,2048),0,math.random(-2048,2048)),Game:GetService("Workspace"):FindFirstChild("Terrain")); end; end; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid then JeffTheKillerHumanoid.DisplayDistanceType="None"; JeffTheKillerHumanoid.HealthDisplayDistance=0; JeffTheKillerHumanoid.Name="ColdBloodedKiller"; JeffTheKillerHumanoid.NameDisplayDistance=0; JeffTheKillerHumanoid.NameOcclusion="EnemyOcclusion"; JeffTheKillerHumanoid.AutoJumpEnabled=true; JeffTheKillerHumanoid.AutoRotate=true; JeffTheKillerHumanoid.MaxHealth=500; JeffTheKillerHumanoid.JumpPower=60; JeffTheKillerHumanoid.MaxSlopeAngle=89.9; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoJumpEnabled then JeffTheKillerHumanoid.AutoJumpEnabled=true; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoRotate then JeffTheKillerHumanoid.AutoRotate=true; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.PlatformStand then JeffTheKillerHumanoid.PlatformStand=false; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Sit then JeffTheKillerHumanoid.Sit=false; end; end;
--= Variables =--
local camera = game.Workspace.CurrentCamera local TweeningService = game:GetService("TweenService") local UIS = game:GetService('UserInputService') local Bar = script.Parent:WaitForChild('STMBackground'):WaitForChild('Bar') local player = game.Players.LocalPlayer local NormalWalkSpeed = 10 local NewWalkSpeed = 30 local power = 10 local sprinting = false repeat wait() until game.Players.LocalPlayer.Character local character = player.Character local Humanoid = character.Humanoid local runninganim = Humanoid:LoadAnimation(script.Parent.Runninganim)
--------END RIGHT DOOR-------
end wait(0.15) until game.Workspace.DoorFlashing.Value == false end end end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
-- SOME OTHER VARIABLES --
local Animations local loopConnection local holdingConnection
--[[Engine]]
local fFD = _Tune.FinalDrive*_Tune.FDMult local fFDr = fFD*30/math.pi local cGrav = workspace.Gravity*_Tune.InclineComp/32.2 local wDRatio = wDia*math.pi/60 local cfWRot = CFrame.Angles(math.pi/2,-math.pi/2,0) local cfYRot = CFrame.Angles(0,math.pi,0) local rtTwo = (2^.5)/2 --Horsepower Curve local fgc_h=_Tune.Horsepower/100 local fgc_n=_Tune.PeakRPM/1000 local fgc_a=_Tune.PeakSharpness local fgc_c=_Tune.CurveMult function FGC(x) x=x/1000 return (((-(x-fgc_n)^2)*math.min(fgc_h/(fgc_n^2),fgc_c^(fgc_n/fgc_h)))+fgc_h)*(x-((x^fgc_a)/((fgc_a*fgc_n)^(fgc_a-1)))) end local PeakFGC = FGC(_Tune.PeakRPM) --Plot Current Horsepower function GetCurve(x,gear) local hp=math.max((FGC(x)*_Tune.Horsepower)/PeakFGC,0) return hp,hp*(_Tune.EqPoint/x)*_Tune.Ratios[gear+2]*fFD*hpScaling end --Output Cache local CacheTorque = true local HPCache = {} local HPInc = 100 if CacheTorque then for gear,ratio in pairs(_Tune.Ratios) do local hpPlot = {} for rpm = math.floor(_Tune.IdleRPM/HPInc),math.ceil((_Tune.Redline+100)/HPInc) do local tqPlot = {} tqPlot.Horsepower,tqPlot.Torque = GetCurve(rpm*HPInc,gear-2) hp1,tq1 = GetCurve((rpm+1)*HPInc,gear-2) tqPlot.HpSlope = (hp1 - tqPlot.Horsepower)/(HPInc/1000) tqPlot.TqSlope = (tq1 - tqPlot.Torque)/(HPInc/1000) hpPlot[rpm] = tqPlot end table.insert(HPCache,hpPlot) end end --Powertrain --Update RPM function RPM() --Neutral Gear if _CGear==0 then _ClutchOn = false end --Car Is Off local revMin = _Tune.IdleRPM if not _IsOn then revMin = 0 _CGear = 0 _ClutchOn = false _GThrot = _Tune.IdleThrottle/100 end --Determine RPM local maxSpin=0 for i,v in pairs(Drive) do if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end end if _ClutchOn then local aRPM = math.max(math.min(maxSpin*_Tune.Ratios[_CGear+2]*fFDr,_Tune.Redline+100),revMin) local clutchP = math.min(math.abs(aRPM-_RPM)/_Tune.ClutchTol,.9) _RPM = _RPM*clutchP + aRPM*(1-clutchP) else if _GThrot-(_Tune.IdleThrottle/100)>0 then if _RPM>_Tune.Redline then _RPM = _RPM-_Tune.RevBounce*2 else _RPM = math.min(_RPM+_Tune.RevAccel*_GThrot,_Tune.Redline+100) end else _RPM = math.max(_RPM-_Tune.RevDecay,revMin) end end --Rev Limiter _spLimit = (_Tune.Redline+100)/(fFDr*_Tune.Ratios[_CGear+2]) if _RPM>_Tune.Redline then if _CGear<#_Tune.Ratios-2 then _RPM = _RPM-_Tune.RevBounce else _RPM = _RPM-_Tune.RevBounce*.5 end end end --Apply Power function Engine() --Get Torque local maxSpin=0 for i,v in pairs(Drive) do if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end end if _ClutchOn then if CacheTorque then local cTq = HPCache[_CGear+2][math.floor(math.min(_Tune.Redline,math.max(_Tune.IdleRPM,_RPM))/HPInc)] _HP = cTq.Horsepower+(cTq.HpSlope*(_RPM-math.floor(_RPM/HPInc))/1000) _OutTorque = cTq.Torque+(cTq.TqSlope*(_RPM-math.floor(_RPM/HPInc))/1000) else _HP,_OutTorque = GetCurve(_RPM,_CGear) end local iComp =(car.Body.CarName.Value.VehicleSeat.CFrame.lookVector.y)*cGrav if _CGear==-1 then iComp=-iComp end _OutTorque = _OutTorque*math.max(1,(1+iComp)) else _HP,_OutTorque = 0,0 end --Automatic Transmission if _TMode == "Auto" and _IsOn then _ClutchOn = true if _CGear == 0 then _CGear = 1 end if _CGear >= 1 then if _CGear==1 and _GBrake > 0 and car.Body.CarName.Value.VehicleSeat.Velocity.Magnitude < 20 then _CGear = -1 else if _Tune.AutoShiftMode == "RPM" then if _RPM>(_Tune.PeakRPM+_Tune.AutoUpThresh) then _CGear=math.min(_CGear+1,#_Tune.Ratios-2) elseif math.max(math.min(maxSpin*_Tune.Ratios[_CGear+1]*fFDr,_Tune.Redline+100),_Tune.IdleRPM)<(_Tune.PeakRPM-_Tune.AutoDownThresh) then _CGear=math.max(_CGear-1,1) end else if car.Body.CarName.Value.VehicleSeat.Velocity.Magnitude > math.ceil(wDRatio*(_Tune.PeakRPM+_Tune.AutoUpThresh)/_Tune.Ratios[_CGear+2]/fFD) then _CGear=math.min(_CGear+1,#_Tune.Ratios-2) elseif car.Body.CarName.Value.VehicleSeat.Velocity.Magnitude < math.ceil(wDRatio*(_Tune.PeakRPM-_Tune.AutoDownThresh)/_Tune.Ratios[_CGear+1]/fFD) then _CGear=math.max(_CGear-1,1) end end end else if _GThrot-(_Tune.IdleThrottle/100) > 0 and car.Body.CarName.Value.VehicleSeat.Velocity.Magnitude < 20 then _CGear = 1 end end end --Average Rotational Speed Calculation local fwspeed=0 local fwcount=0 local rwspeed=0 local rwcount=0 for i,v in pairs(car.Wheels:GetChildren()) do if v.Name=="FL" or v.Name=="FR" or v.Name == "F" then fwspeed=fwspeed+v.RotVelocity.Magnitude fwcount=fwcount+1 elseif v.Name=="RL" or v.Name=="RR" or v.Name == "R" then rwspeed=rwspeed+v.RotVelocity.Magnitude rwcount=rwcount+1 end end fwspeed=fwspeed/fwcount rwspeed=rwspeed/rwcount local cwspeed=(fwspeed+rwspeed)/2 --Update Wheels for i,v in pairs(car.Wheels:GetChildren()) do --Reference Wheel Orientation local Ref=(CFrame.new(v.Position-((v.Arm.CFrame*cfWRot).lookVector),v.Position)*cfYRot).lookVector local aRef=1 local diffMult=1 if v.Name=="FL" or v.Name=="RL" then aRef=-1 end --AWD Torque Scaling if _Tune.Config == "AWD" then _OutTorque = _OutTorque*rtTwo end --Differential/Torque-Vectoring if v.Name=="FL" or v.Name=="FR" then diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-fwspeed)/fwspeed)/(math.max(_Tune.FDiffSlipThres,1)/100))*((_Tune.FDiffLockThres-50)/50)))) if _Tune.Config == "AWD" then diffMult=math.max(0,math.min(1,diffMult*(1+((((fwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50))))) end elseif v.Name=="RL" or v.Name=="RR" then diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-rwspeed)/rwspeed)/(math.max(_Tune.RDiffSlipThres,1)/100))*((_Tune.RDiffLockThres-50)/50)))) if _Tune.Config == "AWD" then diffMult=math.max(0,math.min(1,diffMult*(1+((((rwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50))))) end end _TCSActive = false _ABSActive = false --Output if _PBrake and ((_Tune.Config ~= "FWD" and (((v.Name=="FL" or v.Name=="FR") and car.Body.CarName.Value.VehicleSeat.Velocity.Magnitude<20) or ((v.Name=="RR" or v.Name=="RL") and car.Body.CarName.Value.VehicleSeat.Velocity.Magnitude>=20))) or (_Tune.Config == "FWD" and (v.Name=="RR" or v.Name=="RL"))) then --PBrake v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*PBrakeForce v["#AV"].angularvelocity=Vector3.new() else --Apply Power if ((_TMode == "Manual" or _TMode == "Semi") and _GBrake==0) or (_TMode == "Auto" and ((_CGear>-1 and _GBrake==0 ) or (_CGear==-1 and _GThrot-(_Tune.IdleThrottle/100)==0 )))then local driven = false for _,a in pairs(Drive) do if a==v then driven = true end end if driven then local on=1 if not script.Parent.IsOn.Value then on=0 end local throt = _GThrot if _TMode == "Auto" and _CGear==-1 then throt = _GBrake end --Apply TCS local tqTCS = 1 if _TCS then tqTCS = 1-(math.min(math.max(0,math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.TCSThreshold)/_Tune.TCSGradient,1)*(1-(_Tune.TCSLimit/100))) end if tqTCS < 1 then _TCSActive = true end --Update Forces local dir = 1 if _CGear==-1 then dir = -1 end v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*_OutTorque*(1+(v.RotVelocity.Magnitude/60)^1.15)*throt*tqTCS*diffMult*on v["#AV"].angularvelocity=Ref*aRef*_spLimit*dir else v["#AV"].maxTorque=Vector3.new() v["#AV"].angularvelocity=Vector3.new() end --Brakes else local brake = _GBrake if _TMode == "Auto" and _CGear==-1 then brake = _GThrot end --Apply ABS local tqABS = 1 if _ABS and math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.ABSThreshold>0 then tqABS = 0 end if tqABS < 1 then _ABSActive = true end --Update Forces if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*FBrakeForce*brake*tqABS else v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*RBrakeForce*brake*tqABS end v["#AV"].angularvelocity=Vector3.new() end end end end
--Made by Luckymaxer
Character = script.Parent Humanoid = Character:FindFirstChild("Humanoid") Debris = game:GetService("Debris") if Humanoid then for i, v in pairs(Humanoid:GetChildren()) do if v:IsA("Animator") then v:Destroy() end end function SetHumanoid() Humanoid.AutoRotate = false Humanoid.PlatformStand = false Humanoid.WalkSpeed = 0 Humanoid.Jump = false Humanoid:ChangeState(Enum.HumanoidStateType.Freefall) end function UnequipTools() Humanoid:UnequipTools() end HumanoidChanged = Humanoid.Changed:connect(SetHumanoid) ToolEquipped = Character.ChildAdded:connect(UnequipTools) SetHumanoid() UnequipTools() end wait(10) for i, v in pairs({HumanoidChanged, ToolEquipped}) do if v then v:disconnect() end end Humanoid.AutoRotate = true Humanoid.PlatformStand = false Humanoid.WalkSpeed = 16 script:Destroy()
--legends: --[s]: speed --[d]: damper --[t]: target --[p]: position --[v]: velocity
local SpeedSpring = Spring.spring.new() SpeedSpring.s = 16 local SwaySpring = Spring.spring.new(0) SwaySpring.s = 4 SwaySpring.d = 1 local SwaySpeed = Spring.spring.new(0) SwaySpeed.s = 6 SwaySpeed.d = 1 SwaySpeed.t = 1 local DamageSpring = Spring.spring.new(Vector3.new()) DamageSpring.s = 20 DamageSpring.d = 0.75 local ImpactSpring = Spring.spring.new(Vector3.new()) ImpactSpring.s = 15 ImpactSpring.d = 1 local OffStates = {"Jumping", "PlatformStanding", "Ragdoll", "Seated", "FallingDown", "FreeFalling", "GettingUp", "Swimming", "Climbing"} local OnStates = {"Running"} local speed = 0 local distance = 0 local swayT = 0 local lastHealth = Humanoid.Health local isFalling = false local debounce = false for _, state in pairs(OffStates) do Humanoid[state]:Connect(function() active = false end) end for _, state in pairs(OnStates) do Humanoid[state]:Connect(function(speed) active = (speed > 1) end) end local function GetHit(d) local l = CFrame.new():VectorToObjectSpace(d) DamageSpring:Accelerate(Vector3.new(l.Z, 0, -l.X) * 0.25) Thread:Wait(0.03) DamageSpring:Accelerate(Vector3.new(-l.Z, 0, 0) * 0.25) end local function HealthChanged(health) if lastHealth > health and lastHealth - health >= 5 then if Humanoid.Health ~= Humanoid.MaxHealth then local damageDealt = lastHealth - health Thread:Spawn(function() local dir = Vector3.new(0, 0, 0) if Humanoid:FindFirstChild("creator") then local killer = Humanoid.creator local killerChar = killer.Value.Character local killerHum = killerChar:FindFirstChildOfClass("Humanoid") local killerHRP = killerChar:FindFirstChild("HumanoidRootPart") if killerChar and killerHRP and killerHum and killerHum.Health > 0 then dir = (Camera.CFrame.p - killerHRP.Position).Unit else dir = (Camera.CFrame.p - HumanoidRootPart.Position).Unit end else dir = (Camera.CFrame.p - HumanoidRootPart.Position).Unit end GetHit((-damageDealt / 12 + 4.166666666666667) * dir) end) end end lastHealth = health end Humanoid.FreeFalling:Connect(function(falling) isFalling = falling if isFalling and not debounce then debounce = true local maxHeight, lowHeight = 0, math.huge while isFalling do local height = HumanoidRootPart.Position.Y if height > maxHeight then maxHeight = height end if height < lowHeight then lowHeight = height end Thread:Wait() end local fallHeight = maxHeight - lowHeight local impactHeight = fallHeight - GeneralSettings.LowestFallHeight if impactHeight > 0 then --local damage = impactHeight * (humanoid.MaxHealth / GeneralSettings.MaxFallHeight) --humanoid:TakeDamage(damage) ImpactSpring:Accelerate(Vector3.new(0, 0, math.random(-impactHeight, impactHeight) / 5)) end debounce = false end end) RunService.RenderStepped:Connect(function(dt) if Character and HumanoidRootPart and Humanoid then local RelativeVelocity = CFrame.new().VectorToObjectSpace(HumanoidRootPart.CFrame, HumanoidRootPart.Velocity) SpeedSpring.t = (active and Humanoid.Health > 0) and (Vector3.new(1, 0, 1) * RelativeVelocity).Magnitude or 0 speed = SpeedSpring.p distance = distance + dt * SpeedSpring.p swayT = swayT + dt * SwaySpeed.p if GeneralSettings.FpsCam then local CF = CFrame.new() CF = Camera.CoordinateFrame local T = swayT local S, D = 0.5 * speed, distance * 6.28318 / 4 * 3 / 4 local SS = SwaySpring.p local BobAngles = Math.FromAxisAngle(S * math.cos(D + 2) / 2048, S * math.cos(D / 2) / 2048, S * math.cos(D / 2 + 2) / 4096) * Math.FromAxisAngle(SS * math.cos(2 * T + 2) / 2048, SS * math.cos(2 * T / 2) / 2048, SS * math.cos(2 * T / 2 - 2) / 4096) local DamageAngles = Math.FromAxisAngle(DamageSpring.p) local ImpactAngles = Math.FromAxisAngle(ImpactSpring.p) if GeneralSettings.CamBobble then CF = CF * BobAngles end if GeneralSettings.CamHurt then CF = CF * DamageAngles end if GeneralSettings.CamImpact then CF = CF * ImpactAngles end Camera.CoordinateFrame = CF end end end) Humanoid.HealthChanged:Connect(HealthChanged) Humanoid.Died:Connect(function() HealthChanged(20) end) HealthChanged(Humanoid.Health)
--[should be false OR DISABLED]
--WeaponsSystem.camera:setEnabled(true) end --Setup weapon tools and listening WeaponsSystem.connections.weaponAdded = CollectionService:GetInstanceAddedSignal(WEAPON_TAG):Connect(WeaponsSystem.onWeaponAdded) WeaponsSystem.connections.weaponRemoved = CollectionService:GetInstanceRemovedSignal(WEAPON_TAG):Connect(WeaponsSystem.onWeaponRemoved) for _, instance in pairs(CollectionService:GetTagged(WEAPON_TAG)) do WeaponsSystem.onWeaponAdded(instance) end WeaponsSystem.doingSetup = false WeaponsSystem.didSetup = true end function WeaponsSystem.onCharacterAdded(character) -- Make it so players unequip weapons while seated, then reequip weapons when they become unseated local humanoid = character:WaitForChild("Humanoid") WeaponsSystem.connections.seated = humanoid.Seated:Connect(function(isSeated) if isSeated then WeaponsSystem.seatedWeapon = character:FindFirstChildOfClass("Tool") humanoid:UnequipTools() WeaponsSystem.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
-- Checkpoint counters
numCheckpointsHit = 0 numCheckpoints = #checkpointList _numLaps = 0
--------LEFT DOOR --------
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(106) game.Workspace.doorleft.l23.BrickColor = BrickColor.new(106) game.Workspace.doorleft.l33.BrickColor = BrickColor.new(106) game.Workspace.doorleft.l43.BrickColor = BrickColor.new(106) game.Workspace.doorleft.l53.BrickColor = BrickColor.new(106) game.Workspace.doorleft.l63.BrickColor = BrickColor.new(106) game.Workspace.doorleft.l73.BrickColor = BrickColor.new(1003) game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
-- function
local function SetStartGame(value) startGame = value end local function ResetGame() left = 0 right = 0 moveDir = 0 SetStartGame(false) end local function SetWalkSpeed(speed) humanoid.WalkSpeed = speed end function SmoothDie() SetStartGame(false) if humanoid.Health > 0 then moveDir = 0 SetWalkSpeed(0)
-- (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 = "Hat" p.Parent = h p.Position = hit.Parent:findFirstChild("Head").Position p.Name = "Handle" p.formFactor = 0 p.Size = Vector3.new(1,1,1) p.BottomSurface = 0 p.TopSurface = 0 p.Locked = true script.Parent.Mesh:clone().Parent = p h.Parent = hit.Parent h.AttachmentForward = Vector3.new(-0, -0.151, -0.989) h.AttachmentPos = Vector3.new(0.05, -0.3, 0) h.AttachmentRight = Vector3.new(1, 0, 0) h.AttachmentUp = Vector3.new(0, 0.989, -0.151) wait(5) debounce = true end end script.Parent.Touched:connect(onTouched)
-- Updating weapons HUD
function updateWeaponHud(mag, ammo) clipUI.Text = mag ammoUI.Text = ammo ammoUI.AmmoEffect.Text = ammo if ammo > ammoLeft then spawn(ammoEffect) end if mag == 0 then clipUI.TextColor3 = Color3.new(227/255, 29/255, 32/255) else clipUI.TextColor3 = Color3.new(199/255, 199/255, 199/255) end if ammo == 0 then ammoUI.TextColor3 = Color3.new(227/255, 29/255, 32/255) else ammoUI.TextColor3 = Color3.new(199/255, 199/255, 199/255) end currentAmmo = mag ammoLeft = ammo end if configs.infiniteAmmo == true then updateWeaponHud(currentAmmo, clipSize) else updateWeaponHud(currentAmmo, ammoLeft) end function equip() local char = player.Character -- Setup joint variables if player.Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then neck = player.Character.Torso.Neck oldNeckC0 = neck.C0 shoulder = player.Character.Torso:FindFirstChild("Right Shoulder") oldShoulderC0 = shoulder.C0 else neck = player.Character.Head.Neck oldNeckC0 = neck.C0 shoulder = player.Character.RightUpperArm:FindFirstChild("RightShoulder") oldShoulderC0 = shoulder.C0 end -- Remember old mouse icon and update current hud.AmmoHud:TweenPosition(UDim2.new(0.98, 0, 0.95, 0), "InOut", "Quad", 0.3, true) runService:BindToRenderStep("Sights", Enum.RenderPriority.Last.Value, function() hud.Crosshair.Position = UDim2.new(0, mouse.X, 0, mouse.Y) end) userInputService.MouseIconEnabled = false hud.Crosshair.Visible = true -- Bind TouchMoved event if on mobile. Otherwise connect to renderstepped if userInputService.TouchEnabled then connection = userInputService.TouchMoved:Connect(mobileFrame) else connection = render:Connect(pcFrame) end -- Bind TouchStarted and TouchEnded. Used to determine if character should rotate -- during touch input userInputService.TouchStarted:Connect(function(touch, processed) mobileShouldTrack = not processed end) userInputService.TouchEnded:Connect(function(touch, processed) mobileShouldTrack = false end) -- Fire server's equip event game.ReplicatedStorage:WaitForChild("ROBLOX_PistolEquipEvent"):FireServer() -- Bind event for when mouse is clicked to fire server's fire event mouse.Button1Down:Connect(function() game.ReplicatedStorage:WaitForChild("ROBLOX_PistolFireEvent"):FireServer(mouse.Hit.p) updateWeaponHud(currentAmmo, ammoLeft) end) -- Bind reload event to mobile button and r key contextActionService:BindActionToInputTypes("Reload", function() game.ReplicatedStorage:WaitForChild("ROBLOX_PistolReloadEvent"):FireServer() end, true, "r") -- If game uses filtering enabled then need to update server while tool is -- held by character. if workspace.FilteringEnabled then while connection do wait() game.ReplicatedStorage:WaitForChild("ROBLOX_PistolUpdateEvent"):FireServer(neck.C0, shoulder.C0) end end end local function unequip() if connection then connection:disconnect() end contextActionService:UnbindAction("Reload") game.ReplicatedStorage:WaitForChild("ROBLOX_PistolUnequipEvent"):FireServer() hud.AmmoHud:TweenPosition(UDim2.new(1.5, 0, 0.95, 0), "InOut", "Quad", 0.3, true) runService:UnbindFromRenderStep("Sights") userInputService.MouseIconEnabled = true hud.Crosshair.Visible = false neck.C0 = oldNeckC0 shoulder.C0 = oldShoulderC0 end function hitmarkerUpdate() hud.Crosshair.Hitmarker.Visible = true wait(0.1) hud.Crosshair.Hitmarker.Visible = false end
--Steering
Tune.SteerD = 750 Tune.SteerMaxTorque = 85000 Tune.SteerP = 140000 Tune.SteerInner = 22 Tune.SteerOuter = 20 Tune.SteerSpeed = .15 Tune.SteerDecay = 378 --Speed[SPS] of gradient cutoff Tune.MinSteer = .1 Tune.MSteerExp = 1
--Precalculated paths
local t,f,n=true,false,{} local r={ [58]={{26,27,28,29,31,32,34,35,39,41,30,56,58},t}, [49]={{26,27,28,44,45,49},t}, [16]={n,f}, [19]={{26,27,28,29,31,32,34,35,39,41,30,56,58,20,19},t}, [59]={{26,27,28,29,31,32,34,35,39,41,59},t}, [63]={{26,27,28,29,31,32,34,35,39,41,30,56,58,23,62,63},t}, [34]={{26,27,28,29,31,32,34},t}, [21]={{26,27,28,29,31,32,34,35,39,41,30,56,58,20,21},t}, [48]={{26,27,28,44,45,49,48},t}, [27]={{26,27},t}, [14]={n,f}, [31]={{26,27,28,29,31},t}, [56]={{26,27,28,29,31,32,34,35,39,41,30,56},t}, [29]={{26,27,28,29},t}, [13]={n,f}, [47]={{26,27,28,44,45,49,48,47},t}, [12]={n,f}, [45]={{26,27,28,44,45},t}, [57]={{26,27,28,29,31,32,34,35,39,41,30,56,57},t}, [36]={{26,27,28,29,31,32,33,36},t}, [25]={{26,25},t}, [71]={{26,27,28,29,31,32,34,35,39,41,59,61,71},t}, [20]={{26,27,28,29,31,32,34,35,39,41,30,56,58,20},t}, [60]={{26,27,28,29,31,32,34,35,39,41,60},t}, [8]={n,f}, [4]={n,f}, [75]={{26,27,28,29,31,32,34,35,39,41,59,61,71,72,76,73,75},t}, [22]={{26,27,28,29,31,32,34,35,39,41,30,56,58,20,21,22},t}, [74]={{26,27,28,29,31,32,34,35,39,41,59,61,71,72,76,73,74},t}, [62]={{26,27,28,29,31,32,34,35,39,41,30,56,58,23,62},t}, [1]={n,f}, [6]={n,f}, [11]={n,f}, [15]={n,f}, [37]={{26,27,28,29,31,32,33,36,37},t}, [2]={n,f}, [35]={{26,27,28,29,31,32,34,35},t}, [53]={{26,27,28,44,45,49,48,47,52,53},t}, [73]={{26,27,28,29,31,32,34,35,39,41,59,61,71,72,76,73},t}, [72]={{26,27,28,29,31,32,34,35,39,41,59,61,71,72},t}, [33]={{26,27,28,29,31,32,33},t}, [69]={{26,27,28,29,31,32,34,35,39,41,60,69},t}, [65]={{26,27,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,65},t}, [26]={{26},t}, [68]={{26,27,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67,68},t}, [76]={{26,27,28,29,31,32,34,35,39,41,59,61,71,72,76},t}, [50]={{26,27,28,44,45,49,48,47,50},t}, [66]={{26,27,28,29,31,32,34,35,39,41,30,56,58,20,19,66},t}, [10]={n,f}, [24]={{26,25,24},t}, [23]={{26,27,28,29,31,32,34,35,39,41,30,56,58,23},t}, [44]={{26,27,28,44},t}, [39]={{26,27,28,29,31,32,34,35,39},t}, [32]={{26,27,28,29,31,32},t}, [3]={n,f}, [30]={{26,27,28,29,31,32,34,35,39,41,30},t}, [51]={{26,27,28,44,45,49,48,47,50,51},t}, [18]={n,f}, [67]={{26,27,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67},t}, [61]={{26,27,28,29,31,32,34,35,39,41,59,61},t}, [55]={{26,27,28,44,45,49,48,47,52,53,54,55},t}, [46]={{26,27,28,44,45,49,48,47,46},t}, [42]={{26,27,28,29,31,32,34,35,38,42},t}, [40]={{26,27,28,29,31,32,34,35,40},t}, [52]={{26,27,28,44,45,49,48,47,52},t}, [54]={{26,27,28,44,45,49,48,47,52,53,54},t}, [43]={n,f}, [7]={n,f}, [9]={n,f}, [41]={{26,27,28,29,31,32,34,35,39,41},t}, [17]={n,f}, [38]={{26,27,28,29,31,32,34,35,38},t}, [28]={{26,27,28},t}, [5]={n,f}, [64]={{26,27,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64},t}, } return r
--- RUNTIME ---
for _,NPC in pairs(workspace.Enemies:GetChildren()) do Distribute(NPC) end workspace.Enemies.ChildAdded:Connect(Distribute)
--easter egg
mouse.KeyDown:connect(function(key) if key=="o" then Heat = BlowupTemp-11 end end) if not FE then radiator.Oil.Enabled = false radiator.Antifreeze.Enabled = false radiator.Liquid.Volume = 0 radiator.Fan:Play() radiator.Fan.Pitch = 1+FanSpeed radiator.Steam:Play() radiator.Liquid:Play() script.Blown.Value = false while wait(.2) do if Heat > FanTemp and Fan == true then FanCool = -FanSpeed radiator.Fan.Volume = FanVolume else FanCool = 0 radiator.Fan.Volume = 0 end Load = ((script.Parent.Parent.Values.Throttle.Value*script.Parent.Parent.Values.RPM.Value*10*OverheatSpeed)/math.ceil((car.DriveSeat.Velocity.magnitude+.0000001)/100)/75000)-CoolingEfficiency Heat = math.max(RunningTemp,(Heat+Load)+FanCool) if Heat >= BlowupTemp then Heat = BlowupTemp radiator.Break:Play() radiator.Liquid.Volume = .5 radiator.Oil.Enabled = true radiator.Antifreeze.Enabled = true script.Parent.Parent.IsOn.Value = false script.Blown.Value = true elseif Heat >= BlowupTemp-10 then radiator.Smoke.Transparency = NumberSequence.new((BlowupTemp-Heat)/10,1) radiator.Smoke.Enabled = true radiator.Steam.Volume = math.abs(((BlowupTemp-Heat)-10)/10) else radiator.Smoke.Enabled = false radiator.Steam.Volume = 0 end script.Celsius.Value = Heat script.Parent.Temp.Text = math.floor(Heat).."°c" end else handler:FireServer("Initialize",FanSpeed) while wait(.2) do if Heat > FanTemp and Fan == true then FanCool = -FanSpeed handler:FireServer("FanVolume",FanVolume) else FanCool = 0 handler:FireServer("FanVolume",0) end Load = ((script.Parent.Parent.Values.Throttle.Value*script.Parent.Parent.Values.RPM.Value*10*OverheatSpeed)/math.ceil((car.DriveSeat.Velocity.magnitude+.0000001)/100)/75000)-CoolingEfficiency Heat = math.max(RunningTemp,(Heat+Load)+FanCool) if Heat >= BlowupTemp then Heat = BlowupTemp handler:FireServer("Blown") script.Parent.Parent.IsOn.Value = false script.Blown.Value = true elseif Heat >= BlowupTemp-10 then handler:FireServer("Smoke",true,BlowupTemp,Heat) else handler:FireServer("Smoke",false,BlowupTemp,Heat) end script.Celsius.Value = Heat script.Parent.Temp.Text = math.floor(Heat).."°c" end end
--Automatic Gauge Scaling
if autoscaling then 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 for i,v in pairs(UNITS) do v.maxSpeed = math.ceil(v.scaling*wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive/_Tune.FDMult) v.spInc = math.max(math.ceil(v.maxSpeed/150)*10,10) end end for i=0,revEnd*2 do local ln = gauges.ln:clone() ln.Parent = gauges.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 = gauges.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 local lns = Instance.new("Frame",gauges.Speedo) lns.Name = "lns" lns.BackgroundTransparency = 1 lns.BorderSizePixel = 0 lns.Size = UDim2.new(0,0,0,0) for i=1,90 do local ln = gauges.ln:clone() ln.Parent = lns 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 local blns = Instance.new("Frame",gauges.Boost) blns.Name = "blns" blns.BackgroundTransparency = 1 blns.BorderSizePixel = 0 blns.Size = UDim2.new(0,0,0,0) for i=0,12 do local bln = gauges.bln:clone() bln.Parent = blns bln.Rotation = 45+270*(i/12) if i%2==0 then bln.Frame.Size = UDim2.new(0,2,0,7) bln.Frame.Position = UDim2.new(0,-1,0,40) else bln.Frame.Size = UDim2.new(0,3,0,5) end bln.Num:Destroy() bln.Visible=true end for i,v in pairs(UNITS) do local lnn = Instance.new("Frame",gauges.Speedo) lnn.BackgroundTransparency = 1 lnn.BorderSizePixel = 0 lnn.Size = UDim2.new(0,0,0,0) lnn.Name = v.units if i~= 1 then lnn.Visible=false end for i=0,v.maxSpeed,v.spInc do local ln = gauges.ln:clone() ln.Parent = lnn ln.Rotation = 45 + 225*(i/v.maxSpeed) ln.Num.Text = i ln.Num.TextSize = 14 ln.Num.Rotation = -ln.Rotation ln.Frame:Destroy() ln.Num.Visible=true ln.Visible=true end end if isOn.Value then gauges:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true) end isOn.Changed:connect(function() if isOn.Value then gauges:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true) end end) values.RPM.Changed:connect(function() gauges.Tach.Needle.Rotation = 45 + 225 * math.min(1,values.RPM.Value / (revEnd*1000)) end) local _TCount = _Tune.Turbochargers local _SCount = _Tune.Superchargers if _TCount~=0 or _SCount~=0 then values.Boost.Changed:connect(function() local _T = 0 local _S = 0 if _TCount~=0 then _T = _Tune.T_Boost*_TCount end if _SCount~=0 then _S = _Tune.S_Boost*_SCount end local tboost = (math.floor(values.BoostTurbo.Value)*1.2)-(_T/5) local sboost = math.floor(values.BoostSuper.Value) gauges.Boost.Needle.Rotation = 45 + 270 * math.min(1,values.Boost.Value/(_T+_S)) gauges.PSI.Text = tostring(math.floor(tboost+sboost).." PSI") end) else gauges.Boost:Destroy() end values.Gear.Changed:connect(function() local gearText = values.Gear.Value if gearText == 0 then gearText = "N" elseif gearText == -1 then gearText = "R" end gauges.Gear.Text = gearText end) values.TCS.Changed:connect(function() if _Tune.TCSEnabled then if values.TCS.Value then gauges.TCS.TextColor3 = Color3.new(1,170/255,0) gauges.TCS.TextStrokeColor3 = Color3.new(1,170/255,0) if values.TCSActive.Value then wait() gauges.TCS.Visible = not gauges.TCS.Visible else wait() gauges.TCS.Visible = false end else gauges.TCS.Visible = true gauges.TCS.TextColor3 = Color3.new(1,0,0) gauges.TCS.TextStrokeColor3 = Color3.new(1,0,0) end else gauges.TCS.Visible = false end end) values.TCSActive.Changed:connect(function() if _Tune.TCSEnabled then if values.TCSActive.Value and values.TCS.Value then wait() gauges.TCS.Visible = not gauges.TCS.Visible elseif not values.TCS.Value then wait() gauges.TCS.Visible = true else wait() gauges.TCS.Visible = false end else gauges.TCS.Visible = false end end) gauges.TCS.Changed:connect(function() if _Tune.TCSEnabled then if values.TCSActive.Value and values.TCS.Value then wait() gauges.TCS.Visible = not gauges.TCS.Visible elseif not values.TCS.Value then wait() gauges.TCS.Visible = true end else if gauges.TCS.Visible then gauges.TCS.Visible = false end end end) values.ABS.Changed:connect(function() if _Tune.ABSEnabled then if values.ABS.Value then gauges.ABS.TextColor3 = Color3.new(1,170/255,0) gauges.ABS.TextStrokeColor3 = Color3.new(1,170/255,0) if values.ABSActive.Value then wait() gauges.ABS.Visible = not gauges.ABS.Visible else wait() gauges.ABS.Visible = false end else gauges.ABS.Visible = true gauges.ABS.TextColor3 = Color3.new(1,0,0) gauges.ABS.TextStrokeColor3 = Color3.new(1,0,0) end else gauges.ABS.Visible = false end end) values.ABSActive.Changed:connect(function() if _Tune.ABSEnabled then if values.ABSActive.Value and values.ABS.Value then wait() gauges.ABS.Visible = not gauges.ABS.Visible elseif not values.ABS.Value then wait() gauges.ABS.Visible = true else wait() gauges.ABS.Visible = false end else gauges.ABS.Visible = false end end) gauges.ABS.Changed:connect(function() if _Tune.ABSEnabled then if values.ABSActive.Value and values.ABS.Value then wait() gauges.ABS.Visible = not gauges.ABS.Visible elseif not values.ABS.Value then wait() gauges.ABS.Visible = true end else if gauges.ABS.Visible then gauges.ABS.Visible = false end end end) function PBrake() gauges.PBrake.Visible = values.PBrake.Value end values.PBrake.Changed:connect(PBrake) function Gear() if values.TransmissionMode.Value == "Auto" then gauges.TMode.Text = "CVT" gauges.TMode.BackgroundColor3 = Color3.new(1,170/255,0) elseif values.TransmissionMode.Value == "Semi" then gauges.TMode.Text = "S/T" gauges.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255) else gauges.TMode.Text = "M/T" gauges.TMode.BackgroundColor3 = Color3.new(1,85/255,.5) end end values.TransmissionMode.Changed:connect(Gear) values.Velocity.Changed:connect(function(property) gauges.Speedo.Needle.Rotation = 45 + 225 * math.min(1,UNITS[currentUnits].scaling*values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed) gauges.Speed.Text = math.floor(UNITS[currentUnits].scaling*values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units end) mouse.KeyDown:connect(function(key) if key=="v" then gauges.Visible=not gauges.Visible end end) gauges.Speed.MouseButton1Click:connect(function() if currentUnits==#UNITS then currentUnits = 1 else currentUnits = currentUnits+1 end for i,v in pairs(gauges.Speedo:GetChildren()) do v.Visible=v.Name==UNITS[currentUnits].units or v.Name=="Needle" or v.Name=="lns" end gauges.Speed.Text = math.floor(UNITS[currentUnits].scaling*values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units end) wait(.1) Gear() PBrake()
-- Legs
character.LeftUpperLeg.Material = Material character.RightUpperLeg.Material = Material character.LeftLowerLeg.Material = Material character.RightLowerLeg.Material = Material
--------------------) Settings
Damage = 0 -- the ammout of health the player or mob will take Cooldown = 7 -- cooldown for use of the tool again ZoneModelName = "Dust slash" -- name the zone model MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
--// F key, HornOn
mouse.KeyDown:connect(function(key) if key=="h" then veh.Lightbar.middle.Airhorn:Play() veh.Lightbar.middle.Wail.Volume = 0 veh.Lightbar.middle.Yelp.Volume = 0 veh.Lightbar.middle.Priority.Volume = 0 veh.Lightbar.AH.Transparency = 0 end end)
--NOTE --The animation can bug out, im still trying to find a way to fix that.
repeat wait() until game:IsLoaded() wait(0.01) local TweenService = game:GetService("TweenService") local tweenPart = game.Players.LocalPlayer.Character.Humanoid local info = TweenInfo.new( 0.325, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0 ) local info2 = TweenInfo.new( 0.3, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0 ) local Goals = {CameraOffset = Vector3.new(0,-1,0)} local Goals2 = {CameraOffset = Vector3.new(0,0,0)} local animsR6 = script.Parent.Parent.R6Anims local animsR15 = script.Parent.Parent.R15Anims local PartTween = TweenService:Create(tweenPart, info, Goals) local PartTween2 = TweenService:Create(tweenPart, info2, Goals2) local animidle = tweenPart:LoadAnimation(animsR15.Idle) local animwalk = tweenPart:LoadAnimation(animsR15.Walk) if tweenPart.RigType == Enum.HumanoidRigType.R6 then animidle = tweenPart:LoadAnimation(animsR6.Idle) animwalk = tweenPart:LoadAnimation(animsR6.Walk) elseif tweenPart.RigType == Enum.HumanoidRigType.R15 then animidle = tweenPart:LoadAnimation(animsR15.Idle) animwalk = tweenPart:LoadAnimation(animsR15.Walk) end local crouching = false local waiting = false local function Crouch() if waiting == false then if crouching == false then script.Parent.Parent.ImageColor3 = script.Parent.Parent.Values.OnCrouchColor.Value script.Parent.Parent.CrouchImage.ImageColor3 = Color3.new(1, 1, 1) tweenPart.WalkSpeed = 8 waiting = true crouching = true animidle:Play() PartTween:Play() --plays it tweenPart.Running:Connect(function(Speed) if crouching == true then if Speed >= 1 then animidle:Stop() if animwalk.IsPlaying == false then animwalk:Play() end else animidle:Play() animwalk:Stop() end end end) wait(0.05) waiting = false else script.Parent.Parent.ImageColor3 = script.Parent.Parent.Values.OriginalColor.Value script.Parent.Parent.CrouchImage.ImageColor3 = Color3.new(0, 0, 0) tweenPart.WalkSpeed = 16 waiting = true crouching = false animidle:Stop() animwalk:Stop() PartTween2:Play() wait(0.05) waiting = false end end end local userinputservice = game:GetService("UserInputService") userinputservice.InputBegan:Connect(function(input) if script.Parent.Parent.Visible == true then if input.KeyCode == Enum.KeyCode.C then Crouch() end end end) script.Parent.Parent.MouseButton1Click:Connect(function() Crouch() end)
--[[ ROBLOX TODO: add default generic param when possible original code: export const getState = <State extends MatcherState = MatcherState>(): State => ]]
local function getState<State>(): State return _G[JEST_MATCHERS_OBJECT].state end return { JEST_MATCHERS_OBJECT = JEST_MATCHERS_OBJECT, getState = getState, }
-- Initialize rotate tool
local RotateTool = require(CoreTools:WaitForChild 'Rotate') Core.AssignHotkey('C', Core.Support.Call(Core.EquipTool, RotateTool)); Core.Dock.AddToolButton(Core.Assets.RotateIcon, 'C', RotateTool, 'RotateInfo');
-- the Tool, reffered to here as "Block." Do not change it!
Block = script.Parent.Parent.Fuse1Pick -- You CAN change the name in the quotes "Example Tool"
-- Local Functions
local MakeFlag local function DestroyFlag(flagObject) flagObject.Flag:Destroy() for player, object in pairs(FlagCarriers) do if object == flagObject then FlagCarriers[player] = nil end end end local function OnCarrierDied(player) local flagObject = FlagCarriers[player] if flagObject then local flagPole = flagObject.FlagPole local flagBanner = flagObject.FlagBanner flagPole.CanCollide = false flagBanner.CanCollide = false flagPole.Anchored = true flagBanner.Anchored = true flagObject.PickedUp = false FlagCarriers[player] = nil if Configurations.RETURN_FLAG_ON_DROP then wait(Configurations.FLAG_RESPAWN_TIME) if not flagObject.AtSpawn and not flagObject.PickedUp then DestroyFlag(flagObject) MakeFlag(flagObject) ReturnFlag:Fire(flagObject.FlagBanner.BrickColor) end end end end local function PickupFlag(player, flagObject) FlagCarriers[player] = flagObject flagObject.AtSpawn = false flagObject.PickedUp = true local torso if player.Character.Humanoid.RigType == Enum.HumanoidRigType.R6 then torso = player.Character:FindFirstChild('Torso') else torso = player.Character:FindFirstChild('UpperTorso') end local flagPole = flagObject.FlagPole local flagBanner = flagObject.FlagBanner flagPole.Anchored = false flagBanner.Anchored = false flagPole.CanCollide = false flagBanner.CanCollide = false local weld = Instance.new('Weld', flagPole) weld.Name = 'PlayerFlagWeld' weld.Part0 = flagPole weld.Part1 = torso weld.C0 = CFrame.new(0,0,-1) end local function BindFlagTouched(flagObject) local flagPole = flagObject.FlagPole local flagBanner = flagObject.FlagBanner flagPole.Touched:connect(function(otherPart) local player = Players:GetPlayerFromCharacter(otherPart.Parent) if not player then return end if not player.Character then return end local humanoid = player.Character:FindFirstChild('Humanoid') if not humanoid then return end if humanoid.Health <= 0 then return end if flagBanner.BrickColor ~= player.TeamColor and not flagObject.PickedUp then PickupFlag(player, flagObject) elseif flagBanner.BrickColor == player.TeamColor and not flagObject.AtSpawn and Configurations.FLAG_RETURN_ON_TOUCH then DestroyFlag(flagObject) MakeFlag(flagObject) ReturnFlag:Fire(flagObject.FlagBanner.BrickColor) end end) end function MakeFlag(flagObject) flagObject.Flag = flagObject.FlagCopy:Clone() flagObject.Flag.Parent = flagObject.FlagContainer flagObject.FlagPole = flagObject.Flag.FlagPole flagObject.FlagBanner = flagObject.Flag.FlagBanner flagObject.FlagBanner.CanCollide = false flagObject.AtSpawn = true flagObject.PickedUp = false BindFlagTouched(flagObject) end local function BindBaseTouched(flagObject) local flagBase = flagObject.FlagBase flagBase.Touched:connect(function(otherPart) local player = Players:GetPlayerFromCharacter(otherPart.Parent) if not player then return end if flagBase.BrickColor == player.TeamColor and FlagCarriers[player] then CaptureFlag:Fire(player) local otherFlag = FlagCarriers[player] DestroyFlag(otherFlag) MakeFlag(otherFlag) end end) end local function OnPlayerAdded(player) player.CharacterAdded:connect(function(character) character:WaitForChild('Humanoid').Died:connect(function() OnCarrierDied(player) end) end) player.CharacterRemoving:connect(function() OnCarrierDied(player) end) end
-- Returns module (possibly nil) and success code to differentiate returning nil due to error vs Scriptable
function ControlModule:SelectComputerMovementModule() if not (UserInputService.KeyboardEnabled or UserInputService.GamepadEnabled) then return nil, false end local computerModule = nil local DevMovementMode = Players.LocalPlayer.DevComputerMovementMode if DevMovementMode == Enum.DevComputerMovementMode.UserChoice then computerModule = computerInputTypeToModuleMap[lastInputType] if UserGameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove and computerModule == Keyboard then -- User has ClickToMove set in Settings, prefer ClickToMove controller for keyboard and mouse lastInputTypes computerModule = ClickToMove end else -- Developer has selected a mode that must be used. computerModule = movementEnumToModuleMap[DevMovementMode] -- computerModule is expected to be nil here only when developer has selected Scriptable if (not computerModule) and DevMovementMode ~= Enum.DevComputerMovementMode.Scriptable then warn("No character control module is associated with DevComputerMovementMode ", DevMovementMode) end end if computerModule then return computerModule, true elseif DevMovementMode == Enum.DevComputerMovementMode.Scriptable then -- Special case where nil is returned and we actually want to set self.activeController to nil for Scriptable return nil, true else -- This case is for when computerModule is nil because of an error and no suitable control module could -- be found. return nil, false end end
--[=[ Disconnects all connections from a ScriptSignal object without making it unusable. ```lua local connection = ScriptSignal:Connect(function() end) connection.Connected -> true ScriptSignal:DisconnectAll() connection.Connected -> false ``` @ignore ]=]
function ScriptSignal:DisconnectAll() local node: ScriptConnectionNode? = self._head while node ~= nil do local _connection = node._connection if _connection ~= nil then _connection.Connected = false _connection._node = nil node._connection = nil end node = node._next end self._head = nil end
--[=[ Calculates the current shake vector. This should be continuously called inside a loop, such as `RunService.Heartbeat`. Alternatively, `OnSignal` or `BindToRenderStep` can be used to automatically call this function. Returns a tuple of three values: 1. `position: Vector3` - Position shake offset 2. `rotation: Vector3` - Rotation shake offset 3. `completed: boolean` - Flag indicating if the shake is finished ```lua local hb hb = RunService.Heartbeat:Connect(function() local offsetPosition, offsetRotation, isDone = shake:Update() if isDone then hb:Disconnect() end -- Use `offsetPosition` and `offsetRotation` here end) ``` ]=]
function Shake:Update(): (Vector3, Vector3, boolean) local done = false local now = self.TimeFunction() local dur = now - self._startTime local noiseInput = ((now + self._timeOffset) / self.Frequency) % 1000000 local multiplierFadeIn = 1 local multiplierFadeOut = 1 if dur < self.FadeInTime then multiplierFadeIn = dur / self.FadeInTime end if not self.Sustain and dur > self.FadeInTime + self.SustainTime then multiplierFadeOut = 1 - (dur - self.FadeInTime - self.SustainTime) / self.FadeOutTime if (not self.Sustain) and dur >= self.FadeInTime + self.SustainTime + self.FadeOutTime then done = true end end local offset = Vector3.new( math.noise(noiseInput, 0) / 2, math.noise(0, noiseInput) / 2, math.noise(noiseInput, noiseInput) / 2 ) * self.Amplitude * math.min(multiplierFadeIn, multiplierFadeOut) if done then self:Stop() end return self.PositionInfluence * offset, self.RotationInfluence * offset, done end
-- Public Functions
function ParticleController.SetupParticlesPlayer(player) local character = player.Character or player.CharacterAdded:wait() -- Create all relevant particles TODO: Use a for loop for this instead? local _upgradeParticle = upgradeParticle:Clone() local _upgradeCheckpoint = upgradeCheckpoint:Clone() _upgradeParticle.Parent = character:WaitForChild(particleHolderName) _upgradeCheckpoint.Parent = character:WaitForChild(particleHolderName) end function ParticleController.EmitCheckpointParticle(player) -- Get the particle on the player and make it emit local character = player.Character local particleHolder = character:WaitForChild(particleHolderName) local particleEffect = particleHolder:WaitForChild("ParticleCheckpoint") particleEffect:Emit(particleEmitRate) end function ParticleController:CreateUpgradeParticle(player) local character = player.Character or player.CharacterAdded:wait() local particleEffect = upgradeCheckpoint:Clone() particleEffect.Parent = character:WaitForChild(particleHolderName) particleEffect:Emit(particleEmitRate) end return ParticleController
--// Services
local L_103_ = game:GetService('RunService').RenderStepped local L_104_ = game:GetService('UserInputService')
---------------------------------------------------------------------------------------------------- --------------------=[ OUTROS ]=-------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
,FastReload = false --- Automatically operates the bolt on reload if needed ,SlideLock = true ,MoveBolt = false ,BoltLock = false ,CanBreachDoor = false ,CanBreak = true --- Weapon can jam? ,JamChance = 1000 --- This old piece of brick doesn't work fine >;c ,IncludeChamberedBullet = true --- Include the chambered bullet on next reload ,Chambered = false --- Start with the gun chambered? ,LauncherReady = false --- Start with the GL ready? ,CanCheckMag = true --- You can check the magazine ,ArcadeMode = false --- You can see the bullets left in magazine ,RainbowMode = false --- Operation: Party Time xD ,ModoTreino = false --- Surrender enemies instead of killing them ,GunSize = 1 ,GunFOVReduction = 5 ,BoltExtend = Vector3.new(0, 0, 0.225) ,SlideExtend = Vector3.new(0, 0, -0.4)
--// Function stuff
return function(Vargs) local server = Vargs.Server; local service = Vargs.Service; local Functions, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Settings local function Init() Functions = server.Functions; Admin = server.Admin; Anti = server.Anti; Core = server.Core; HTTP = server.HTTP; Logs = server.Logs; Remote = server.Remote; Process = server.Process; Variables = server.Variables; Settings = server.Settings; Logs:AddLog("Script", "Functions Module Initialized") end; server.Functions = { Init = Init; PlayerFinders = { ["me"] = { Match = "me"; Prefix = true; Absolute = true; Function = function(msg, plr, parent, players, getplr, plus, isKicking) table.insert(players,plr) plus() end; }; ["all"] = { Match = "all"; Prefix = true; Absolute = true; Function = function(msg, plr, parent, players, getplr, plus, isKicking) local everyone = true if isKicking then for i,v in next,parent:GetChildren() do local p = getplr(v) if p.Name:lower():sub(1,#msg)==msg:lower() then everyone = false table.insert(players,p) plus() end end end if everyone then for i,v in next,parent:GetChildren() do local p = getplr(v) if p then table.insert(players,p) plus() end end end end; }; ["@everyone"] = { Match = "@everyone"; Absolute = true; Function = function(...) return Functions.PlayerMatchers.all.Function(...) end }; ["others"] = { Match = "others"; Prefix = true; Absolute = true; Function = function(msg, plr, parent, players, getplr, plus, isKicking) for i,v in next,parent:GetChildren() do local p = getplr(v) if p ~= plr then table.insert(players,p) plus() end end end; }; ["random"] = { Match = "random"; Prefix = true; Absolute = true; Function = function(msg, plr, parent, players, getplr, plus, isKicking) if #players>=#parent:GetChildren() then return end local rand = parent:GetChildren()[math.random(#parent:children())] local p = getplr(rand) for i,v in pairs(players) do if(v.Name == p.Name)then Functions.PlayerFinders.random.Function(msg, plr, parent, players, getplr, plus, isKicking) return; end end table.insert(players,p) plus(); end; }; ["admins"] = { Match = "admins"; Prefix = true; Absolute = true; Function = function(msg, plr, parent, players, getplr, plus, isKicking) for i,v in next,parent:children() do local p = getplr(v) if Admin.CheckAdmin(p,false) then table.insert(players, p) plus() end end end; }; ["nonadmins"] = { Match = "nonadmins"; Prefix = true; Absolute = true; Function = function(msg, plr, parent, players, getplr, plus, isKicking) for i,v in next,parent:children() do local p = getplr(v) if not Admin.CheckAdmin(p,false) then table.insert(players,p) plus() end end end; }; ["friends"] = { Match = "friends"; Prefix = true; Absolute = true; Function = function(msg, plr, parent, players, getplr, plus, isKicking) for i,v in next,parent:children() do local p = getplr(v) if p:IsFriendsWith(plr.userId) then table.insert(players,p) plus() end end end; }; ["%team"] = { Match = "%"; Function = function(msg, plr, parent, players, getplr, plus, isKicking) local matched = msg:match("%%(.*)") if matched then for i,v in next,service.Teams:GetChildren() do if v.Name:lower():sub(1,#matched) == matched:lower() then for k,m in next,parent:GetChildren() do local p = getplr(m) if p.TeamColor == v.TeamColor then table.insert(players,p) plus() end end end end end end; }; ["$group"] = { Match = "$"; Function = function(msg, plr, parent, players, getplr, plus, isKicking) local matched = msg:match("%$(.*)") if matched and tonumber(matched) then for i,v in next,parent:children() do local p = getplr(v) if p:IsInGroup(tonumber(matched)) then table.insert(players,p) plus() end end end end; }; ["id-"] = { Match = "id-"; Function = function(msg, plr, parent, players, getplr, plus, isKicking) local matched = tonumber(msg:match("id%-(.*)")) local foundNum = 0 if matched then for i,v in next,parent:children() do local p = getplr(v) if p and p.userId == matched then table.insert(players,p) plus() foundNum = foundNum+1 end end if foundNum == 0 then local ran,name = pcall(function() return service.Players:GetNameFromUserIdAsync(matched) end) if ran and name then local fakePlayer = service.Wrap(service.New("Folder")) local data = { Name = name; ToString = name; ClassName = "Player"; AccountAge = 0; CharacterAppearanceId = tostring(matched); UserId = tonumber(matched); userId = tonumber(matched); Parent = service.Players; Character = Instance.new("Model"); Backpack = Instance.new("Folder"); PlayerGui = Instance.new("Folder"); PlayerScripts = Instance.new("Folder"); Kick = function() fakePlayer:Destroy() fakePlayer:SetSpecial("Parent", nil) end; IsA = function(ignore, arg) if arg == "Player" then return true end end; } for i,v in next,data do fakePlayer:SetSpecial(i, v) end table.insert(players, fakePlayer) plus() end end end end; }; ["displayname-"] = { Match = "displayname-"; Function = function(msg, plr, parent, players, getplr, plus, isKicking) local matched = tonumber(msg:match("displayname%-(.*)")) local foundNum = 0 if matched then for i,v in next,parent:children() do local p = getplr(v) if p and p.DisplayName == matched then table.insert(players,p) plus() foundNum = foundNum+1 end end end end; }; ["team-"] = { Match = "team-"; Function = function(msg, plr, parent, players, getplr, plus, isKicking) print(1) local matched = msg:match("team%-(.*)") if matched then for i,v in next,service.Teams:GetChildren() do if v.Name:lower():sub(1,#matched) == matched:lower() then for k,m in next,parent:GetChildren() do local p = getplr(m) if p.TeamColor == v.TeamColor then table.insert(players, p) plus() end end end end end end; }; ["group-"] = { Match = "group-"; Function = function(msg, plr, parent, players, getplr, plus, isKicking) local matched = msg:match("group%-(.*)") if matched and tonumber(matched) then for i,v in next,parent:children() do local p = getplr(v) if p:IsInGroup(tonumber(matched)) then table.insert(players,p) plus() end end end end; }; ["-name"] = { Match = "-"; Function = function(msg, plr, parent, players, getplr, plus, isKicking) local matched = msg:match("%-(.*)") if matched then local removes = service.GetPlayers(plr,matched,true) for i,v in next,players do for k,p in next,removes do if v.Name == p.Name then table.remove(players,i) plus() end end end end end; }; ["#number"] = { Match = "#"; Function = function(msg, plr, ...) local matched = msg:match("%#(.*)") if matched and tonumber(matched) then local num = tonumber(matched) if not num then Remote.MakeGui(plr,'Output',{Title = 'Output'; Message = "Invalid number!"}) end for i = 1,num do Functions.PlayerFinders.random.Function(msg, plr, ...) end end end; }; ["radius-"] = { Match = "radius-"; Function = function(msg, plr, parent, players, getplr, plus, isKicking) local matched = msg:match("radius%-(.*)") if matched and tonumber(matched) then local num = tonumber(matched) if not num then Remote.MakeGui(plr,'Output',{Title = 'Output'; Message = "Invalid number!"}) end for i,v in next,parent:GetChildren() do local p = getplr(v) if p ~= plr and plr:DistanceFromCharacter(p.Character.Head.Position) <= num then table.insert(players,p) plus() end end end end; }; }; IsClass = function(obj, classList) for _,class in next,classList do if obj:IsA(class) then return true end end end; PerformOnEach = function(itemList, func, ...) for i,v in next,itemList do pcall(func, v, ...) end end; ArgsToString = function(args) local str = "" for i,arg in next,args do str = str.."Arg"..tostring(i)..": "..tostring(arg).."; " end return str end; GetPlayers = function(plr, names, dontError, isServer, isKicking, noID) local players = {} local prefix = Settings.SpecialPrefix if isServer then prefix = "" end local parent = service.NetworkServer or service.Players local function getplr(p) if p and p:IsA("Player") then return p elseif p and p:IsA('NetworkReplicator') then if p:GetPlayer()~=nil and p:GetPlayer():IsA('Player') then return p:GetPlayer() end end end local function checkMatch(msg) for ind, data in next, Functions.PlayerFinders do if not data.Level or (data.Level and Admin.GetLevel(plr) >= data.Level) then local check = ((data.Prefix and Settings.SpecialPrefix) or "")..data.Match if (data.Absolute and msg:lower() == check) or (not data.Absolute and msg:lower():sub(1,#check) == check:lower()) then return data end end end end if plr == nil then for i,v in pairs(parent:GetChildren()) do local p = getplr(v) if p then table.insert(players,p) end end elseif plr and not names then return {plr} else if names:lower():sub(1,2) == "##" then error("String passed to GetPlayers is filtered: "..tostring(names)) else for s in names:gmatch('([^,]+)') do local plrs = 0 local function plus() plrs = plrs+1 end local matchFunc = checkMatch(s) if matchFunc then matchFunc.Function(s, plr, parent, players, getplr, plus, isKicking, isServer, dontError) else for i,v in next,parent:children() do local p = getplr(v) if p and p.Name:lower():sub(1,#s)==s:lower() then table.insert(players,p) plus() end end if plrs == 0 then local ran,userid = pcall(function() return service.Players:GetUserIdFromNameAsync(s) end) if ran and tonumber(userid) then local fakePlayer = service.Wrap(service.New("Folder")) local data = { Name = s; ToString = s; ClassName = "Player"; AccountAge = 0; CharacterAppearanceId = tostring(userid); UserId = tonumber(userid); userId = tonumber(userid); Parent = service.Players; Character = Instance.new("Model"); Backpack = Instance.new("Folder"); PlayerGui = Instance.new("Folder"); PlayerScripts = Instance.new("Folder"); Kick = function() fakePlayer:Destroy() fakePlayer:SetSpecial("Parent", nil) end; IsA = function(ignore, arg) if arg == "Player" then return true end end; } for i,v in next,data do fakePlayer:SetSpecial(i, v) end table.insert(players, fakePlayer) plus() end end end if plrs == 0 and not dontError then Remote.MakeGui(plr,'Output',{Title = 'Output'; Message = 'No players matching '..s..' were found!'}) end end end end --// The following is intended to prevent name spamming (eg. :re scel,scel,scel,scel,scel,scel,scel,scel,scel,scel,scel,scel,scel,scel...) --// It will also prevent situations where a player falls within multiple player finders (eg. :re group-1928483,nonadmins,radius-50 (one player can match all 3 of these)) local filteredList = {}; local checkList = {}; for i,v in next, players do if not checkList[v] then table.insert(filteredList, v); checkList[v] = true; end end return filteredList; end; GetRandom = function(pLen) --local str = "" --for i=1,math.random(5,10) do str=str..string.char(math.random(33,90)) end --return str local Len = (type(pLen) == "number" and pLen) or math.random(5,10) --// reru local Res = {}; for Idx = 1, Len do Res[Idx] = string.format('%02x', math.random(126)); end; return table.concat(Res) end; Base64Encode = function(data) local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' return ((data:gsub('.', function(x) local r,b='',x:byte() for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end return r; end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) if (#x < 6) then return '' end local c=0 for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end return b:sub(c+1,c+1) end)..({ '', '==', '=' })[#data%3+1]) end; Base64Decode = function(data) local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' data = string.gsub(data, '[^'..b..'=]', '') return (data:gsub('.', function(x) if (x == '=') then return '' end local r,f='',(b:find(x)-1) for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end return r; end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x) if (#x ~= 8) then return '' end local c=0 for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end return string.char(c) end)) end; Hint = function(message,players,time) for i,v in pairs(players) do Remote.MakeGui(v,"Hint",{ Message = message; Time = time; }) end end; Message = function(title,message,players,scroll,tim) for i,v in pairs(players) do Remote.RemoveGui(v,"Message") Remote.MakeGui(v,"Message",{ Title = title; Message = message; Scroll = scroll; Time = tim; }) end end; Notify = function(title,message,players,tim) for i,v in pairs(players) do Remote.RemoveGui(v,"Notify") Remote.MakeGui(v,"Notify",{ Title = title; Message = message; Time = tim; }) end end; MakeWeld = function(a, b) local weld = service.New("ManualWeld", a) weld.Part0 = a weld.Part1 = b weld.C0 = a.CFrame:inverse() * b.CFrame return weld end; SetView = function(ob) if ob == 'reset' then workspace.CurrentCamera.CameraType = 'Custom' workspace.CurrentCamera.CameraSubject = service.Player.Character.Humanoid workspace.CurrentCamera.FieldOfView = 70 else workspace.CurrentCamera.CameraSubject = ob end end; SetLighting = function(prop,value) if service.Lighting[prop]~=nil then service.Lighting[prop] = value Variables.LightingSettings[prop] = value for ind,p in pairs(service.GetPlayers()) do Remote.SetLighting(p,prop,value) end end end; LoadEffects = function(plr) for i,v in pairs(Variables.LocalEffects) do if (v.Part and v.Part.Parent) or v.NoPart then if v.Type == "Cape" then Remote.Send(plr,"Function","NewCape",v.Data) elseif v.Type == "Particle" then Remote.NewParticle(plr,v.Part,v.Class,v.Props) end else Variables.LocalEffects[i] = nil end end end; NewParticle = function(target,type,props) local ind = Functions.GetRandom() Variables.LocalEffects[ind] = { Part = target; Class = type; Props = props; Type = "Particle"; } for i,v in next,service.Players:GetPlayers() do Remote.NewParticle(v,target,type,props) end end; RemoveParticle = function(target,name) for i,v in next,Variables.LocalEffects do if v.Type == "Particle" and v.Part == target and (v.Props.Name == name or v.Class == name) then Variables.LocalEffects[i] = nil end end for i,v in next,service.Players:GetPlayers() do Remote.RemoveParticle(v,target,name) end end; UnCape = function(plr) for i,v in pairs(Variables.LocalEffects) do if v.Type == "Cape" and v.Player == plr then Variables.LocalEffects[i] = nil end end for i,v in pairs(service.GetPlayers()) do Remote.Send(v,"Function","RemoveCape",plr.Character) end end; Cape = function(player,isdon,material,color,decal,reflect) Functions.UnCape(player) local torso = player.Character:FindFirstChild("HumanoidRootPart") if torso then if type(color) == "table" then color = Color3.new(color[1],color[2],color[3]) end local data = { Color = color; Parent = player.Character; Material = material; Reflectance = reflect; Decal = decal; } if (isdon and Settings.DonorCapes and Settings.LocalCapes) then Remote.Send(player,"Function","NewCape",data) else local ind = Functions.GetRandom() Variables.LocalEffects[ind] = { Player = player; Part = player.Character.HumanoidRootPart; Data = data; Type = "Cape"; } for i,v in pairs(service.GetPlayers()) do Remote.Send(v,"Function","NewCape",data) end end end end; PlayAnimation = function(player, animId) if player.Character and tonumber(animId) then local human = player.Character:FindFirstChildOfClass("Humanoid") if human and not human:FindFirstChildOfClass("Animator") then service.New("Animator", human) end Remote.Send(player,"Function","PlayAnimation",animId) end end; ApplyBodyPart = function(character, model) local humanoid = character:FindFirstChildOfClass("Humanoid") if humanoid then local rigType = humanoid.RigType == Enum.HumanoidRigType.R6 and "R6" or "R15" local part = model:FindFirstChild(rigType) if not part and rigType == "R15" then part = model:FindFirstChild("R15Fixed") -- some bundles dont have the normal R15 folder... end if part then if rigType == "R6" then local children = character:GetChildren() for _,v in pairs(part:GetChildren()) do for _,x in pairs(children) do if x:IsA("CharacterMesh") and x.BodyPart == v.BodyPart then x:Destroy() end end v:Clone().Parent = character end elseif rigType == "R15" then local validParts = {} for _,x in pairs(Enum.BodyPartR15:GetEnumItems()) do validParts[x.Name] = x.Value end for _,v in pairs(part:GetChildren()) do if validParts[v.Name] then humanoid:ReplaceBodyPartR15(validParts[v.Name], v:Clone()) end end end end end end; GetJoints = function(character) local temp = {} for _,v in pairs(character:GetDescendants()) do if v:IsA("Motor6D") then temp[v.Name] = v -- assumes no 2 joints have the same name, hopefully this wont cause issues end end return temp end; LoadOnClient = function(player,source,object,name) if service.Players:FindFirstChild(player.Name) then local parent = player:FindFirstChildOfClass("PlayerGui") or player:WaitForChild('PlayerGui', 15) or player:WaitForChild('Backpack') local cl = Core.NewScript('LocalScript',source) cl.Name = name or Functions.GetRandom() cl.Parent = parent cl.Disabled = false if object then table.insert(Variables.Objects,cl) end end end; Split = function(msg,key,num) if not msg or not key or not num or num <= 0 then return {} end if key=="" then key = " " end local tab = {} local str = '' for arg in msg:gmatch('([^'..key..']+)') do if #tab>=num then break elseif #tab>=num-1 then table.insert(tab,msg:sub(#str+1,#msg)) else str = str..arg..key table.insert(tab,arg) end end return tab end; BasicSplit = function(msg,key) local ret = {} for arg in msg:gmatch("([^"..key.."]+)") do table.insert(ret,arg) end return ret end; CountTable = function(tab) local num = 0 for i in pairs(tab) do num = num+1 end return num end; GetTexture = function(ID) ID = Functions.Trim(tostring(ID)) local created if not tonumber(ID) then return false else ID = tonumber(ID) end if not pcall(function() updated=service.MarketPlace:GetProductInfo(ID).Created:match("%d+-%d+-%S+:%d+") end) then return false end for i = 0,10 do local info local ran,error = pcall(function() info = service.MarketPlace:GetProductInfo(ID-i) end) if ran then if info.AssetTypeId == 1 and info.Created:match("%d+-%d+-%S+:%d+") == updated then return ID-i end end end end; Trim = function(str) return str:match("^%s*(.-)%s*$") end; Round = function(num) return math.floor(num + 0.5) end; RoundToPlace = function(num, places) return math.floor((num*(10^(places or 0)))+0.5)/(10^(places or 0)) end; GetOldDonorList = function() local temp={} for k,asset in pairs(service.InsertService:GetCollection(1290539)) do local ins=service.MarketPlace:GetProductInfo(asset.AssetId) local fo=ins.Description for so in fo:gmatch('[^;]+') do local name,id,cape,color=so:match('{(.*),(.*),(.*),(.*)}') table.insert(temp,{Name=name,Id=tostring(id),Cape=tostring(cape),Color=color,Material='Plastic',List=ins.Name}) end end Variables.OldDonorList = temp end; CleanWorkspace = function() for i,v in pairs(service.Workspace:children()) do if v:IsA("Tool") or v:IsA("Accessory") or v:IsA("Hat") then v:Destroy() end end end; RemoveSeatWelds = function(seat) if seat~=nil then for i,v in next,seat:GetChildren() do if v:IsA("Weld") then if v.Part1 ~= nil and v.Part1.Name=="HumanoidRootPart" then v:Destroy() end end end end end; GrabNilPlayers = function(name) local AllGrabbedPlayers = {} for i,v in pairs(service.NetworkServer:GetChildren()) do pcall(function() if v:IsA("ServerReplicator") then if v:GetPlayer().Name:lower():sub(1,#name)==name:lower() or name=='all' then table.insert(AllGrabbedPlayers, (v:GetPlayer() or "NoPlayer")) end end end) end return AllGrabbedPlayers end; AssignName = function() local name=math.random(100000,999999) return name end; Shutdown = function(reason) if not Core.PanicMode then Functions.Message("SYSTEM MESSAGE", "Shutting down...", service.Players:GetChildren(), false, 5) wait(1) end service.Players.PlayerAdded:connect(function(p) p:Kick("Game shutdown: ".. tostring(reason or "No Reason Given")) end) for i,v in pairs(service.NetworkServer:children()) do service.Routine(function() if v and v:GetPlayer() then v:GetPlayer():Kick("Game shutdown: ".. tostring(reason or "No Reason Given")) wait(30) if v.Parent and v:GetPlayer() then Remote.Send(v:GetPlayer(),'Function','KillClient') end end end) end end; Donor = function(plr) if (Admin.CheckDonor(plr) and Settings.DonorCapes) then local PlayerData = Core.GetPlayer(plr) or {Donor = {}} local donor = PlayerData.Donor or {} if donor and donor.Enabled then local img,color,material if donor and donor.Cape then img,color,material = donor.Cape.Image,donor.Cape.Color,donor.Cape.Material else img,color,material = '0','White','Neon' end if plr and plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") then Functions.Cape(plr,true,material,color,img) end --[[ if Admin.CheckDonor(plr) and (Settings.DonorPerks or Admin.GetLevel(plr)>=4) then local gear=service.InsertService:LoadAsset(57902997):children()[1] if not plr.Backpack:FindFirstChild(gear.Name..'DonorTool') then gear.Name=gear.Name..'DonorTool' gear.Parent=plr.Backpack else gear:Destroy() end end --]] end end end; CheckMatch = function(check,match) if check==match then return true elseif type(check)=="table" and type(match)=="table" then local good = false local num = 0 for k,m in pairs(check) do if m == match[k] then good = true else good = false break end num = num+1 end if good and num==Functions.CountTable(check) then return true end end end; DSKeyNormalize = function(intab, reverse) local tab = {} if reverse then for i,v in next,intab do if tonumber(i) then tab[tonumber(i)] = v; end end else for i,v in next,intab do tab[tostring(i)] = v; end end return tab; end; GetIndex = function(tab,match) for i,v in pairs(tab) do if v==match then return i elseif type(v)=="table" and type(match)=="table" then local good = false for k,m in pairs(v) do if m == match[k] then good = true else good = false break end end if good then return i end end end end; --// Couldn't merge due to "conflicts" so just added manually. ConvertPlayerCharacterToRig = function(p, rigType) rigType = rigType or "R15" local char = p.Character if not p.Character then p:LoadCharacter() p.CharacterAdded:Wait() char = p.Character end local head = char:FindFirstChild"Head" local human = char:FindFirstChildOfClass"Humanoid" if head then local rig = server.Deps.Assets["Rig"..rigType]:Clone() -- requires R6 and R15 in Dependencies to retrieve the Rig Models !! local rigHuman = rig:FindFirstChildOfClass"Humanoid" local origHeadCF = head.CFrame rig.Name = p.Name for a,b in pairs(char:children()) do if b:IsA("Accessory") or b:IsA("Pants") or b:IsA("Shirt") or b:IsA("ShirtGraphic") or b:IsA("BodyColors") then b.Parent = rig elseif b:IsA"BasePart" and b.Name == "Head" and b:FindFirstChild("face") then rig.Head.face.Texture = b.face.Texture end end p.Character = rig rig.Parent = workspace rig.Head.CFrame = origHeadCF human.RigType = Enum.HumanoidRigType[rigType] end end; CreateClothingFromImageId = function(clothingtype, Id) local Clothing = Instance.new(clothingtype) Clothing.Name = clothingtype Clothing[clothingtype == "Shirt" and "ShirtTemplate" or clothingtype == "Pants" and "PantsTemplate" or clothingtype == "ShirtGraphic" and "Graphic"] = string.format("rbxassetid://%d", Id) return Clothing end }; end
--[[ Creates a new copy of the dictionary and sets a value inside it. ]]
function Immutable.Set(dictionary, key, value) local new = {} for k, v in next, dictionary do new[k] = v end new[key] = value return new end
-- ================================================================================ -- VARIABLES -- ================================================================================ -- Services
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Players = game:GetService("Players") local ContextActionService = game:GetService("ContextActionService") local GuiService = game:GetService("GuiService") local UserInputService = game:GetService("UserInputService")
--------------| SYSTEM SETTINGS |--------------
Prefix = ";"; -- The character you use before every command (e.g. ';jump me'). SplitKey = " "; -- The character inbetween command arguments (e.g. setting it to '/' would change ';jump me' to ';jump/me'). BatchKey = ""; -- The character inbetween batch commands (e.g. setting it to '|' would change ';jump me ;fire me ;smoke me' to ';jump me | ;fire me | ;smoke me' QualifierBatchKey = ","; -- The character used to split up qualifiers (e.g. ;jump player1,player2,player3) Theme = "Blue"; -- The default UI theme. NoticeSoundId = 2865227271; -- The SoundId for notices. NoticeVolume = 0.1; -- The Volume for notices. NoticePitch = 1; -- The Pitch/PlaybackSpeed for notices. ErrorSoundId = 2865228021; -- The SoundId for error notifications. ErrorVolume = 0.1; -- The Volume for error notifications. ErrorPitch = 1; -- The Pitch/PlaybackSpeed for error notifications. AlertSoundId = 9161622880; -- The SoundId for alerts. AlertVolume = 0.5; -- The Volume for alerts. AlertPitch = 1; -- The Pitch/PlaybackSpeed for alerts. WelcomeBadgeId = 0; -- Award new players a badge, such as 'Welcome to the game!'. Set to 0 for no badge. CommandDebounce = true; -- Wait until the command effect is over to use again. Helps to limit abuse & lag. Set to 'false' to disable. SaveRank = true; -- Saves a player's rank in the server they received it. (e.g. ;rank plrName rank). Use ';permRank plrName rank' to permanently save a rank. Set to 'false' to disable. LoopCommands = 3; -- The minimum rank required to use LoopCommands. MusicList = {}; -- Songs which automatically appear in a user's radio. Type '!radio' to display the radio. ThemeColors = { -- The colours players can set their HD Admin UI (in the 'Settings' menu). | Format: {ThemeName, ThemeColor3Value}; {"Red", Color3.fromRGB(150, 0, 0), }; {"Orange", Color3.fromRGB(150, 75, 0), }; {"Brown", Color3.fromRGB(120, 80, 30), }; {"Yellow", Color3.fromRGB(130, 120, 0), }; {"Green", Color3.fromRGB(0, 120, 0), }; {"Blue", Color3.fromRGB(0, 100, 150), }; {"Purple", Color3.fromRGB(100, 0, 150), }; {"Pink", Color3.fromRGB(150, 0, 100), }; {"Black", Color3.fromRGB(60, 60, 60), }; }; Colors = { -- The colours for ChatColors and command arguments. | Format: {"ShortName", "FullName", Color3Value}; {"r", "Red", Color3.fromRGB(255, 0, 0) }; {"o", "Orange", Color3.fromRGB(250, 100, 0) }; {"y", "Yellow", Color3.fromRGB(255, 255, 0) }; {"g", "Green" , Color3.fromRGB(0, 255, 0) }; {"dg", "DarkGreen" , Color3.fromRGB(0, 125, 0) }; {"b", "Blue", Color3.fromRGB(0, 255, 255) }; {"db", "DarkBlue", Color3.fromRGB(0, 50, 255) }; {"p", "Purple", Color3.fromRGB(150, 0, 255) }; {"pk", "Pink", Color3.fromRGB(255, 85, 185) }; {"bk", "Black", Color3.fromRGB(0, 0, 0) }; {"w", "White", Color3.fromRGB(255, 255, 255) }; }; ChatColors = { -- The colour a player's chat will appear depending on their rank. '["Owner"] = "Yellow";' makes the owner's chat yellow. [5] = "Yellow"; }; Cmdbar = 1; -- The minimum rank required to use the Cmdbar. Cmdbar2 = 3; -- The minimum rank required to use the Cmdbar2. ViewBanland = 3; -- The minimum rank required to view the banland. OnlyShowUsableCommands = false; -- Only display commands equal to or below the user's rank on the Commands page. RankRequiredToViewPage = { -- || The pages on the main menu || ["Commands"] = 0; ["Admin"] = 0; ["Settings"] = 0; }; RankRequiredToViewRank = { -- || The rank categories on the 'Ranks' subPage under Admin || ["Owner"] = 0; ["HeadAdmin"] = 0; ["Admin"] = 0; ["Mod"] = 0; ["VIP"] = 0; }; RankRequiredToViewRankType = { -- || The collection of loader-rank-rewarders on the 'Ranks' subPage under Admin || ["Owner"] = 0; ["SpecificUsers"] = 5; ["Gamepasses"] = 0; ["Assets"] = 0; ["Groups"] = 0; ["Friends"] = 0; ["FreeAdmin"] = 0; ["VipServerOwner"] = 0; }; RankRequiredToViewIcon = 0; WelcomeRankNotice = true; -- The 'You're a [rankName]' notice that appears when you join the game. Set to false to disable. WelcomeDonorNotice = true; -- The 'You're a Donor' notice that appears when you join the game. Set to false to disable. WarnIncorrectPrefix = true; -- Warn the user if using the wrong prefix | "Invalid prefix! Try using [correctPrefix][commandName] instead!" DisableAllNotices = false; -- Set to true to disable all HD Admin notices. ScaleLimit = 4; -- The maximum size players with a rank lower than 'IgnoreScaleLimit' can scale theirself. For example, players will be limited to ;size me 4 (if limit is 4) - any number above is blocked. IgnoreScaleLimit = 3; -- Any ranks equal or above this value will ignore 'ScaleLimit' CommandLimits = { -- Enables you to set limits for commands which have a number argument. Ranks equal to or higher than 'IgnoreLimit' will not be affected by Limit. ["fly"] = { Limit = 10000; IgnoreLimit = 3; }; ["fly2"] = { Limit = 10000; IgnoreLimit = 3; }; ["noclip"] = { Limit = 10000; IgnoreLimit = 3; }; ["noclip2"] = { Limit = 10000; IgnoreLimit = 3; }; ["speed"] = { Limit = 10000; IgnoreLimit = 3; }; ["jumpPower"] = { Limit = 10000; IgnoreLimit = 3; }; }; VIPServerCommandBlacklist = {"permRank", "permBan", "globalAnnouncement"}; -- Commands players are probihited from using in VIP Servers. GearBlacklist = {67798397}; -- The IDs of gear items to block when using the ;gear command. IgnoreGearBlacklist = 4; -- The minimum rank required to ignore the gear blacklist. PlayerDataStoreVersion = "V1.0"; -- Data about the player (i.e. permRanks, custom settings, etc). Changing the Version name will reset all PlayerData. SystemDataStoreVersion = "V1.0"; -- Data about the game (i.e. the banland, universal message system, etc). Changing the Version name will reset all SystemData. CoreNotices = { -- Modify core notices. You can find a table of all CoreNotices under [MainModule > Client > SharedModules > CoreNotices] --NoticeName = NoticeDetails; };
--[=[ @within RemoteSignal @interface Connection .Disconnect () -> nil ]=]
function RemoteSignal.new(parent: Instance, name: string, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?) local self = setmetatable({}, RemoteSignal) self._re = Instance.new("RemoteEvent") self._re.Name = name self._re.Parent = parent if outboundMiddleware and #outboundMiddleware > 0 then self._hasOutbound = true self._outbound = outboundMiddleware else self._hasOutbound = false end if inboundMiddleware and #inboundMiddleware > 0 then self._directConnect = false self._signal = Signal.new() self._re.OnServerEvent:Connect(function(player, ...) local args = table.pack(...) for _,middlewareFunc in ipairs(inboundMiddleware) do local middlewareResult = table.pack(middlewareFunc(player, args)) if not middlewareResult[1] then return end end self._signal:Fire(player, table.unpack(args, 1, args.n)) end) else self._directConnect = true end return self end
--[[ Classes.RadioButtonGroup This class creates a list of radio buttons that the user can select from. Constructors: new(frame [instance], buttons[] [RadioButtonLabel]) Create(list[] [string], max [integer]) > Creates a RadioButtonGroup from the list with a max scrolling number. Properties: Frame [instance] > The container frame for the RadioButtonGroup. Can be used for positioning and resizing. RadioButtons[] [RadioButtonLabel] > An array of the RadioButtonLabels that are used in the RadioButtonGroup. Methods: :GetActiveRadio() [RadioButtonLabel] > Returns the currently selected RadioButtonLabel :Destroy() [void] > Destroys the RadioButtonGroup and all the events, etc that were running it. Events: .Changed:Connect(function(old [RadioButtonLabel], new [RadioButtonLabel]) > When the selected radio button is changed in the radio button group this event fires --]]
--!strict
local fmt = string.format local template = "%02d:%02d:%02d" local function formatTime(value: number): string local seconds = value % 60 local minutes = math.floor(value / 60) % 60 local hours = math.floor(value / (60 * 60)) return fmt(template, hours, minutes, seconds) end return formatTime
--Text alignment default properties
defaults.ContainerHorizontalAlignment = "Left" -- Align,ent of text within frame container defaults.ContainerVerticalAlignment = "Top" defaults.TextYAlignment = "Bottom" -- Alignment of the text on the line, only makes a difference if the line has variable text sizes
--[[ ___ _______ _ / _ |____/ ___/ / ___ ____ ___ (_)__ / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< /_/ |_| \___/_//_/\_,_/___/___/_/___/ SecondLogic @ Inspare ]]
script.Parent:WaitForChild("Speedo") script.Parent:WaitForChild("Tach") script.Parent:WaitForChild("ln") script.Parent:WaitForChild("Gear") script.Parent:WaitForChild("Speed") BrakeON = "Really red" BrakeOFF = "White" ReverseON = "Institutional white" ReverseOFF = "White" 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" if gearText == "N" then for index, child in pairs(car.Body.ReverseLights:GetChildren()) do child.Material = Enum.Material.SmoothPlastic child.BrickColor = BrickColor.new(ReverseOFF) child.PointLight.Enabled = false end end elseif gearText == -1 then gearText = "R" end if gearText == "R" then for index, child in pairs(car.Body.ReverseLights:GetChildren()) do child.Material = Enum.Material.Neon child.BrickColor = BrickColor.new(ReverseON) child.PointLight.Enabled = true end 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/1.6) .. " MPH" end)
-- Initialize Cmdr
Cmdr:RegisterHooksIn(ServerStorage.ConsoleHooks) Cmdr:RegisterDefaultCommands() Cmdr:RegisterCommandsIn(ServerStorage.ConsoleCommands)
-- aqui detectamos cuando clickeamos el boton
muteBtn.MouseButton1Click:Connect(function() visibleIcon = not visibleIcon muteIcon.Visible = visibleIcon local sound = game.SoundService:FindFirstChild("Sound") if visibleIcon and sound then sound.Volume = 0 elseif not visibleIcon and sound then sound.Volume = 0.5 end end) while wait() do for i,s in pairs(game.SoundService:GetChildren())do s:Destroy() end local random = math.random(1, #musicFolder:GetChildren()) local sound = musicFolder:GetChildren()[random] local soundClone = sound:Clone() showMusic(musicGui, sound.Name) soundClone.Name = "Sound" soundClone.Parent = game.SoundService soundClone:Play() soundClone.Ended:Wait() soundClone:Destroy() end
--// Walk and Sway
local L_135_ local L_136_ = 0.6 local L_137_ = 0.05 -- speed local L_138_ = -0.1 -- height local L_139_ = 0 local L_140_ = 0 local L_141_ = 35 --This is the limit of the mouse input for the sway local L_142_ = -9 --This is the magnitude of the sway when you're unaimed local L_143_ = -9 --This is the magnitude of the sway when you're aimed
-- RateLimiter object:
local RateLimiterObject = { --[[ _sources = {}, _rate_period = 0, --]] } RateLimiterObject.__index = RateLimiterObject function RateLimiterObject:CheckRate(source) --> is_to_be_processed [bool] -- Whether event should be processed local sources = self._sources local os_clock = os.clock() local rate_time = sources[source] if rate_time ~= nil then rate_time = math.max(os_clock, rate_time + self._rate_period) if rate_time - os_clock < 1 then sources[source] = rate_time return true else return false end else -- Preventing from remembering players that already left: if typeof(source) == "Instance" and source:IsA("Player") and PlayerReference[source] == nil then return false end sources[source] = os_clock + self._rate_period return true end end function RateLimiterObject:CleanSource(source) -- Forgets about the source - must be called for any object that self._sources[source] = nil end function RateLimiterObject:Cleanup() -- Forgets all sources self._sources = {} end function RateLimiterObject:Destroy() -- Make the RateLimiter module forget about this RateLimiter object RateLimiters[self] = nil end
--[[Transmission]]
Tune.TransModes = {"Auto","Semi","Manual"} --[[ [Modes] "Auto" : Automatic shifting "Semi" : Clutchless manual shifting, dual clutch transmission "Manual" : Manual shifting with clutch >Include within brackets eg: {"Semi"} or {"Auto", "Manual"} >First mode is default mode ]] --Automatic Settings Tune.AutoShiftMode = "RPM" --[[ [Modes] "Speed" : Shifts based on wheel speed "RPM" : Shifts based on RPM ]] Tune.AutoUpThresh = -200 -- Automatic upshift point (relative to peak RPM, positive = Over-rev) Tune.AutoDownThresh = 1400 -- Automatic downshift point (relative to peak RPM, positive = Under-rev) Tune.ShiftTime = .3 -- The time delay in which you initiate a shift and the car changes gear --Gear Ratios Tune.FinalDrive = 0.8 -- [TRANSMISSION CALCULATIONS FOR NERDS] Tune.Ratios = { -- SPEED [SPS] = (Wheel diameter(studs) * math.pi * RPM) / (60 * Gear Ratio * Final Drive * Multiplier) --[[ R ]] 18.641 ,-- WHEEL TORQUE = Engine Torque * Gear Ratio * Final Drive * Multiplier --[[ N ]] 0 , --[[ 1 ]] 16.641 , --[[ 2 ]] 12.342 , --[[ 3 ]] 9.812 , --[[ 4 ]] 7.765 , --[[ 5 ]] 6.272 , --[[ 6 ]] 5.045 , } Tune.FDMult = 1 -- Ratio multiplier (keep this at 1 if car is not struggling with torque)
-------- OMG HAX
r = game:service("RunService") local damage = 5 local slash_damage = 15 local lunge_damage = 20 sword = script.Parent.Handle Tool = script.Parent local SlashSound = Instance.new("Sound") SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav" SlashSound.Parent = sword SlashSound.Volume = .7 local LungeSound = Instance.new("Sound") LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav" LungeSound.Parent = sword LungeSound.Volume = .6 local UnsheathSound = Instance.new("Sound") UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav" UnsheathSound.Parent = sword UnsheathSound.Volume = 1 function blow(hit) local humanoid = hit.Parent:findFirstChild("Humanoid") local vCharacter = Tool.Parent local vPlayer = game.Players:playerFromCharacter(vCharacter) local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character if humanoid~=nil and humanoid ~= hum and hum ~= nil then -- final check, make sure sword is in-hand local right_arm = vCharacter:FindFirstChild("Right Arm") if (right_arm ~= nil) then local joint = right_arm:FindFirstChild("RightGrip") if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then tagHumanoid(humanoid, vPlayer) humanoid:TakeDamage(damage) wait(1) untagHumanoid(humanoid) end end end end function tagHumanoid(humanoid, player) local creator_tag = Instance.new("ObjectValue") creator_tag.Value = player creator_tag.Name = "creator" creator_tag.Parent = humanoid end function untagHumanoid(humanoid) if humanoid ~= nil then local tag = humanoid:findFirstChild("creator") if tag ~= nil then tag.Parent = nil end end end function attack() Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 0.7 Tool.Parent.Torso["Right Shoulder"].DesiredAngle = 3.6 wait(.1) Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 1 damage = slash_damage SlashSound:play() local anim = Instance.new("StringValue") anim.Name = "toolanim" anim.Value = "Slash" anim.Parent = Tool end function lunge() damage = lunge_damage LungeSound:play() local anim = Instance.new("StringValue") anim.Name = "toolanim" anim.Value = "Lunge" anim.Parent = Tool force = Instance.new("BodyVelocity") force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80 force.Parent = Tool.Parent.Torso wait(.25) --swordOut() wait(.25) force.Parent = nil wait(.5) --swordUp() damage = slash_damage end function clawOut() Tool.GripForward = Vector3.new(0,0,1) Tool.GripRight = Vector3.new(0,1,0) Tool.GripUp = Vector3.new(1,0,0) end function clawUp() Tool.GripForward = Vector3.new(-1,0,0) Tool.GripRight = Vector3.new(0,1,0) Tool.GripUp = Vector3.new(0,0,1) end function swordAcross() -- parry end Tool.Enabled = true local last_attack = 0 function onActivated() if not Tool.Enabled then return end Tool.Enabled = false local character = Tool.Parent; local humanoid = character.Humanoid if humanoid == nil then print("Humanoid not found") return end t = r.Stepped:wait() if (t - last_attack < .2) then lunge() else attack() end last_attack = t --wait(.5) Tool.Enabled = true end function onEquipped() UnsheathSound:play() end script.Parent.Activated:connect(onActivated) script.Parent.Equipped:connect(onEquipped) connection = sword.Touched:connect(blow)
-- ================================================================================ -- EVENT CONNECTIONS -- ================================================================================
UserInputService.InputBegan:Connect(InputBegan) UserInputService.InputEnded:Connect(InputEnded) UserInputService.InputChanged:Connect(InputChanged) UserInputService.GamepadConnected:Connect(GamepadConnected) UserInputService.GamepadDisconnected:Connect(GamepadDisconnected)
--[=[ @class Janitor A Janitor is helpful for tracking any sort of object during runtime that needs to get cleaned up at some point. ]=]
local Janitor = {} Janitor.__index = Janitor
-- RocketPropulsion Fields
local TARGET_RADIUS = 5 local MAX_SPEED = 95 local MAX_TORQUE = Vector3.new(4e6, 4e6, 0) local MAX_THRUST = 50000 local THRUST_P = 500 local THRUST_D = 50000 local TARGET_OVERSHOOT_DISTANCE = 10000000 local ROCKET_MESH_ID = 'http://www.roblox.com/asset/?id=94690081' local ROCKET_MESH_SCALE = Vector3.new(2.5, 2.5, 2) local ROCKET_PART_SIZE = Vector3.new(1, 1, 4)
--Main function for server placement----------
local function Place(Player, Name, ItemHolder, Prefabs, Cframe, Plot) local Collisions = GetCollisions(Name) local Item = Prefabs:FindFirstChild(Name):Clone() Item.PrimaryPart.CanCollide = false Item:PivotTo(Cframe) if Plot then if CheckBoundaries(Plot, Item.PrimaryPart) then return end Item.Parent = ItemHolder end return HandleCollisions(Player.Character, Item, Collisions, Plot) end
-- functions
local function HandleDrop(d) local drop = { Model = nil; Outline = nil; Parts = {}; } local model = ITEMS[d.Name]:Clone() model.Parent = EFFECTS model:BreakJoints() local config = require(model:WaitForChild("Config")) local base = ITEMS[d.Name] if base:FindFirstChild("Attachments") then local attachments = d:WaitForChild("Attachments") for _, attach in pairs(attachments:GetChildren()) do local attachment = ITEMS[attach.Name]:Clone() local config = require(attachment.Config) attachment:SetPrimaryPartCFrame(model.PrimaryPart.CFrame * model.PrimaryPart[config.Attach .. "Attach"].CFrame * attachment.PrimaryPart.Attach.CFrame:inverse()) attachment.Parent = model attachment:BreakJoints() end end local outline = Instance.new("Model") outline.Name = "Outline" outline.Parent = EFFECTS drop.Model = model drop.Outline = outline local center = model.PrimaryPart:FindFirstChild("Center") for _, v in pairs(model:GetDescendants()) do if v:IsA("BasePart") then v.CFrame = CFrame.new(0, -100, 0) v.Anchored = true v.CanCollide = false local o = v:Clone() o.Name = "Outline" o.Material = Enum.Material.Neon o.Color = OUTLINE_COLOR o.Size = o.Size + Vector3.new(OUTLINE_WIDTH, OUTLINE_WIDTH, OUTLINE_WIDTH) if o:IsA("MeshPart") then o.TextureID = "" end o.Parent = outline local info = { Part = v; Outline = o; Offset = CFrame.new(); } if center then info.Offset = center.WorldCFrame:toObjectSpace(v.CFrame) else info.Offset = model.PrimaryPart.CFrame:toObjectSpace(v.CFrame) end table.insert(drop.Parts, info) end end drops[d] = drop d.AncestryChanged:connect(function() if d.Parent ~= DROPS then if drops[d] then drops[d].Model:Destroy() drops[d].Outline:Destroy() drops[d] = nil end end end) end
--[[ TS:Create(ArmaClone.REG, TweenInfo.new(0), {Transparency = 0}):Play() if ArmaClone:FindFirstChild("REG2") then TS:Create(ArmaClone.REG2, TweenInfo.new(0), {Transparency =0}):Play() end ]]
for _,v in pairs(ArmaClone:GetDescendants()) do if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then if v.Name == "REG" then TS:Create(v, TweenInfo.new(0), {Transparency = 0}):Play() end end end for _,v in pairs(ArmaClone:GetDescendants()) do if v:IsA('MeshPart') or v:IsA('Part') or v:IsA('UnionOperation') then if v.Name == "ADS" then TS:Create(v, TweenInfo.new(0), {Transparency = 1}):Play() end end end end TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play() TS:Create(game.Lighting.DepthOfField, TweenInfo.new(0.3), {FocusDistance = 0}):Play() end if not Safe and not AnimDebounce then stance = 3 Evt.Stance:FireServer(stance,Settings,Anims,ArmaClient) SprintAnim() end elseif not Correndo or SpeedPrecision == 0 then if not Safe and not AnimDebounce then if Aiming then stance = 2 Evt.Stance:FireServer(stance,Settings,Anims,ArmaClient) IdleAnim() else stance = 0 Evt.Stance:FireServer(stance,Settings,Anims,ArmaClient) IdleAnim() end end end end end Sprinting.Changed:connect(function(Valor) Correndo = Valor Sprint() end)
-- car.Body.Dash.D.off.Enabled = true -- car.Body.Dash.S.off.Enabled = true
end
-- ROBLOX deviation: predefine variables
local convertRowToTable, convertTableToTemplates local typesModule = require(Packages.JestTypes) type Global_Row = typesModule.Global_Row type Global_Table = typesModule.Global_Table
-- Define the function to open or close the window with gene-alike effect
local function toggleWindow() if window.Visible then window.Visible = false else window.Visible = true end end
----- MAGIC NUMBERS ABOUT THE TOOL ----- -- How much damage a bullet does
local Damage = 999999999
--// Modules
local L_109_ = require(L_22_:WaitForChild("Utilities")) local L_110_ = require(L_22_:WaitForChild("Spring")) local L_111_ = require(L_22_:WaitForChild("Plugins")) local L_112_ = require(L_22_:WaitForChild("easing")) local L_113_ = L_109_.Fade local L_114_ = L_109_.SpawnCam local L_115_ = L_109_.FixCam local L_116_ = L_109_.tweenFoV local L_117_ = L_109_.tweenCam local L_118_ = L_109_.tweenRoll local L_119_ = L_109_.TweenJoint local L_120_ = L_109_.Weld
--[[ Constructs and returns objects which can be used to model independent reactive state. ]]
local Dependencies = require(script.Parent.Parent.Dependencies) local utility = Dependencies.utility local class = {} local CLASS_METATABLE = {__index = class} local WEAK_KEYS_METATABLE = {__mode = "k"} local function Value(initalValue: unknown) local self = setmetatable({ type = "State", kind = "Value", -- if we held strong references to the dependents, then they wouldn't be -- able to get garbage collected when they fall out of scope -- contains all `get` requests dependentSet = setmetatable({}, WEAK_KEYS_METATABLE), _value = initalValue }, CLASS_METATABLE) return self end
--Turn Control------------------------------------------------------------------------
YArrow = script.Parent.BimodalTurn.YLamp GArrow = script.Parent.BimodalTurn.Lamp DYArrow = script.Parent.BimodalTurn.YDynamicLight DGArrow = script.Parent.BimodalTurn.DynamicLight function TurnActive() if Turn.Value == 0 then GArrow.Enabled = false YArrow.Enabled = false DGArrow.Enabled = false DYArrow.Enabled = false elseif Turn.Value == 1 then GArrow.Enabled = true YArrow.Enabled = false DGArrow.Enabled = true DYArrow.Enabled = false elseif Turn.Value == 2 then GArrow.Enabled = false YArrow.Enabled = true DGArrow.Enabled = false DYArrow.Enabled = true elseif Turn.Value == 3 then GArrow.Enabled = false YArrow.Enabled = false DGArrow.Enabled = false DYArrow.Enabled = false end end Turn.Changed:connect(TurnActive)
---------------------------------- ------------FUNCTIONS------------- ----------------------------------
function Receive(action, ...) local args = {...} if not ScriptReady then return end if action == "activate" then if not PlayingEnabled then Activate(args[1], args[2]) specialPiano = args[3]; end elseif action == "deactivate" then if PlayingEnabled then Deactivate() end elseif action == "DDD" or args[1] == "DDD" then if Player.Name == args[1] or Player.Name == action then Deactivate() end elseif action == "play" then for i,v in pairs(args[5]) do if v == "Fade" then fade = true end end if Player ~= args[1] then PlayNoteServer(args[2], args[3], args[4], args[5], args[6], args[7]) end end end function Activate(cameraCFrame, sounds) PlayingEnabled = true MakeHumanoidConnections() MakeKeyboardConnections() MakeGuiConnections() SetCamera(cameraCFrame) SetSounds(sounds) ShowPiano() end function Deactivate() SpecialPiano = false PlayingEnabled = false BreakHumanoidConnections() BreakKeyboardConnections() BreakGuiConnections() HidePiano() HideSheets() ReturnCamera() Jump() end function PlayNoteClient(note) PlayNoteSound(note) HighlightPianoKey(note) Connector:FireServer("play", note, Volume,Transposition.Value) end function PlayNoteServer(note, point, range, sounds, vol, special) PlayNoteSound(note, point, range, sounds, vol, SpecialPiano or special) -- just incase ;-; end function Abort() SpecialPiano = false; Connector:FireServer("abort") end function Transpose(value) Transposition.Value = Transposition.Value + value PianoGui.TransposeLabel.Text = "Transposition: " .. Transposition.Value end function VolumeChange(value) if (Volume + value <= 1.5) and (Volume + value >= 0.1) then Volume = Volume + value; PianoGui.VolumeLabel.Text = "Volume: " .. Volume * 100 .. "%"; end end
-- Detect when prompt hold ends
local function onPromptHoldEnded(promptObject, player) ObjectActions.promptHoldEndedActions(promptObject, player) end
--[[ This is a test file to demonstrate how ragdolls work. If you don't use this file, you need to manually apply the Ragdoll tag to humanoids that you want to ragdoll --]]
local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local StarterPack = game:GetService("StarterPack") local StarterPlayer = game:GetService("StarterPlayer") script.RagdollMe.Parent = StarterPlayer.StarterCharacterScripts
-- print("мимо игрока")
return -- не атакуем end if hit.Parent:FindFirstChild("Owner") ~= nil then -- чьёто return -- не атакуем end local tmp=hit.Parent:FindFirstChild("Owner") if tmp ~= nil then if tmp.Value == bullet.Owner.Value then -- постройка игрока -- print("мимо своей постройки") return -- не атакуем end end if hit.Parent:findFirstChild("Humanoid") ~= nil then local hum=hit.Parent:findFirstChild("Humanoid")
-- ROBLOX deviation: omitted isBuiltInObject and isMap functions because Lua only has one type, the table, -- for structuring data
local deepCyclicCopyTable, deepCyclicCopyReplaceable type anyTable = { [any]: any } function deepCyclicCopyTable(tableToCopy: anyTable, cycles: anyTable) local newTable: anyTable = {} cycles[tableToCopy] = newTable for key, value in pairs(tableToCopy) do newTable[key] = deepCyclicCopyReplaceable(value, cycles) end return newTable end function deepCyclicCopyReplaceable(value: any, cycles: anyTable) if typeof(value) ~= "table" then return value elseif cycles[value] then return cycles[value] else local t = deepCyclicCopyTable(value, cycles) local mt = getmetatable(value) if mt and typeof(mt) == "table" then setmetatable(t, mt) end return t end end return function(value, cycles) cycles = cycles or {} setmetatable(cycles, { _mode = "kv" }) return deepCyclicCopyReplaceable(value, cycles) end
-- StrangeEnd
player = script.Parent.Parent.Parent.Parent.Parent money = player.leaderstats.Cash price = 400 --Put Price-- tool = game.Lighting.P2000 function buy() if money.Value >= price then money.Value = money.Value - price local a = tool:clone() a.Parent = player.Backpack end end script.Parent.MouseButton1Down:connect(buy)
--// Services
local L_105_ = game:GetService('RunService').RenderStepped local L_106_ = game:GetService('UserInputService')
--------RIGHT DOOR --------
game.Workspace.doorright.l11.BrickColor = BrickColor.new(106) game.Workspace.doorright.l23.BrickColor = BrickColor.new(106) game.Workspace.doorright.l32.BrickColor = BrickColor.new(106) game.Workspace.doorright.l41.BrickColor = BrickColor.new(106) game.Workspace.doorright.l53.BrickColor = BrickColor.new(106) game.Workspace.doorright.l62.BrickColor = BrickColor.new(106) game.Workspace.doorright.l71.BrickColor = BrickColor.new(106) game.Workspace.doorright.l12.BrickColor = BrickColor.new(1013) game.Workspace.doorright.l21.BrickColor = BrickColor.new(1013) game.Workspace.doorright.l33.BrickColor = BrickColor.new(1013) game.Workspace.doorright.l42.BrickColor = BrickColor.new(1013) game.Workspace.doorright.l51.BrickColor = BrickColor.new(1013) game.Workspace.doorright.l63.BrickColor = BrickColor.new(1013) game.Workspace.doorright.l72.BrickColor = BrickColor.new(1013) game.Workspace.doorright.l13.BrickColor = BrickColor.new(1023) game.Workspace.doorright.l22.BrickColor = BrickColor.new(1023) game.Workspace.doorright.l31.BrickColor = BrickColor.new(1023) game.Workspace.doorright.l43.BrickColor = BrickColor.new(1023) game.Workspace.doorright.l52.BrickColor = BrickColor.new(1023) game.Workspace.doorright.l61.BrickColor = BrickColor.new(1023) game.Workspace.doorright.l73.BrickColor = BrickColor.new(1023) game.Workspace.doorright.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
--[[ MatchTable { Some: (value: any) -> any None: () -> any } CONSTRUCTORS: Option.Some(anyNonNilValue): Option<any> Option.Wrap(anyValue): Option<any> STATIC FIELDS: Option.None: Option<None> STATIC METHODS: Option.Is(obj): boolean METHODS: opt:Match(): (matches: MatchTable) -> any opt:IsSome(): boolean opt:IsNone(): boolean opt:Unwrap(): any opt:Expect(errMsg: string): any opt:ExpectNone(errMsg: string): void opt:UnwrapOr(default: any): any opt:UnwrapOrElse(default: () -> any): any opt:And(opt2: Option<any>): Option<any> opt:AndThen(predicate: (unwrapped: any) -> Option<any>): Option<any> opt:Or(opt2: Option<any>): Option<any> opt:OrElse(orElseFunc: () -> Option<any>): Option<any> opt:XOr(opt2: Option<any>): Option<any> opt:Contains(value: any): boolean -------------------------------------------------------------------- Options are useful for handling nil-value cases. Any time that an operation might return nil, it is useful to instead return an Option, which will indicate that the value might be nil, and should be explicitly checked before using the value. This will help prevent common bugs caused by nil values that can fail silently. Example: local result1 = Option.Some(32) local result2 = Option.Some(nil) local result3 = Option.Some("Hi") local result4 = Option.Some(nil) local result5 = Option.None -- Use 'Match' to match if the value is Some or None: result1:Match { Some = function(value) print(value) end; None = function() print("No value") end; } -- Raw check: if result2:IsSome() then local value = result2:Unwrap() -- Explicitly call Unwrap print("Value of result2:", value) end if result3:IsNone() then print("No result for result3") end -- Bad, will throw error bc result4 is none: local value = result4:Unwrap() --]]
local CLASSNAME = "Option"
--[[Engine]]
--Torque Curve Tune.Horsepower = 200 -- [TORQUE CURVE VISUAL] Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf Tune.PeakRPM = 6000 -- Use sliders to manipulate values Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values Tune.EqPoint = 5500 Tune.PeakSharpness = 7.5 Tune.CurveMult = 0.16 --Incline Compensation Tune.InclineComp = 4.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees) --Misc Tune.RevAccel = 150 -- RPM acceleration when clutch is off Tune.RevDecay = 75 -- RPM decay when clutch is off Tune.RevBounce = 500 -- RPM kickback from redline Tune.IdleThrottle = 3 -- Percent throttle at idle Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
--- Returns the last argument that has a value. -- Useful for getting the autocomplete for the argument the user is working on.
function Command:GetLastArgument() for i = #self.Arguments, 1, -1 do if self.Arguments[i].RawValue then return self.Arguments[i] end end end
--//N//--
if gear.Value == 0 then if carSeat.Throttle == 1 then rwd.Throttle = 0 rwd.Torque = cst rwd.MaxSpeed = maxspeed lwd.Throttle = 0 lwd.Torque = cst lwd.MaxSpeed = maxspeed rrwd.Throttle = 0 rrwd.Torque = cst rrwd.MaxSpeed = maxspeed elseif carSeat.Throttle == -1 then rb.RB.CanCollide = true rb.FB.CanCollide = true lfb.RB.CanCollide = true lfb.FB.CanCollide = true rfb.RB.CanCollide = true rfb.FB.CanCollide = true wait(brakes) rb.RB.CanCollide = false rb.FB.CanCollide = false lfb.RB.CanCollide = false lfb.FB.CanCollide = false rfb.RB.CanCollide = false rfb.FB.CanCollide = false wait() elseif carSeat.Throttle == 0 then rwd.Throttle = 0 rwd.Torque = cst rwd.MaxSpeed = maxspeed lwd.Throttle = 0 lwd.Torque = cst lwd.MaxSpeed = maxspeed rrwd.Throttle = 0 rrwd.Torque = cst rrwd.MaxSpeed = maxspeed rb.RB.CanCollide = false rb.FB.CanCollide = false lfb.RB.CanCollide = false lfb.FB.CanCollide = false rfb.RB.CanCollide = false rfb.FB.CanCollide = false end end
--[[ A type that represents all the types of merch supported by the merch booth ]]
export type ProductType = Enum.AccessoryType | Enum.InfoType return {}
-- Finish: -- overlay.Position = UDim2.new(-2, 0, -2, -22) -- overlay.Size = UDim2.new(4.5, 0, 4.65, 30)
print(damagedone) local overlay = gui.hurtOverlay overlay.Position = UDim2.new(-2, 0, -2, -22) overlay.Size = UDim2.new(4.5, 0, 4.65, 30)
-- Activation]:
if TurnCharacterToMouse == true then MseGuide = true HeadHorFactor = 0 BodyHorFactor = 0 end game:GetService("RunService").RenderStepped:Connect(function() local CamCF = Cam.CoordinateFrame if ((IsR6 and Body["Torso"]) or Body["UpperTorso"])~=nil and Body["Head"]~=nil then --[Check for the Torso and Head...] local TrsoLV = Trso.CFrame.lookVector local HdPos = Head.CFrame.p if IsR6 and Neck or Neck and Waist then --[Make sure the Neck still exists.] if Cam.CameraSubject:IsDescendantOf(Body) or Cam.CameraSubject:IsDescendantOf(Plr) then local Dist = nil; local Diff = nil; if not MseGuide then --[If not tracking the Mouse then get the Camera.] Dist = (Head.CFrame.p-CamCF.p).magnitude Diff = Head.CFrame.Y-CamCF.Y if not IsR6 then --[R6 and R15 Neck rotation C0s are different; R15: X axis inverted and Z is now the Y.] Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aSin(Diff/Dist)*HeadVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2) Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang((aSin(Diff/Dist)*BodyVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2) else --[R15s actually have the properly oriented Neck CFrame.] Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aSin(Diff/Dist)*HeadVertFactor), 0, -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor),UpdateSpeed/2) end else local Point = Mouse.Hit.p Dist = (Head.CFrame.p-Point).magnitude Diff = Head.CFrame.Y-Point.Y if not IsR6 then Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aTan(Diff/Dist)*HeadVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2) Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang(-(aTan(Diff/Dist)*BodyVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2) else Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aTan(Diff/Dist)*HeadVertFactor), 0, (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor), UpdateSpeed/2) end end end end end if TurnCharacterToMouse == true then Hum.AutoRotate = false Core.CFrame = Core.CFrame:lerp(CFrame.new(Core.Position, Vector3.new(Mouse.Hit.p.x, Core.Position.Y, Mouse.Hit.p.z)), UpdateSpeed / 2) else Hum.AutoRotate = true end end)
-- Decompiled with the Synapse X Luau decompiler.
while not require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library")).Loaded do game:GetService("RunService").Heartbeat:Wait(); end; local l__LightsA__1 = script.Parent.LightsA; local l__LightsB__2 = script.Parent.LightsB; task.spawn(function() while true do wait(1); if l__LightsA__1.Color == Color3.fromRGB(126, 255, 0) then l__LightsA__1.Color = Color3.fromRGB(255, 44, 26); l__LightsB__2.Color = Color3.fromRGB(126, 255, 0); else l__LightsA__1.Color = Color3.fromRGB(126, 255, 0); l__LightsB__2.Color = Color3.fromRGB(255, 44, 26); end; end; end);
----- Package -----
wait(1) local Package = Inventory.BatCase1
--edit the function below to return true when you want this response/prompt to be valid --player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder) local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player) if plrData.Character.Injuries.BrokenRib.Value == true then return true end return false end
--[=[ Converts a set from a list @function fromList @param tab table @return table @within Set ]=]
Set.fromList = Set.fromTableValue
--// Renders
L_9_:connect(function() if not L_15_ then L_2_:WaitForChild('Humanoid').Jump = false end if L_14_ then L_34_.Text = 'ALTITUDE: ' .. math.ceil(L_2_:WaitForChild('Torso').Position.Y) L_11_.Position = L_28_ if L_27_ then L_12_.CFrame = L_3_.Hit * L_29_ L_30_ = L_3_.Hit else L_12_.CFrame = L_30_ * L_29_ end end end)
------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------
function onRunning(speed: number) if speed > 0.01 then playAnimation("walk", 0.1, Humanoid) if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then setAnimationSpeed(speed / 14.5) end pose = "Running" else if emoteNames[currentAnim] == nil then playAnimation("idle", 0.1, Humanoid) pose = "Standing" end end end function onDied() pose = "Dead" end function onJumping() playAnimation("jump", 0.1, Humanoid) jumpAnimTime = jumpAnimDuration pose = "Jumping" end function onClimbing(speed: number) playAnimation("climb", 0.1, Humanoid) setAnimationSpeed(speed / 12.0) pose = "Climbing" end function onGettingUp() pose = "GettingUp" end function onFreeFall() if jumpAnimTime <= 0 then playAnimation("fall", fallTransitionTime, Humanoid) end pose = "FreeFall" end function onFallingDown() pose = "FallingDown" end function onSeated() pose = "Seated" end function onPlatformStanding() pose = "PlatformStanding" end function onSwimming(speed: number) if speed > 0 then pose = "Running" else pose = "Standing" end end function getTool() for _, kid in ipairs(Figure:GetChildren()) do if kid.className == "Tool" then return kid end end return nil end function getToolAnim(tool: Tool) for _, c in ipairs(tool:GetChildren()) do if c.Name == "toolanim" and c.className == "StringValue" then return c end end return nil end function animateTool() if toolAnim == "None" then playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle) return end if toolAnim == "Slash" then playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action) return end if toolAnim == "Lunge" then playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action) return end end local lastTick = 0 function move(time: number) local amplitude = 1 local frequency = 1 local deltaTime = time - lastTick lastTick = time local climbFudge = 0 local setAngles = false if jumpAnimTime > 0 then jumpAnimTime = jumpAnimTime - deltaTime end if pose == "FreeFall" and jumpAnimTime <= 0 then playAnimation("fall", fallTransitionTime, Humanoid) elseif pose == "Seated" then playAnimation("sit", 0.5, Humanoid) return elseif pose == "Running" then playAnimation("walk", 0.1, Humanoid) elseif pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding" then -- print("Wha " .. pose) stopAllAnimations() amplitude = 0.1 frequency = 1 setAngles = true end if setAngles then local desiredAngle = amplitude * math.sin(time * frequency) RightShoulder:SetDesiredAngle(desiredAngle + climbFudge) LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge) RightHip:SetDesiredAngle(-desiredAngle) LeftHip:SetDesiredAngle(-desiredAngle) end -- Tool Animation handling local tool = getTool() if tool and tool:FindFirstChild("Handle") then local animStringValueObject = getToolAnim(tool) if animStringValueObject then toolAnim = animStringValueObject.Value -- message recieved, delete StringValue animStringValueObject.Parent = nil toolAnimTime = time + 0.3 end if time > toolAnimTime then toolAnimTime = 0 toolAnim = "None" end animateTool() else stopToolAnimations() toolAnim = "None" toolAnimInstance = nil toolAnimTime = 0 end end
-- Bindable for when we want touch emergency controls -- TODO: Click to move should probably have it's own gui touch controls -- to manage this.
local BindableEvent_OnFailStateChanged = nil if UIS.TouchEnabled then BindableEvent_OnFailStateChanged = Instance.new('BindableEvent') BindableEvent_OnFailStateChanged.Name = "OnClickToMoveFailStateChange" local CameraScript = script.Parent local PlayerScripts = CameraScript.Parent BindableEvent_OnFailStateChanged.Parent = PlayerScripts end