prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
--[[ Roblox Services ]]
-- local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local UserGameSettings = UserSettings():GetService("UserGameSettings")
--[[Transmission]]
Tune.TransModes = {"Auto", "Semi", "Manual"} --[[ [Modes] "Auto" : Automatic shifting "Semi" : Clutchless manual shifting, dual clutch transmission "Manual" : Manual shifting with clutch >Include within brackets eg: {"Semi"} or {"Auto", "Manual"} >First mode is default mode ]] --Automatic Settings Tune.AutoShiftMode = "Speed" --[[ [Modes] "Speed" : Shifts based on wheel speed "RPM" : Shifts based on RPM ]] Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev) Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev) --Gear Ratios Tune.FinalDrive = 3.30 -- Gearing determines top speed and wheel torque Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed --[[Reverse]] 3.30 , -- Copy and paste a ratio to add a gear --[[Neutral]] 0 , -- Ratios can also be deleted --[[ 1 ]] 2.89 , -- Reverse, Neutral, and 1st gear are required --[[ 2 ]] 1.99 , --[[ 3 ]] 1.51 , --[[ 4 ]] 1.20 , --[[ 5 ]] 1.00 , --[[ 6 ]] 0.85 , } Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--[[ 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() ClickToMoveDisplay.CancelFailureAnimation() 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 = ExistingPather or self.keyboardMoveVector.Magnitude <= 0 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) -- 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
--Engine Curve
local HP=_Tune.Horsepower/100 local HP_T=((_Tune.Horsepower*((_TPsi)*(_Tune.T_Efficiency/10))/7.5)/2)/100 local HP_S=((_Tune.Horsepower*((_SPsi)*(_Tune.S_Efficiency/10))/7.5)/2)/100 local Peak=_Tune.PeakRPM/1000 local Sharpness=_Tune.PeakSharpness local CurveMult=_Tune.CurveMult local EQ=_Tune.EqPoint/1000 function CurveN(RPM) RPM=RPM/1000 return ((-(RPM-Peak)^2)*math.min(HP/(Peak^2),CurveMult^(Peak/HP))+HP)*(RPM-((RPM^Sharpness)/(Sharpness*Peak^(Sharpness-1)))) end local PeakCurveN = CurveN(_Tune.PeakRPM) function CurveT(RPM) RPM=RPM/1000 return ((-(RPM-Peak)^2)*math.min(HP_T/(Peak^2),CurveMult^(Peak/HP_T))+HP_T)*(RPM-((RPM^Sharpness)/(Sharpness*Peak^(Sharpness-1)))) end local PeakCurveT = CurveT(_Tune.PeakRPM) function CurveS(RPM) RPM=RPM/1000 return ((-(RPM-Peak)^2)*math.min(HP_S/(Peak^2),CurveMult^(Peak/HP_S))+HP_S)*(RPM-((RPM^Sharpness)/(Sharpness*Peak^(Sharpness-1)))) end local PeakCurveS = CurveS(_Tune.PeakRPM)
--- Code that will be run when the block is added to a InfoOverlay. Used to customize and edit the appearance or add functionality.
return function(blockGui, blockName, ...) local description = ... blockGui.desc.Text = description end
-- These controllers handle only walk/run movement, jumping is handled by the -- TouchJump controller if any of these are active
local ClickToMove = require(script:WaitForChild("ClickToMoveController")) local TouchThumbstick = require(script:WaitForChild("TouchThumbstick")) local TouchThumbpad = require(script:WaitForChild("TouchThumbpad")) local TouchJump = require(script:WaitForChild("TouchJump")) local VehicleController = require(script:WaitForChild("VehicleController")) local CONTROL_ACTION_PRIORITY = Enum.ContextActionPriority.Default.Value
-- return to idle if finishing an emote
if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then oldAnim = "idle" end currentAnim = "" currentAnimInstance = nil if (currentAnimKeyframeHandler ~= nil) then currentAnimKeyframeHandler:disconnect() end if (currentAnimTrack ~= nil) then currentAnimTrack:Stop() currentAnimTrack:Destroy() currentAnimTrack = nil end return oldAnim end function setAnimationSpeed(speed) if speed ~= currentAnimSpeed then currentAnimSpeed = speed currentAnimTrack:AdjustSpeed(currentAnimSpeed) end end function keyFrameReachedFunc(frameName) if (frameName == "End") then local repeatAnim = currentAnim
-- Preload animations
function playAnimation(animName, transitionTime, humanoid) local roll = math.random(1, animTable[animName].totalWeight) local origRoll = roll local idx = 1 while (roll > animTable[animName][idx].weight) do roll = roll - animTable[animName][idx].weight idx = idx + 1 end
--Still Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill --Still Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill --Still Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill--Still Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill till Chill
--
local characterClone = require(game.ReplicatedStorage.CharacterClone) local clones = {} local function onCharacter(character) if (character) then character.Archivable = true character:WaitForChild("Humanoid") -- weird bug local cloneA = characterClone.new(character) local cloneB = characterClone.new(character) dualWorld.PortalA:AddToWorld(cloneA.Clone) dualWorld.PortalB:AddToWorld(cloneB.Clone) table.insert(clones, cloneA) table.insert(clones, cloneB) end end game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(onCharacter) end) wait(1) for _, player in next, game.Players:GetPlayers() do onCharacter(player.Character) player.CharacterAdded:Connect(onCharacter) end game:GetService("RunService").RenderStepped:Connect(function(dt) for i = 1, #clones do clones[i]:Update() end end)
--
local u_categories = options.unicodeData and require(script:WaitForChild("_unicodechar_category")); local chr_scripts = options.unicodeData and require(script:WaitForChild("_scripts")); local xuc_chr = options.unicodeData and require(script:WaitForChild("_xuc")); local proxy = setmetatable({ }, { __mode = 'k' }); local re, re_m, match_m = { }, { }, { }; local lockmsg;
-- Format params: paramName, expectedType, actualType
local ERR_INVALID_TYPE = "Invalid type for parameter '%s' (Expected %s, got %s)"
-- Format params: methodName, ctorName
local ERR_NOT_INSTANCE = "Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"
-- slash1
Attack(target,fleshDamage) else Move(target.Character.PrimaryPart.Position) end else target,targetType = nil,nil end wait(.3) end elseif targetType == "Model" then while target and target.PrimaryPart and target:IsDescendantOf(workspace) and lastLock == sessionLock do Move(target.PrimaryPart.Position) local dist = (root.Position-target.PrimaryPart.Position).magnitude if dist < 15 then
-- Remove the default loading screen
ReplicatedFirst:RemoveDefaultLoadingScreen() local tweenInfo = TweenInfo.new(4, Enum.EasingStyle.Linear, Enum.EasingDirection.In, -1) local tween = TweenService:Create(loadingRing, tweenInfo, {Rotation = 360}) tween:Play() wait(12) -- Force screen to appear for a minimum number of seconds if not game:IsLoaded() then game.Loaded:Wait() end screenGui:Destroy()
--[[ Calls awaitStatus internally, returns (isResolved, values...) ]]
function Promise.prototype:await() return awaitHelper(self:awaitStatus()) end local function expectHelper(status, ...) if status ~= Promise.Status.Resolved then error((...) == nil and "Expected Promise rejected with no value." or (...), 3) end return ... end
---------------------------------------------------------------------------------------------------- --------------------=[ CFRAME ]=-------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
,EnableHolster = false ,HolsterTo = 'Torso' -- Put the name of the body part you wanna holster to ,HolsterPos = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)) ,RightArmPos = CFrame.new(-0.85, -0.2, -1.2) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) --Server ,LeftArmPos = CFrame.new(1.05,0.9,-1.4) * CFrame.Angles(math.rad(-100),math.rad(25),math.rad(-20)) --server ,ServerGunPos = CFrame.new(-.3, -1, -0.4) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) ,GunPos = CFrame.new(0.15, -0.15, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)) ,RightPos = CFrame.new(-.65, -0.2, -1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) --Client ,LeftPos = CFrame.new(1.2,0.1,-1.6) * CFrame.Angles(math.rad(-120),math.rad(35),math.rad(-20)) --Client } return Config
---------------------------------------------------------------------------------------------------- -----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------ ----------------------------------------------------------------------------------------------------
,VRecoil = {20,25} --- Vertical Recoil ,HRecoil = {10,15} --- Horizontal Recoil ,AimRecover = 1 ---- Between 0 & 1 ,RecoilPunch = 1.25 ,VPunchBase = 15 --- Vertical Punch ,HPunchBase = 7 --- Horizontal Punch ,DPunchBase = 1 --- Tilt Punch | useless ,AimRecoilReduction = 1 --- Recoil Reduction Factor While Aiming (Do not set to 0) ,PunchRecover = 0.1 ,MinRecoilPower = 1 ,MaxRecoilPower = 3 ,RecoilPowerStepAmount = 1 ,MinSpread = 0 --- Min bullet spread value | Studs ,MaxSpread = 75 --- Max bullet spread value | Studs ,AimInaccuracyStepAmount = 5 ,WalkMultiplier = 0 --- Bullet spread based on player speed ,SwayBase = 0.25 --- Weapon Base Sway | Studs ,MaxSway = 1 --- Max sway value based on player stamina | Studs
--------------------[ MATH FUNCTIONS ]------------------------------------------------
function Map(Val, fromLow, fromHigh, toLow, toHigh) return (Val - fromLow) * (toHigh - toLow) / (fromHigh - fromLow) + toLow end function numLerp(A, B, Alpha) return A + (B - A) * Alpha end function RAND(Min, Max, Accuracy) return numLerp(Min, Max, math.random()) --[[local Inverse = 1 / (Accuracy or 1) return (math.random(Min * Inverse, Max * Inverse) / Inverse)]] end function Round(Num, toNearest) return math.floor(Num / toNearest + 0.5) * toNearest end function getNearestPoint(A, B, Origin) local A2 = (A - Origin).magnitude local B2 = (B - Origin).magnitude return (math.min(A2, B2) == A2 and A or B) end
--- RUNTIME
Players.PlayerAdded:Connect(PlayerAdded) Players.PlayerRemoving:Connect(PlayerRemoving) Remote.OnServerEvent:Connect(Fire)
-- Remove with FFlagUserClickToMoveFollowPathRefactor
local function HandleDirectMoveTo(hitPt, myHumanoid) if myHumanoid then if myHumanoid.Sit then myHumanoid.Jump = true end myHumanoid:MoveTo(hitPt) end local endWaypoint = ClickToMoveDisplay.CreateEndWaypoint(hitPt) ExistingIndicator = endWaypoint coroutine.wrap(function() myHumanoid.MoveToFinished:wait() endWaypoint:Destroy() end)() end local function HandleMoveTo(thisPather, hitPt, hitChar, character, overrideShowPath) if FFlagUserClickToMoveFollowPathRefactor then ExistingPather = thisPather end thisPather:Start(overrideShowPath) if not FFlagUserClickToMoveFollowPathRefactor then CleanupPath() end if not FFlagUserClickToMoveFollowPathRefactor then ExistingPather = thisPather end PathCompleteListener = thisPather.Finished.Event:Connect(function() if FFlagUserClickToMoveFollowPathRefactor then CleanupPath() end if hitChar then local currentWeapon = GetEquippedTool(character) if currentWeapon then currentWeapon:Activate() end end end) PathFailedListener = thisPather.PathFailed.Event:Connect(function() CleanupPath() if overrideShowPath == nil or overrideShowPath then local shouldPlayFailureAnim = PlayFailureAnimation and not (ExistingPather and ExistingPather:IsActive()) if shouldPlayFailureAnim then ClickToMoveDisplay.PlayFailureAnimation() end ClickToMoveDisplay.DisplayFailureWaypoint(hitPt) end end) end local function ShowPathFailedFeedback(hitPt) if ExistingPather and ExistingPather:IsActive() then ExistingPather:Cancel() end if PlayFailureAnimation then ClickToMoveDisplay.PlayFailureAnimation() end ClickToMoveDisplay.DisplayFailureWaypoint(hitPt) end function OnTap(tapPositions, goToPoint, wasTouchTap) -- Good to remember if this is the latest tap event local camera = Workspace.CurrentCamera local character = Player.Character if not CheckAlive() then return end -- This is a path tap position if #tapPositions == 1 or goToPoint then if camera then local unitRay = camera:ScreenPointToRay(tapPositions[1].x, tapPositions[1].y) local ray = Ray.new(unitRay.Origin, unitRay.Direction*1000) local myHumanoid = findPlayerHumanoid(Player) local hitPart, hitPt, hitNormal = Utility.Raycast(ray, true, getIgnoreList()) local hitChar, hitHumanoid = Utility.FindCharacterAncestor(hitPart) if wasTouchTap and hitHumanoid and StarterGui:GetCore("AvatarContextMenuEnabled") then local clickedPlayer = Players:GetPlayerFromCharacter(hitHumanoid.Parent) if clickedPlayer then CleanupPath() return end end if goToPoint then hitPt = goToPoint hitChar = nil end if FFlagUserClickToMoveFollowPathRefactor then if hitPt and character then -- Clean up current path CleanupPath() local thisPather = Pather(hitPt, hitNormal) if thisPather:IsValidPath() then HandleMoveTo(thisPather, hitPt, hitChar, character) else -- Clean up thisPather:Cleanup() -- Feedback here for when we don't have a good path ShowPathFailedFeedback(hitPt) end end else if UseDirectPath and hitPt and character then HandleDirectMoveTo(hitPt, myHumanoid) elseif hitPt and character then local thisPather = Pather(hitPt, hitNormal) if thisPather:IsValidPath() then HandleMoveTo(thisPather, hitPt, hitChar, character) else if hitPt then -- Feedback here for when we don't have a good path ShowPathFailedFeedback(hitPt) end end end end end elseif #tapPositions >= 2 then if camera then -- Do shoot local currentWeapon = GetEquippedTool(character) if currentWeapon then currentWeapon:Activate() end end end end local function DisconnectEvent(event) if event then event:Disconnect() end end
-------- OMG HAX
r = game:service("RunService") local damage = 5 local slash_damage = 16 local lunge_damage = 35 sword = script.Parent.Handle Tool = script.Parent local SlashSound = Instance.new("Sound") SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav" SlashSound.Parent = sword SlashSound.Volume = .7 local LungeSound = Instance.new("Sound") LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav" LungeSound.Parent = sword LungeSound.Volume = .6 local UnsheathSound = Instance.new("Sound") UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav" UnsheathSound.Parent = sword UnsheathSound.Volume = 1 function blow(hit) local humanoid = hit.Parent:findFirstChild("Humanoid") local vCharacter = Tool.Parent local vPlayer = game.Players:playerFromCharacter(vCharacter) local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character if humanoid~=nil and humanoid ~= hum and hum ~= nil then -- final check, make sure sword is in-hand local right_arm = vCharacter:FindFirstChild("Right Arm") if (right_arm ~= nil) then local joint = right_arm:FindFirstChild("RightGrip") if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then tagHumanoid(humanoid, vPlayer) humanoid:TakeDamage(damage) wait(1) untagHumanoid(humanoid) end end end end function tagHumanoid(humanoid, player) local creator_tag = Instance.new("ObjectValue") creator_tag.Value = player creator_tag.Name = "creator" creator_tag.Parent = humanoid end function untagHumanoid(humanoid) if humanoid ~= nil then local tag = humanoid:findFirstChild("creator") if tag ~= nil then tag.Parent = nil end end end function attack() Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 0.7 Tool.Parent.Torso["Right Shoulder"].DesiredAngle = 3.6 wait(.1) Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 1 damage = slash_damage SlashSound:play() local anim = Instance.new("StringValue") anim.Name = "toolanim" anim.Value = "Slash" anim.Parent = Tool end function lunge() damage = lunge_damage LungeSound:play() local anim = Instance.new("StringValue") anim.Name = "toolanim" anim.Value = "Lunge" anim.Parent = Tool force = Instance.new("BodyVelocity") force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80 force.Parent = Tool.Parent.Torso wait(.25) --swordOut() wait(.25) force.Parent = nil wait(.5) --swordUp() damage = slash_damage end function clawOut() Tool.GripForward = Vector3.new(0,0,1) Tool.GripRight = Vector3.new(0,1,0) Tool.GripUp = Vector3.new(1,0,0) end function clawUp() Tool.GripForward = Vector3.new(-1,0,0) Tool.GripRight = Vector3.new(0,1,0) Tool.GripUp = Vector3.new(0,0,1) end function swordAcross() -- parry end Tool.Enabled = true local last_attack = 0 function onActivated() if not Tool.Enabled then return end Tool.Enabled = false local character = Tool.Parent; local humanoid = character.Humanoid if humanoid == nil then print("Humanoid not found") return end t = r.Stepped:wait() if (t - last_attack < .2) then lunge() else attack() end last_attack = t --wait(.5) Tool.Enabled = true end function onEquipped() UnsheathSound:play() end script.Parent.Activated:connect(onActivated) script.Parent.Equipped:connect(onEquipped) connection = sword.Touched:connect(blow)
--//Setup//--
local WindLines = require(script.WindLines) local WindShake = require(script.WindShake) local WindSpeed = 20 local WindDirection = Vector3.new(1, 0, -0.15) local WindShakeSettings = { WindPower = 3, WindSpeed = WindSpeed, WindDirection = WindDirection } local WindLinesSettings = { WindDirection = WindDirection, WindSpeed = WindSpeed, LifeTime = 9, SpawnRate = 15 } local ShakableObjects = { "Leaf", "Leaves", "Bush", "FLower" }
--!strict --[=[ @function removeValue @within Dictionary @param dictionary {[K]: V} -- The dictionary to remove the value from. @param value V -- The value to remove. @return {[K]: V} -- The dictionary without the given value. Removes the given value from the given dictionary. ```lua local dictionary = { hello = "roblox", goodbye = "world" } local withoutHello = RemoveValue(dictionary, "roblox") -- { goodbye = "world" } local withoutGoodbye = RemoveValue(dictionary, "world") -- { hello = "roblox" } ``` ]=]
local function removeValue<K, V>(dictionary: { [K]: V }, value: V): { [K]: V } local result = {} for key, v in pairs(dictionary) do if v ~= value then result[key] = v end end return result end return removeValue
-- RANK, RANK NAMES & SPECIFIC USERS
Ranks = { {5, "Owner", }; {4, "HeadAdmin", {"",0}, }; {3, "Admin", {"",0}, }; {2, "Mod", {"",0}, }; {1, "VIP", {"",0}, }; {0, "NonAdmin", }; };
--[[ Copyright (C)MrCoolIsCoolOhYeah SmartSirens 2014-2015, sponsering; Klaxon signals, Federal Signal, Whelen, Sentry, Sound master, ACA, ASC, CLM. Credit for 70W, Trucksrule12, Soapy92 for scripts. --]]
-- Get all the frames inside the AppManager frame
local windows = {} for _, child in ipairs(appManager:GetChildren()) do if child:IsA("Frame") then windows[child.Name] = child end end
--------RIGHT DOOR --------
game.Workspace.doorright.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l42.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l51.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l63.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l72.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
-- Local Functions
local function OnFetchConfiguration(callingClient, configToFetch) FetchConfiguration:FireClient(callingClient, configToFetch, Configurations[configToFetch]) end FetchConfiguration.OnServerEvent:connect(OnFetchConfiguration) return Configurations
--TheNexusAvenger --Runs the server-side rocket launcher.
local Tool = script.Parent local Handle = Tool:WaitForChild("Handle") local EquipSound = Handle:WaitForChild("EquipSound") local ReloadSound = Handle:WaitForChild("ReloadSound") local Resources = require(script.Parent:WaitForChild("Resources")) local RocketCreator = require(Resources:GetResource("RocketCreator")) local BufferCreator = require(Resources:GetResource("BufferCreator")) local RemoteEventCreator = require(Resources:GetResource("RemoteEventCreator")) local Configuration = require(Resources:GetResource("Configuration")) local ROCKET_RELOAD_TIME = Configuration.ROCKET_RELOAD_TIME local RocketBuffer = BufferCreator:CreateServerBuffer("RocketBuffer") local FireRocketEvent = RemoteEventCreator:CreateRemoteEvent("FireRocket") local CurrentPlayer,CurrentCharacter local CurrentHandRocket,CurrentRocket local Equipped = false local ToolEnabled = true
-- rbxthumb://type=Asset&id=00000000&w=420&h=420 -- use 150x150 for less memory
local function makeButton(v) local button; button = Button.new({ Name = v.Name, Icon = "rbxthumb://type=Asset&id=" .. v.Id .. "&w=150&h=150", AssetId = v.Id, ActivatedCallback = function(inputObject) remoteEvent:FireServer("wear", v.Id) end, DetailsCallback = function(inputObject) purchasePrompt:Prompt(v.Id) end, }) button:SetSelected(isWearing(v.Id)) button:Parent(scrollingFrame) return button end
-- Management of which options appear on the Roblox User Settings screen
do local PlayerScripts = Players.LocalPlayer:WaitForChild("PlayerScripts") PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Default) PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Follow) PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Classic) PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Default) PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Follow) PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Classic) PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.CameraToggle) end function CameraModule.new() local self = setmetatable({},CameraModule) -- Current active controller instances self.activeCameraController = nil self.activeOcclusionModule = nil self.activeTransparencyController = nil self.activeMouseLockController = nil self.currentComputerCameraMovementMode = nil -- Connections to events self.cameraSubjectChangedConn = nil self.cameraTypeChangedConn = nil -- Adds CharacterAdded and CharacterRemoving event handlers for all current players for _,player in pairs(Players:GetPlayers()) do self:OnPlayerAdded(player) end -- Adds CharacterAdded and CharacterRemoving event handlers for all players who join in the future Players.PlayerAdded:Connect(function(player) self:OnPlayerAdded(player) end) self.activeTransparencyController = TransparencyController.new() self.activeTransparencyController:Enable(true) if not UserInputService.TouchEnabled then self.activeMouseLockController = MouseLockController.new() local toggleEvent = self.activeMouseLockController:GetBindableToggleEvent() if toggleEvent then toggleEvent:Connect(function() self:OnMouseLockToggled() end) end end self:ActivateCameraController(self:GetCameraControlChoice()) self:ActivateOcclusionModule(Players.LocalPlayer.DevCameraOcclusionMode) self:OnCurrentCameraChanged() -- Does initializations and makes first camera controller RunService:BindToRenderStep("cameraRenderUpdate", Enum.RenderPriority.Camera.Value, function(dt) self:Update(dt) end) -- Connect listeners to camera-related properties for _, propertyName in pairs(PLAYER_CAMERA_PROPERTIES) do Players.LocalPlayer:GetPropertyChangedSignal(propertyName):Connect(function() self:OnLocalPlayerCameraPropertyChanged(propertyName) end) end for _, propertyName in pairs(USER_GAME_SETTINGS_PROPERTIES) do UserGameSettings:GetPropertyChangedSignal(propertyName):Connect(function() self:OnUserGameSettingsPropertyChanged(propertyName) end) end game.Workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function() self:OnCurrentCameraChanged() end) return self end function CameraModule:GetCameraMovementModeFromSettings() local cameraMode = Players.LocalPlayer.CameraMode -- Lock First Person trumps all other settings and forces ClassicCamera if cameraMode == Enum.CameraMode.LockFirstPerson then return CameraUtils.ConvertCameraModeEnumToStandard(Enum.ComputerCameraMovementMode.Classic) end local devMode, userMode if UserInputService.TouchEnabled then devMode = CameraUtils.ConvertCameraModeEnumToStandard(Players.LocalPlayer.DevTouchCameraMode) userMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.TouchCameraMovementMode) else devMode = CameraUtils.ConvertCameraModeEnumToStandard(Players.LocalPlayer.DevComputerCameraMode) userMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode) end if devMode == Enum.DevComputerCameraMovementMode.UserChoice then -- Developer is allowing user choice, so user setting is respected return userMode end return devMode end function CameraModule:ActivateOcclusionModule(occlusionMode: Enum.DevCameraOcclusionMode) local newModuleCreator if occlusionMode == Enum.DevCameraOcclusionMode.Zoom then newModuleCreator = Poppercam elseif occlusionMode == Enum.DevCameraOcclusionMode.Invisicam then newModuleCreator = Invisicam else warn("CameraScript ActivateOcclusionModule called with unsupported mode") return end self.occlusionMode = occlusionMode -- First check to see if there is actually a change. If the module being requested is already -- the currently-active solution then just make sure it's enabled and exit early if self.activeOcclusionModule and self.activeOcclusionModule:GetOcclusionMode() == occlusionMode then if not self.activeOcclusionModule:GetEnabled() then self.activeOcclusionModule:Enable(true) end return end -- Save a reference to the current active module (may be nil) so that we can disable it if -- we are successful in activating its replacement local prevOcclusionModule = self.activeOcclusionModule -- If there is no active module, see if the one we need has already been instantiated self.activeOcclusionModule = instantiatedOcclusionModules[newModuleCreator] -- If the module was not already instantiated and selected above, instantiate it if not self.activeOcclusionModule then self.activeOcclusionModule = newModuleCreator.new() if self.activeOcclusionModule then instantiatedOcclusionModules[newModuleCreator] = self.activeOcclusionModule end end -- If we were successful in either selecting or instantiating the module, -- enable it if it's not already the currently-active enabled module if self.activeOcclusionModule then local newModuleOcclusionMode = self.activeOcclusionModule:GetOcclusionMode() -- Sanity check that the module we selected or instantiated actually supports the desired occlusionMode if newModuleOcclusionMode ~= occlusionMode then warn("CameraScript ActivateOcclusionModule mismatch: ",self.activeOcclusionModule:GetOcclusionMode(),"~=",occlusionMode) end -- Deactivate current module if there is one if prevOcclusionModule then -- Sanity check that current module is not being replaced by itself (that should have been handled above) if prevOcclusionModule ~= self.activeOcclusionModule then prevOcclusionModule:Enable(false) else warn("CameraScript ActivateOcclusionModule failure to detect already running correct module") end end -- Occlusion modules need to be initialized with information about characters and cameraSubject -- Invisicam needs the LocalPlayer's character -- Poppercam needs all player characters and the camera subject if occlusionMode == Enum.DevCameraOcclusionMode.Invisicam then -- Optimization to only send Invisicam what we know it needs if Players.LocalPlayer.Character then self.activeOcclusionModule:CharacterAdded(Players.LocalPlayer.Character, Players.LocalPlayer ) end else -- When Poppercam is enabled, we send it all existing player characters for its raycast ignore list for _, player in pairs(Players:GetPlayers()) do if player and player.Character then self.activeOcclusionModule:CharacterAdded(player.Character, player) end end self.activeOcclusionModule:OnCameraSubjectChanged((game.Workspace.CurrentCamera :: Camera).CameraSubject) end -- Activate new choice self.activeOcclusionModule:Enable(true) end end function CameraModule:ShouldUseVehicleCamera() local camera = workspace.CurrentCamera if not camera then return false end local cameraType = camera.CameraType local cameraSubject = camera.CameraSubject local isEligibleType = cameraType == Enum.CameraType.Custom or cameraType == Enum.CameraType.Follow local isEligibleSubject = cameraSubject and cameraSubject:IsA("VehicleSeat") or false local isEligibleOcclusionMode = self.occlusionMode ~= Enum.DevCameraOcclusionMode.Invisicam return isEligibleSubject and isEligibleType and isEligibleOcclusionMode end
--[[Brakes]]
Tune.ABSEnabled = true -- Implements ABS Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS) Tune.FBrakeForce = 2500 -- Front brake force Tune.RBrakeForce = 1500 -- Rear brake force Tune.PBrakeForce = 5000 -- Handbrake force Tune.FLgcyBForce = 15000 -- Front brake force [PGS OFF] Tune.RLgcyBForce = 10000 -- Rear brake force [PGS OFF] Tune.LgcyPBForce = 25000 -- Handbrake force [PGS OFF]
--[[Driver Handling]]
--Driver Sit car.DriveSeat.ChildAdded:connect(function(child) if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then --Distribute Client Interface local p=game.Players:GetPlayerFromCharacter(child.Part1.Parent) car.DriveSeat:SetNetworkOwner(p) local g=script.Parent["A-Chassis Interface"]:Clone() g.Parent=p.PlayerGui end end) --Driver Leave car.DriveSeat.ChildRemoved:connect(function(child) if child.Name=="SeatWeld" and child:IsA("Weld") then --Remove Flip Force if car.DriveSeat:FindFirstChild("Flip")~=nil then car.DriveSeat.Flip.MaxTorque = Vector3.new() end --Remove Wheel Force for i,v in pairs(car.Wheels:GetChildren()) do if v:FindFirstChild("#AV")~=nil then if v["#AV"]:IsA("BodyAngularVelocity") then if v["#AV"].AngularVelocity.Magnitude>0 then v["#AV"].AngularVelocity = Vector3.new() v["#AV"].MaxTorque = Vector3.new() end else if v["#AV"].AngularVelocity>0 then v["#AV"].AngularVelocity = 0 v["#AV"].MotorMaxTorque = 0 end end end end end end)
-----------------------
if f2==1 then f2=0 local b=script.b:Clone() b.Parent=script.Parent.PS.bu b.Position=UDim2.new(0,po2.X,0,po2.Y+6) b.BackgroundColor3=p2.BackgroundColor3 b.inf.Value=Vector3.new(-1,y2) end if z2==0 and s2==0 then po2=po2+Vector3.new(x2,y2)/3 end po2=po2.X<44 and Vector3.new(44,po2.Y)or po2 po2=po2.X>68 and Vector3.new(68,po2.Y)or po2 po2=po2.Y<0 and Vector3.new(po2.X,0)or po2 po2=po2.Y>25 and Vector3.new(po2.X,25)or po2 p2.Position=UDim2.new(0,po2.X,0,po2.Y) local fr1,fr2='b' if s2==1 then fr1='k'fr2='k' elseif z2==1 then fr1='b2' fr2=y2==0 and's1'or y2==1 and's3'or's2' elseif math.abs(x2)+math.abs(y2)>0 then fr1='b' fr2=math.sin(tick()*8)>0 and'l1'or'l2' else fr1='b' fr2='l2' end for _,v in pairs(p2:GetChildren())do if v.Name==fr1 or v.Name==fr2 then v.Visible=true else v.Visible=false end end
--//Value Info//--
script.Assets.Screen.StockUI.VehicleName.Text = VehicleName vholder = Instance.new("Folder") vholder.Name = "Storage" vholder.Parent = script.Assets.Screen vexternal = Instance.new("Folder") vexternal.Name = "Storage" vexternal.Parent = script.Parent vname = Instance.new("StringValue") vname.Parent = vholder vname.Name = "CarName" vname.Value = VehicleName vhorsepower = Instance.new("NumberValue") vhorsepower.Parent = vholder vhorsepower.Name = "EngineHorsepower" vhorsepower.Value = Horsepower vdisplacement = Instance.new("NumberValue") vdisplacement.Parent = vholder vdisplacement.Name = "EngineDisplacement" vdisplacement.Value = EngineDisplacement vtirefl = Instance.new("NumberValue", vexternal) vtirefl.Value = 0.59999999999999998 vtirefl.Name = "HeatFL" vtirefr = Instance.new("NumberValue", vexternal) vtirefr.Value = 0.59999999999999998 vtirefr.Name = "HeatFR" vtirerl = Instance.new("NumberValue", vexternal) vtirerl.Value = 0.59999999999999998 vtirerl.Name = "HeatRL" vtirerr = Instance.new("NumberValue", vexternal) vtirerr.Value = 0.59999999999999998 vtirerr.Name = "HeatRR" venginetype = Instance.new("StringValue") venginetype.Parent = vholder venginetype.Name = "EngineType" venginetype.Value = EngineType vforcedinduction = Instance.new("StringValue") vforcedinduction.Parent = vholder vforcedinduction.Name = "InductionType" vforcedinduction.Value = ForcedInduction vinduction = Instance.new("NumberValue") vinduction.Parent = vholder vinduction.Name = "TurboSize" if ForcedInduction == "Natural" then vinduction = 0 else vinduction.Value = InductionPartSize end vdrivetrain = Instance.new("StringValue") vdrivetrain.Parent = vholder vdrivetrain.Name = "Drivetrain" vdrivetrain.Value = Drivetrain vtorquesplit = Instance.new("NumberValue") vtorquesplit.Parent = vexternal vtorquesplit.Name = "TorqueSplit" vtorquesplit.Value = TorqueSplit vdff = Instance.new("NumberValue") vdff.Parent = vexternal vdff.Name = "DownforceF" vdff.Value = DownforceF vdfr = Instance.new("NumberValue") vdfr.Parent = vexternal vdfr.Name = "DownforceR" vdfr.Value = DownforceR vFdifferential = Instance.new("NumberValue") vFdifferential.Parent = vholder vFdifferential.Name = "FDifferential" vFdifferential.Value = DifferentialF vRdifferential = Instance.new("NumberValue") vRdifferential.Parent = vholder vRdifferential.Name = "RDifferential" vRdifferential.Value = DifferentialR vgears = Instance.new("NumberValue") vgears.Parent = vholder vgears.Name = "AmountOfGears" if EngineType == "Electric" or TransmissionType == "CVT" then vgears.Value = 1 else vgears.Value = AmountOfGears end vautoflip = Instance.new("BoolValue") vautoflip.Parent = vholder vautoflip.Name = "Autoflip" vautoflip.Value = AUTO_FLIP vdecay = Instance.new("NumberValue") vdecay.Parent = vholder vdecay.Name = "RPMDecay" vdecay.Value = RevDecay vtrans = Instance.new("StringValue") vtrans.Parent = vholder vtrans.Name = "TransmissionType" vtrans.Value = TransmissionType vmanual = Instance.new("BoolValue") vmanual.Parent = vholder vmanual.Name = "ManualOnly" vmanual.Value = ManualOnly vautoclutch = Instance.new("BoolValue") vautoclutch.Parent = vholder vautoclutch.Name = "AutoClutch" vmode = Instance.new("StringValue") vmode.Parent = vexternal vmode.Value = Mode vmode.Name = "Mode" if TransmissionType == "HPattern" then vautoclutch.Value = false else vautoclutch.Value = true end vclutch = Instance.new("BoolValue") vclutch.Parent = vholder vclutch.Name = "Clutch" vclutch.Value = true vclutch2 = Instance.new("NumberValue") vclutch2.Parent = vclutch vclutch2.Name = "Clutch" vclutch2.Value = 1 vbrakebias = Instance.new("NumberValue") vbrakebias.Parent = vexternal vbrakebias.Name = "BrakeBias" vbrakebias.Value = BrakeBias vbrakepower = Instance.new("NumberValue") vbrakepower.Parent = vexternal vbrakepower.Name = "BrakePower" vbrakepower.Value = BrakePower vabs = Instance.new("BoolValue") vabs.Parent = vexternal vabs.Name = "ABS" vabs.Value = ABS vtc = Instance.new("BoolValue") vtc.Parent = vexternal vtc.Name = "TC" vtc.Value = TC vasc = Instance.new("BoolValue") vasc.Parent = vexternal vasc.Name = "ASC" vasc.Value = ActiveStabilityControl vhb = Instance.new("BoolValue") vhb.Parent = vexternal vhb.Name = "Handbrake" vhb.Value = false vChb = Instance.new("BoolValue") vChb.Parent = vhb vChb.Name = "Computer" vChb.Value = false vUhb = Instance.new("BoolValue") vUhb.Parent = vhb vUhb.Name = "User" vUhb.Value = false vsteeringlock = Instance.new("NumberValue") vsteeringlock.Parent = vexternal vsteeringlock.Name = "SteeringAngle" vsteeringlock.Value = SteeringAngle vtirefront = Instance.new("NumberValue") vtirefront.Parent = vholder vtirefront.Name = "TireCompoundFront" vtirefront.Value = TiresFront vtirerear = Instance.new("NumberValue") vtirerear.Parent = vholder vtirerear.Name = "TireCompoundRear" vtirerear.Value = TiresRear vgear1 = Instance.new("NumberValue") vgear1.Parent = vholder vgear1.Name = "Gear1" if EngineType == "Electric" then vgear1.Value = 4 else vgear1.Value = Gear1 end vgear2 = Instance.new("NumberValue") vgear2.Parent = vholder vgear2.Name = "Gear2" vgear2.Value = Gear2 vgear3 = Instance.new("NumberValue") vgear3.Parent = vholder vgear3.Name = "Gear3" vgear3.Value = Gear3 vgear4 = Instance.new("NumberValue") vgear4.Parent = vholder vgear4.Name = "Gear4" vgear4.Value = Gear4 vgear5 = Instance.new("NumberValue") vgear5.Parent = vholder vgear5.Name = "Gear5" vgear5.Value = Gear5 vgear6 = Instance.new("NumberValue") vgear6.Parent = vholder vgear6.Name = "Gear6" vgear6.Value = Gear6 vgear7 = Instance.new("NumberValue") vgear7.Parent = vholder vgear7.Name = "Gear7" vgear7.Value = Gear7 vgear8 = Instance.new("NumberValue") vgear8.Parent = vholder vgear8.Name = "Gear8" vgear8.Value = Gear8 vfinal = Instance.new("NumberValue") vfinal.Parent = vexternal vfinal.Name = "FinalDrive" vfinal.Value = 6.08 - FinalDrive vidle = Instance.new("NumberValue") vidle.Parent = vholder vidle.Name = "EngineIdle" vidle.Value = EngineIdle+RevDecay vdyno = Instance.new("BoolValue") vdyno.Parent = script.Parent vdyno.Name = "Dyno" vdyno.Value = false vboost = Instance.new("NumberValue") vboost.Parent = vholder vboost.Name = "Boost" vboost.Value = 0 vepitch = Instance.new("NumberValue") vepitch.Parent = script.Assets.Screen vepitch.Name = "ePitch" vepitch.Value = enginePitchAdjust vsteerspeed = Instance.new("NumberValue") vsteerspeed.Parent = vholder vsteerspeed.Name = "SteerSpeed" vsteerspeed.Value = SteerSpeed vipitch = Instance.new("NumberValue") vipitch.Parent = script.Assets.Screen vipitch.Name = "iPitch" vipitch.Value = idlePitchAdjust vredline = Instance.new("NumberValue") vredline.Parent = vholder vredline.Name = "EngineRedline" vredline.Value = EngineRedline vmaxl = Instance.new("NumberValue") vmaxl.Parent = vholder vmaxl.Name = "MaxLength" vmaxl.Value = minL vminl = Instance.new("NumberValue") vminl.Parent = vholder vminl.Name = "MinLength" vminl.Value = maxL sturbo = Instance.new("Sound") sturbo.Parent = engine sturbo.Name = "Turbo" sturbo.MaxDistance = 12000 sturbo.EmitterSize = InductionPartSize sturbo.Volume = turbovolume if InductionPartSize ~= 0 then sturbo.SoundId = TurboSound else sturbo.SoundId = 0 end sturbo = Instance.new("NumberValue") sturbo.Parent = engine sturbo.Name = "TurboSV" sturbo.Value = turbovolume ssupercharger = Instance.new("Sound") ssupercharger.Parent = engine ssupercharger.Name = "Supercharger" ssupercharger.MaxDistance = 12000 ssupercharger.EmitterSize = InductionPartSize ssupercharger.Volume = superchargervolume ssupercharger.SoundId = SuperchargerSound sidle = Instance.new("Sound") sidle.Parent = diff sidle.Name = "Idle" sidle.MaxDistance = 12000 sidle.EmitterSize = 3 sidle.Volume = 0 sidle:Play() sidle.Looped = true sengine = Instance.new("Sound") sengine.Parent = diff sengine.Name = "Engine" sengine.MaxDistance = 12000 sengine.EmitterSize = 6 sengine.Volume = 1 sengine:Play() sengine.Looped = true sengine.Volume = 0 sefengine = Instance.new("ReverbSoundEffect") sefengine.DecayTime = 0.3 sefengine.Density = 1 sefengine.Diffusion = 1 sefengine.DryLevel = 3 sefengine.WetLevel = -6 sintake = Instance.new("Sound") sintake.Parent = engine sintake.Name = "Intake" sintake.MaxDistance = 4000 sintake.EmitterSize = 2 sintake:Play() sintake.Looped = true sintake.Volume = 1 sintake.Pitch = 0 if EngineType == "Electric" then sengine.SoundId = "http://www.roblox.com/asset/?id=359277436" IdleSound = "http://www.roblox.com/asset/?id=359277436" sidle.SoundId = "http://www.roblox.com/asset/?id=359277436" else sengine.SoundId = EngineSound sintake.SoundId = "http://www.roblox.com/asset/?id=255444016" sidle.SoundId = IdleSound end shorn = Instance.new("Sound") shorn.Parent = script.Parent shorn.Name = "Horn" shorn.MaxDistance = 12000 shorn.EmitterSize = 8 shorn.Volume = hornvolume shorn.SoundId = HornSound swind = Instance.new("Sound") swind.Parent = script.Parent swind.Name = "Wind" swind.MaxDistance = 12000 swind.EmitterSize = 4 swind.Volume = 0 swind.Pitch = 1 swind.Looped = true swind.SoundId = "http://www.roblox.com/asset/?id=188608071" sbsqueal = Instance.new("Sound") sbsqueal.Parent = diff sbsqueal.Name = "Brakes" sbsqueal.MaxDistance = 12000 sbsqueal.EmitterSize = 2 sbsqueal.Volume = 0 sbsqueal.Pitch = 0 sbsqueal.Looped = true sbsqueal.SoundId = "http://www.roblox.com/asset/?id=185857550" sblow = Instance.new("Sound") sblow.Parent = engine sblow.Name = "Blowoff" sblow.MaxDistance = 12000 sblow.EmitterSize = 5 sblow.Volume = 0 sblow.Pitch = 0.8 sblow.Looped = false sblow.SoundId = "http://www.roblox.com/asset/?id=208085141" sstartup = Instance.new("Sound") sstartup.Parent = engine sstartup.Name = "Startup" sstartup.MaxDistance = 1000 sstartup.EmitterSize = 13 sstartup.Volume = startupvolume if EngineType == "Electric" then sstartup.SoundId = "http://www.roblox.com/asset/?id=402899121" sstartup.Pitch = 2 else sstartup.SoundId = StartupSound sstartup.Pitch = 1.1 efstartup = Instance.new("FlangeSoundEffect") efstartup.Parent = sstartup ef2startup = Instance.new("DistortionSoundEffect") efstartup.Parent = sstartup ef2startup.Level = 0.25 end sradio = Instance.new("Sound") sradio.Parent = script.Parent sradio.Name = "Radio" sradio.MaxDistance = 400 sradio.EmitterSize = 1 sradio.Volume = 0.4 sspool = Instance.new("Sound") sspool.Parent = engine sspool.Name = "Spool" sspool.Pitch = 0 if ForcedInduction == "Supercharger" then sspool.SoundId = SuperchargerSound else sspool.SoundId = "rbxassetid://234458445" end sspool.MaxDistance = 12000 sspool.EmitterSize = 2 sspool.Looped = true sreverse = Instance.new("Sound") sreverse.Parent = trans sreverse.Name = "Reverse" sreverse.SoundId = SuperchargerSound sreverse.MaxDistance = 12000 sreverse.EmitterSize = 1 sreverse.Pitch = 0 sreverse.Looped = true veaj = Instance.new("NumberValue") veaj.Parent = diff veaj.Name = "adjuster" veaj.Value = enginevolume vstartuplength = Instance.new("NumberValue") vstartuplength.Parent = vholder vstartuplength.Name = "startuplength" vstartuplength.Value = startuplength vrideheightf = Instance.new("NumberValue") vrideheightf.Parent = vexternal vrideheightf.Name = "FrontRideHeight" vrideheightf.Value = RideHeightFront vrideheightr = Instance.new("NumberValue") vrideheightr.Parent = vexternal vrideheightr.Name = "RearRideHeight" vrideheightr.Value = RideHeightRear vstifff = Instance.new("NumberValue") vstifff.Parent = vexternal vstifff.Name = "FrontStiffness" vstifff.Value = StiffnessFront vmode = Instance.new("BoolValue") vmode.Parent = vexternal vmode.Name = "Automatic" if TransmissionType ~= "HPattern" and TransmissionType ~= "CVT" then vmode.Value = true else vmode.Value = false end vstiffr = Instance.new("NumberValue") vstiffr.Parent = vexternal vstiffr.Name = "RearStiffness" vstiffr.Value = StiffnessRear vrollf = Instance.new("NumberValue") vrollf.Parent = vexternal vrollf.Name = "AntirollFront" vrollf.Value = AntiRollFront vrollr = Instance.new("NumberValue") vrollr.Parent = vexternal vrollr.Name = "AntirollRear" vrollr.Value = AntiRollRear vcamberf = Instance.new("NumberValue") vcamberf.Parent = vexternal vcamberf.Name = "CamberFront" vcamberf.Value = CamberFront vcamberr = Instance.new("NumberValue") vcamberr.Parent = vexternal vcamberr.Name = "CamberRear" vcamberr.Value = CamberRear venginerpm = Instance.new("NumberValue") venginerpm.Parent = vholder venginerpm.Name = "EngineRPM" vgearboxrpm = Instance.new("NumberValue") vgearboxrpm.Parent = vholder vgearboxrpm.Name = "GearboxRPM" vlimiter = Instance.new("NumberValue") vlimiter.Parent = vholder vlimiter.Name = "Limiter" if ElectronicallyLimited == true then vlimiter.Value = LimitSpeedValue else vlimiter.Value = 1000000 end vrpm = Instance.new("NumberValue") vrpm.Parent = vholder vrpm.Name = "RPM" vthrottle = Instance.new("NumberValue") vthrottle.Parent = vholder vthrottle.Name = "Throttle" currentgear = Instance.new("NumberValue") currentgear.Parent = vholder currentgear.Name = "CurrentGear" if TransmissionType == "HPattern" then currentgear.Value = 3 else currentgear.Value = 1 end vsteer = Instance.new("NumberValue") vsteer.Parent = vholder vsteer.Name = "Steer" vbrake = Instance.new("NumberValue") vbrake.Parent = vholder vbrake.Name = "Brake"
--Make NPC jump
local function setJumpState(self) pcall(function() if self._humanoid:GetState() ~= Enum.HumanoidStateType.Jumping and self._humanoid:GetState() ~= Enum.HumanoidStateType.Freefall then self._humanoid:ChangeState(Enum.HumanoidStateType.Jumping) end end) end
-- The maximum distance the can can shoot, this value should never go above 1000
local Range = 400
-- Decompiled with the Synapse X Luau decompiler.
script.Parent.MouseButton1Click:connect(function() script.Parent.Parent.Parent.Radio:FireServer(script.Parent.Parent.id.Text, script.Parent.Parent.vol.Text, script.Parent.Parent.pitch.Text); end);
----------------- --| Constants |-- -----------------
local BLAST_RADIUS = 333 local BLAST_PRESSURE = 7500000
--[[ Function called when leaving the state ]]
function PlayerCamera.onLeave(stateMachine, serverPlayer, event, from, to) for _, connection in pairs(connections) do connection:Disconnect() end end return PlayerCamera
-- Captions
local captionContainer = Instance.new("Frame") captionContainer.Name = "CaptionContainer" captionContainer.BackgroundTransparency = 1 captionContainer.AnchorPoint = Vector2.new(0, 0) captionContainer.ClipsDescendants = true captionContainer.ZIndex = 30 captionContainer.Visible = true captionContainer.Parent = iconContainer captionContainer.Active = false local captionFrame = Instance.new("Frame") captionFrame.Name = "CaptionFrame" captionFrame.BorderSizePixel = 0 captionFrame.AnchorPoint = Vector2.new(0.5,0.5) captionFrame.Position = UDim2.new(0.5,0,0.5,0) captionFrame.Size = UDim2.new(1,0,1,0) captionFrame.ZIndex = 31 captionFrame.Parent = captionContainer captionFrame.Active = false local captionLabel = Instance.new("TextLabel") captionLabel.Name = "CaptionLabel" captionLabel.BackgroundTransparency = 1 captionLabel.AnchorPoint = Vector2.new(0.5,0.5) captionLabel.Position = UDim2.new(0.5,0,0.56,0) captionLabel.TextXAlignment = Enum.TextXAlignment.Center captionLabel.RichText = true captionLabel.ZIndex = 32 captionLabel.Parent = captionContainer captionLabel.Active = false local captionCorner = Instance.new("UICorner") captionCorner.Name = "CaptionCorner" captionCorner.Parent = captionFrame local captionOverlineContainer = Instance.new("Frame") captionOverlineContainer.Name = "CaptionOverlineContainer" captionOverlineContainer.BackgroundTransparency = 1 captionOverlineContainer.AnchorPoint = Vector2.new(0.5,0.5) captionOverlineContainer.Position = UDim2.new(0.5,0,-0.5,3) captionOverlineContainer.Size = UDim2.new(1,0,1,0) captionOverlineContainer.ZIndex = 33 captionOverlineContainer.ClipsDescendants = true captionOverlineContainer.Parent = captionContainer captionOverlineContainer.Active = false local captionOverline = Instance.new("Frame") captionOverline.Name = "CaptionOverline" captionOverline.AnchorPoint = Vector2.new(0.5,0.5) captionOverline.Position = UDim2.new(0.5,0,1.5,-3) captionOverline.Size = UDim2.new(1,0,1,0) captionOverline.ZIndex = 34 captionOverline.Parent = captionOverlineContainer captionOverline.Active = false local captionOverlineCorner = captionCorner:Clone() captionOverlineCorner.Name = "CaptionOverlineCorner" captionOverlineCorner.Parent = captionOverline local captionVisibilityBlocker = captionFrame:Clone() captionVisibilityBlocker.Name = "CaptionVisibilityBlocker" captionVisibilityBlocker.BackgroundTransparency = 1 captionVisibilityBlocker.BackgroundColor3 = Color3.fromRGB(50, 50, 50) captionVisibilityBlocker.ZIndex -= 1 captionVisibilityBlocker.Parent = captionFrame captionVisibilityBlocker.Active = false local captionVisibilityCorner = captionVisibilityBlocker.CaptionCorner captionVisibilityCorner.Name = "CaptionVisibilityCorner"
--------------------------------------------------------------------
if brakewhistle == true then mouse.KeyDown:connect(function(key) if key == camkey and enabled == false then local seat = car.DriveSeat local effect = script.soundeffect:Clone() effect.Name = "soundeffectCop" effect.Parent = seat.Brakes elseif key == camkey and enabled == true then local seat = car.DriveSeat seat.Brakes.soundeffectCop:Destroy() end car.DriveSeat.ChildRemoved:Connect(function(child) if child.Name == "SeatWeld" then local seat = car.DriveSeat seat.Brakes.soundeffectCop:Destroy() end end) end) end
-- CONSTRUCTORS
function Icon.new() local self = {} setmetatable(self, Icon) -- Maids (for autocleanup) local maid = Maid.new() self._maid = maid self._hoveringMaid = maid:give(Maid.new()) self._dropdownClippingMaid = maid:give(Maid.new()) self._menuClippingMaid = maid:give(Maid.new()) -- These are the GuiObjects that make up the icon local instances = {} self.instances = instances local iconContainer = maid:give(iconTemplate:Clone()) iconContainer.Visible = true iconContainer.Parent = topbarContainer instances["iconContainer"] = iconContainer instances["iconButton"] = iconContainer.IconButton instances["iconImage"] = instances.iconButton.IconImage instances["iconLabel"] = instances.iconButton.IconLabel instances["iconGradient"] = instances.iconButton.IconGradient instances["iconCorner"] = instances.iconButton.IconCorner instances["iconOverlay"] = iconContainer.IconOverlay instances["iconOverlayCorner"] = instances.iconOverlay.IconOverlayCorner instances["noticeFrame"] = instances.iconButton.NoticeFrame instances["noticeLabel"] = instances.noticeFrame.NoticeLabel instances["captionContainer"] = iconContainer.CaptionContainer instances["captionFrame"] = instances.captionContainer.CaptionFrame instances["captionLabel"] = instances.captionContainer.CaptionLabel instances["captionCorner"] = instances.captionFrame.CaptionCorner instances["captionOverlineContainer"] = instances.captionContainer.CaptionOverlineContainer instances["captionOverline"] = instances.captionOverlineContainer.CaptionOverline instances["captionOverlineCorner"] = instances.captionOverline.CaptionOverlineCorner instances["captionVisibilityBlocker"] = instances.captionFrame.CaptionVisibilityBlocker instances["captionVisibilityCorner"] = instances.captionVisibilityBlocker.CaptionVisibilityCorner instances["tipFrame"] = iconContainer.TipFrame instances["tipLabel"] = instances.tipFrame.TipLabel instances["tipCorner"] = instances.tipFrame.TipCorner instances["dropdownContainer"] = iconContainer.DropdownContainer instances["dropdownFrame"] = instances.dropdownContainer.DropdownFrame instances["dropdownList"] = instances.dropdownFrame.DropdownList instances["menuContainer"] = iconContainer.MenuContainer instances["menuFrame"] = instances.menuContainer.MenuFrame instances["menuList"] = instances.menuFrame.MenuList instances["clickSound"] = iconContainer.ClickSound -- These determine and describe how instances behave and appear self._settings = { action = { ["toggleTransitionInfo"] = {}, ["resizeInfo"] = {}, ["repositionInfo"] = {}, ["captionFadeInfo"] = {}, ["tipFadeInfo"] = {}, ["dropdownSlideInfo"] = {}, ["menuSlideInfo"] = {}, }, toggleable = { ["iconBackgroundColor"] = {instanceNames = {"iconButton"}, propertyName = "BackgroundColor3"}, ["iconBackgroundTransparency"] = {instanceNames = {"iconButton"}, propertyName = "BackgroundTransparency"}, ["iconCornerRadius"] = {instanceNames = {"iconCorner", "iconOverlayCorner"}, propertyName = "CornerRadius"}, ["iconGradientColor"] = {instanceNames = {"iconGradient"}, propertyName = "Color"}, ["iconGradientRotation"] = {instanceNames = {"iconGradient"}, propertyName = "Rotation"}, ["iconImage"] = {callMethods = {self._updateIconSize}, instanceNames = {"iconImage"}, propertyName = "Image"}, ["iconImageColor"] = {instanceNames = {"iconImage"}, propertyName = "ImageColor3"}, ["iconImageTransparency"] = {instanceNames = {"iconImage"}, propertyName = "ImageTransparency"}, ["iconScale"] = {instanceNames = {"iconButton"}, propertyName = "Size"}, ["forcedIconSize"] = {}, ["iconSize"] = {callSignals = {self.updated}, callMethods = {self._updateIconSize}, instanceNames = {"iconContainer"}, propertyName = "Size", tweenAction = "resizeInfo"}, ["iconOffset"] = {instanceNames = {"iconButton"}, propertyName = "Position"}, ["iconText"] = {callMethods = {self._updateIconSize}, instanceNames = {"iconLabel"}, propertyName = "Text"}, ["iconTextColor"] = {instanceNames = {"iconLabel"}, propertyName = "TextColor3"}, ["iconFont"] = {instanceNames = {"iconLabel"}, propertyName = "Font"}, ["iconImageYScale"] = {callMethods = {self._updateIconSize}}, ["iconImageRatio"] = {callMethods = {self._updateIconSize}}, ["iconLabelYScale"] = {callMethods = {self._updateIconSize}}, ["noticeCircleColor"] = {instanceNames = {"noticeFrame"}, propertyName = "ImageColor3"}, ["noticeCircleImage"] = {instanceNames = {"noticeFrame"}, propertyName = "Image"}, ["noticeTextColor"] = {instanceNames = {"noticeLabel"}, propertyName = "TextColor3"}, ["noticeImageTransparency"] = {instanceNames = {"noticeFrame"}, propertyName = "ImageTransparency"}, ["noticeTextTransparency"] = {instanceNames = {"noticeLabel"}, propertyName = "TextTransparency"}, ["baseZIndex"] = {callMethods = {self._updateBaseZIndex}}, ["order"] = {callSignals = {self.updated}, instanceNames = {"iconContainer"}, propertyName = "LayoutOrder"}, ["alignment"] = {callSignals = {self.updated}, callMethods = {self._updateDropdown}}, ["iconImageVisible"] = {instanceNames = {"iconImage"}, propertyName = "Visible"}, ["iconImageAnchorPoint"] = {instanceNames = {"iconImage"}, propertyName = "AnchorPoint"}, ["iconImagePosition"] = {instanceNames = {"iconImage"}, propertyName = "Position", tweenAction = "resizeInfo"}, ["iconImageSize"] = {instanceNames = {"iconImage"}, propertyName = "Size", tweenAction = "resizeInfo"}, ["iconImageTextXAlignment"] = {instanceNames = {"iconImage"}, propertyName = "TextXAlignment"}, ["iconLabelVisible"] = {instanceNames = {"iconLabel"}, propertyName = "Visible"}, ["iconLabelAnchorPoint"] = {instanceNames = {"iconLabel"}, propertyName = "AnchorPoint"}, ["iconLabelPosition"] = {instanceNames = {"iconLabel"}, propertyName = "Position", tweenAction = "resizeInfo"}, ["iconLabelSize"] = {instanceNames = {"iconLabel"}, propertyName = "Size", tweenAction = "resizeInfo"}, ["iconLabelTextXAlignment"] = {instanceNames = {"iconLabel"}, propertyName = "TextXAlignment"}, ["iconLabelTextSize"] = {instanceNames = {"iconLabel"}, propertyName = "TextSize"}, ["noticeFramePosition"] = {instanceNames = {"noticeFrame"}, propertyName = "Position"}, ["clickSoundId"] = {instanceNames = {"clickSound"}, propertyName = "SoundId"}, ["clickVolume"] = {instanceNames = {"clickSound"}, propertyName = "Volume"}, ["clickPlaybackSpeed"] = {instanceNames = {"clickSound"}, propertyName = "PlaybackSpeed"}, ["clickTimePosition"] = {instanceNames = {"clickSound"}, propertyName = "TimePosition"}, -- 0_1195 ["iconRectOffset"] = {instanceNames = {"iconImage"}, propertyName = "ImageRectOffset"}, ["iconRectSize"] = {instanceNames = {"iconImage"}, propertyName = "ImageRectSize"}, }, other = { ["captionBackgroundColor"] = {instanceNames = {"captionFrame"}, propertyName = "BackgroundColor3"}, ["captionBackgroundTransparency"] = {instanceNames = {"captionFrame"}, propertyName = "BackgroundTransparency", group = "caption"}, ["captionBlockerTransparency"] = {instanceNames = {"captionVisibilityBlocker"}, propertyName = "BackgroundTransparency", group = "caption"}, ["captionOverlineColor"] = {instanceNames = {"captionOverline"}, propertyName = "BackgroundColor3"}, ["captionOverlineTransparency"] = {instanceNames = {"captionOverline"}, propertyName = "BackgroundTransparency", group = "caption"}, ["captionTextColor"] = {instanceNames = {"captionLabel"}, propertyName = "TextColor3"}, ["captionTextTransparency"] = {instanceNames = {"captionLabel"}, propertyName = "TextTransparency", group = "caption"}, ["captionFont"] = {instanceNames = {"captionLabel"}, propertyName = "Font"}, ["captionCornerRadius"] = {instanceNames = {"captionCorner", "captionOverlineCorner", "captionVisibilityCorner"}, propertyName = "CornerRadius"}, ["tipBackgroundColor"] = {instanceNames = {"tipFrame"}, propertyName = "BackgroundColor3"}, ["tipBackgroundTransparency"] = {instanceNames = {"tipFrame"}, propertyName = "BackgroundTransparency", group = "tip"}, ["tipTextColor"] = {instanceNames = {"tipLabel"}, propertyName = "TextColor3"}, ["tipTextTransparency"] = {instanceNames = {"tipLabel"}, propertyName = "TextTransparency", group = "tip"}, ["tipFont"] = {instanceNames = {"tipLabel"}, propertyName = "Font"}, ["tipCornerRadius"] = {instanceNames = {"tipCorner"}, propertyName = "CornerRadius"}, ["dropdownSize"] = {instanceNames = {"dropdownContainer"}, propertyName = "Size", unique = "dropdown"}, ["dropdownCanvasSize"] = {instanceNames = {"dropdownFrame"}, propertyName = "CanvasSize"}, ["dropdownMaxIconsBeforeScroll"] = {callMethods = {self._updateDropdown}}, ["dropdownMinWidth"] = {callMethods = {self._updateDropdown}}, ["dropdownSquareCorners"] = {callMethods = {self._updateDropdown}}, ["dropdownBindToggleToIcon"] = {}, ["dropdownToggleOnLongPress"] = {}, ["dropdownToggleOnRightClick"] = {}, ["dropdownCloseOnTapAway"] = {}, ["dropdownHidePlayerlistOnOverlap"] = {}, ["dropdownListPadding"] = {callMethods = {self._updateDropdown}, instanceNames = {"dropdownList"}, propertyName = "Padding"}, ["dropdownAlignment"] = {callMethods = {self._updateDropdown}}, ["dropdownScrollBarColor"] = {instanceNames = {"dropdownFrame"}, propertyName = "ScrollBarImageColor3"}, ["dropdownScrollBarTransparency"] = {instanceNames = {"dropdownFrame"}, propertyName = "ScrollBarImageTransparency"}, ["dropdownScrollBarThickness"] = {instanceNames = {"dropdownFrame"}, propertyName = "ScrollBarThickness"}, ["dropdownIgnoreClipping"] = {callMethods = {self._dropdownIgnoreClipping}}, ["menuSize"] = {instanceNames = {"menuContainer"}, propertyName = "Size", unique = "menu"}, ["menuCanvasSize"] = {instanceNames = {"menuFrame"}, propertyName = "CanvasSize"}, ["menuMaxIconsBeforeScroll"] = {callMethods = {self._updateMenu}}, ["menuBindToggleToIcon"] = {}, ["menuToggleOnLongPress"] = {}, ["menuToggleOnRightClick"] = {}, ["menuCloseOnTapAway"] = {}, ["menuListPadding"] = {callMethods = {self._updateMenu}, instanceNames = {"menuList"}, propertyName = "Padding"}, ["menuDirection"] = {callMethods = {self._updateMenu}}, ["menuScrollBarColor"] = {instanceNames = {"menuFrame"}, propertyName = "ScrollBarImageColor3"}, ["menuScrollBarTransparency"] = {instanceNames = {"menuFrame"}, propertyName = "ScrollBarImageTransparency"}, ["menuScrollBarThickness"] = {instanceNames = {"menuFrame"}, propertyName = "ScrollBarThickness"}, ["menuIgnoreClipping"] = {callMethods = {self._menuIgnoreClipping}}, } } --------------------------------- self._groupSettings = {} for _, settingsDetails in pairs(self._settings) do for settingName, settingDetail in pairs(settingsDetails) do local group = settingDetail.group if group then local groupSettings = self._groupSettings[group] if not groupSettings then groupSettings = {} self._groupSettings[group] = groupSettings end table.insert(groupSettings, settingName) settingDetail.forcedGroupValue = DEFAULT_FORCED_GROUP_VALUES[group] settingDetail.useForcedGroupValue = true end end end --------------------------------- -- The setting values themselves will be set within _settings -- Setup a dictionary to make it quick and easy to reference setting by name self._settingsDictionary = {} -- Some instances require unique behaviours. These are defined with the 'unique' key -- for instance, we only want caption transparency effects to be applied on hovering self._uniqueSettings = {} self._uniqueSettingsDictionary = {} self.uniqueValues = {} local uniqueBehaviours = { ["dropdown"] = function(settingName, instance, propertyName, value) local tweenInfo = self:get("dropdownSlideInfo") local bindToggleToIcon = self:get("dropdownBindToggleToIcon") local hidePlayerlist = self:get("dropdownHidePlayerlistOnOverlap") == true and self:get("alignment") == "right" local dropdownContainer = self.instances.dropdownContainer local dropdownFrame = self.instances.dropdownFrame local newValue = value local isOpen = true local isDeselected = not self.isSelected if bindToggleToIcon == false then isDeselected = not self.dropdownOpen end local isSpecialPressing = self._longPressing or self._rightClicking if self._tappingAway or (isDeselected and not isSpecialPressing) or (isSpecialPressing and self.dropdownOpen) then local dropdownSize = self:get("dropdownSize") local XOffset = (dropdownSize and dropdownSize.X.Offset/1) or 0 newValue = UDim2.new(0, XOffset, 0, 0) isOpen = false end if #self.dropdownIcons > 0 and isOpen and hidePlayerlist then if starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList) then starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false) end IconController._bringBackPlayerlist = (IconController._bringBackPlayerlist and IconController._bringBackPlayerlist + 1) or 1 self._bringBackPlayerlist = true elseif self._bringBackPlayerlist and not isOpen and IconController._bringBackPlayerlist then IconController._bringBackPlayerlist -= 1 if IconController._bringBackPlayerlist <= 0 then IconController._bringBackPlayerlist = nil starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true) end self._bringBackPlayerlist = nil end local tween = tweenService:Create(instance, tweenInfo, {[propertyName] = newValue}) local connection connection = tween.Completed:Connect(function() connection:Disconnect() --dropdownContainer.ClipsDescendants = not self.dropdownOpen end) tween:Play() if isOpen then dropdownFrame.CanvasPosition = self._dropdownCanvasPos else self._dropdownCanvasPos = dropdownFrame.CanvasPosition end self.dropdownOpen = isOpen self:_decideToCallSignal("dropdown") end, ["menu"] = function(settingName, instance, propertyName, value) local tweenInfo = self:get("menuSlideInfo") local bindToggleToIcon = self:get("menuBindToggleToIcon") local menuContainer = self.instances.menuContainer local menuFrame = self.instances.menuFrame local newValue = value local isOpen = true local isDeselected = not self.isSelected if bindToggleToIcon == false then isDeselected = not self.menuOpen end local isSpecialPressing = self._longPressing or self._rightClicking if self._tappingAway or (isDeselected and not isSpecialPressing) or (isSpecialPressing and self.menuOpen) then local menuSize = self:get("menuSize") local YOffset = (menuSize and menuSize.Y.Offset/1) or 0 newValue = UDim2.new(0, 0, 0, YOffset) isOpen = false end if isOpen ~= self.menuOpen then self.updated:Fire() end if isOpen and tweenInfo.EasingDirection == Enum.EasingDirection.Out then tweenInfo = TweenInfo.new(tweenInfo.Time, tweenInfo.EasingStyle, Enum.EasingDirection.In) end local tween = tweenService:Create(instance, tweenInfo, {[propertyName] = newValue}) local connection connection = tween.Completed:Connect(function() connection:Disconnect() --menuContainer.ClipsDescendants = not self.menuOpen end) tween:Play() if isOpen then if self._menuCanvasPos then menuFrame.CanvasPosition = self._menuCanvasPos end else self._menuCanvasPos = menuFrame.CanvasPosition end self.menuOpen = isOpen self:_decideToCallSignal("menu") end, } for settingsType, settingsDetails in pairs(self._settings) do for settingName, settingDetail in pairs(settingsDetails) do if settingsType == "toggleable" then settingDetail.values = settingDetail.values or { deselected = nil, selected = nil, } else settingDetail.value = nil end settingDetail.additionalValues = {} settingDetail.type = settingsType self._settingsDictionary[settingName] = settingDetail -- local uniqueCat = settingDetail.unique if uniqueCat then local uniqueCatArray = self._uniqueSettings[uniqueCat] or {} table.insert(uniqueCatArray, settingName) self._uniqueSettings[uniqueCat] = uniqueCatArray self._uniqueSettingsDictionary[settingName] = uniqueBehaviours[uniqueCat] end -- end end -- Signals (events) self.updated = maid:give(Signal.new()) self.selected = maid:give(Signal.new()) self.deselected = maid:give(Signal.new()) self.toggled = maid:give(Signal.new()) self.hoverStarted = maid:give(Signal.new()) self.hoverEnded = maid:give(Signal.new()) self.dropdownOpened = maid:give(Signal.new()) self.dropdownClosed = maid:give(Signal.new()) self.menuOpened = maid:give(Signal.new()) self.menuClosed = maid:give(Signal.new()) self.notified = maid:give(Signal.new()) self._endNotices = maid:give(Signal.new()) self._ignoreClippingChanged = maid:give(Signal.new()) -- Connections -- This enables us to chain icons and features like menus and dropdowns together without them being hidden by parent frame with ClipsDescendants enabled local function setFeatureChange(featureName, value) local parentIcon = self._parentIcon self:set(featureName.."IgnoreClipping", value) if value == true and parentIcon then local connection = parentIcon._ignoreClippingChanged:Connect(function(_, value) self:set(featureName.."IgnoreClipping", value) end) local endConnection endConnection = self[featureName.."Closed"]:Connect(function() endConnection:Disconnect() connection:Disconnect() end) end end self.dropdownOpened:Connect(function() setFeatureChange("dropdown", true) end) self.dropdownClosed:Connect(function() setFeatureChange("dropdown", false) end) self.menuOpened:Connect(function() setFeatureChange("menu", true) end) self.menuClosed:Connect(function() setFeatureChange("menu", false) end) --]] -- Properties self.deselectWhenOtherIconSelected = true self.name = "" self.isSelected = false self.presentOnTopbar = true self.accountForWhenDisabled = false self.enabled = true self.hovering = false self.tipText = nil self.captionText = nil self.totalNotices = 0 self.notices = {} self.dropdownIcons = {} self.menuIcons = {} self.dropdownOpen = false self.menuOpen = false self.locked = false self.topPadding = UDim.new(0, 4) self.targetPosition = nil self.toggleItems = {} self.lockedSettings = {} -- Private Properties self._draggingFinger = false self._updatingIconSize = true self._previousDropdownOpen = false self._previousMenuOpen = false self._bindedToggleKeys = {} self._bindedEvents = {} -- Apply start values self:setName("UnnamedIcon") self:setTheme(DEFAULT_THEME, true) -- Input handlers -- Calls deselect/select when the icon is clicked instances.iconButton.MouseButton1Click:Connect(function() if self._draggingFinger then return false elseif self.isSelected then self:deselect() return true end self:select() end) instances.iconButton.MouseButton2Click:Connect(function() self._rightClicking = true if self:get("dropdownToggleOnRightClick") == true then self:_update("dropdownSize") end if self:get("menuToggleOnRightClick") == true then self:_update("menuSize") end self._rightClicking = false end) -- Shows/hides the dark overlay when the icon is presssed/released instances.iconButton.MouseButton1Down:Connect(function() if self.locked then return end self:_updateStateOverlay(0.7, Color3.new(0, 0, 0)) end) instances.iconButton.MouseButton1Up:Connect(function() if self.locked then return end self:_updateStateOverlay(0.9, Color3.new(1, 1, 1)) end) -- Tap away + KeyCode toggles userInputService.InputBegan:Connect(function(input, touchingAnObject) local validTapAwayInputs = { [Enum.UserInputType.MouseButton1] = true, [Enum.UserInputType.MouseButton2] = true, [Enum.UserInputType.MouseButton3] = true, [Enum.UserInputType.Touch] = true, } if not touchingAnObject and validTapAwayInputs[input.UserInputType] then self._tappingAway = true if self.dropdownOpen and self:get("dropdownCloseOnTapAway") == true then self:_update("dropdownSize") end if self.menuOpen and self:get("menuCloseOnTapAway") == true then self:_update("menuSize") end self._tappingAway = false end -- if self._bindedToggleKeys[input.KeyCode] and not touchingAnObject then if self.isSelected then self:deselect() else self:select() end end -- end) -- hoverStarted and hoverEnded triggers and actions -- these are triggered when a mouse enters/leaves the icon with a mouse, is highlighted with -- a controller selection box, or dragged over with a touchpad self.hoverStarted:Connect(function(x, y) self.hovering = true if not self.locked then self:_updateStateOverlay(0.9, Color3.fromRGB(255, 255, 255)) end self:_updateHovering() end) self.hoverEnded:Connect(function() self.hovering = false self:_updateStateOverlay(1) self._hoveringMaid:clean() self:_updateHovering() end) instances.iconButton.MouseEnter:Connect(function(x, y) -- Mouse (started) self.hoverStarted:Fire(x, y) end) instances.iconButton.MouseLeave:Connect(function() -- Mouse (ended) self.hoverEnded:Fire() end) instances.iconButton.SelectionGained:Connect(function() -- Controller (started) self.hoverStarted:Fire() end) instances.iconButton.SelectionLost:Connect(function() -- Controller (ended) self.hoverEnded:Fire() end) instances.iconButton.MouseButton1Down:Connect(function() -- TouchPad (started) if self._draggingFinger then self.hoverStarted:Fire() end -- Long press check local heartbeatConnection local releaseConnection local longPressTime = 0.7 local endTick = tick() + longPressTime heartbeatConnection = runService.Heartbeat:Connect(function() if tick() >= endTick then releaseConnection:Disconnect() heartbeatConnection:Disconnect() self._longPressing = true if self:get("dropdownToggleOnLongPress") == true then self:_update("dropdownSize") end if self:get("menuToggleOnLongPress") == true then self:_update("menuSize") end self._longPressing = false end end) releaseConnection = instances.iconButton.MouseButton1Up:Connect(function() releaseConnection:Disconnect() heartbeatConnection:Disconnect() end) end) if userInputService.TouchEnabled then instances.iconButton.MouseButton1Up:Connect(function() -- TouchPad (ended), this was originally enabled for non-touchpads too if self.hovering then self.hoverEnded:Fire() end end) -- This is used to highlight when a mobile/touch device is dragging their finger accross the screen -- this is important for determining the hoverStarted and hoverEnded events on mobile local dragCount = 0 userInputService.TouchMoved:Connect(function(touch, touchingAnObject) if touchingAnObject then return end self._draggingFinger = true end) userInputService.TouchEnded:Connect(function() self._draggingFinger = false end) end -- Finish self._updatingIconSize = false self:_updateIconSize() IconController.iconAdded:Fire(self) return self end
--[[ ROBLOX TODO: add default generic param when possible original code: export type RawMatcherFn<T extends MatcherState = MatcherState> = { ]] -- ROBLOX FIXME: add Symbol to the definition: [INTERNAL_MATCHER_FLAG]: boolean?
export type RawMatcherFn<T> = any
--// Wrap
log("Wrap") local service_Wrap = service.Wrap local service_UnWrap = service.UnWrap for i,val in pairs(service) do if type(val) == "userdata" then service[i] = service_Wrap(val, true) end end
-- Core connections
Connections = {}; function ClearConnections() -- Clears and disconnects temporary connections for Index, Connection in pairs(Connections) do Connection:Disconnect(); Connections[Index] = nil; end; end; function InitializeUI() -- Sets up the UI -- Ensure UI has not yet been initialized if UI then return; end; -- Create the root UI UI = Instance.new('ScreenGui') UI.Name = 'Building Tools by F3X (UI)' -- Create dock local ToolList = {} local DockComponent = require(Tool:WaitForChild('UI'):WaitForChild('Dock')) local DockElement = Roact.createElement(DockComponent, { Core = Core; Tools = ToolList; }) local DockHandle = Roact.mount(DockElement, UI, 'Dock') -- Provide API for adding tool buttons to dock local function AddToolButton(IconAssetId, HotkeyLabel, Tool) table.insert(ToolList, { IconAssetId = IconAssetId; HotkeyLabel = HotkeyLabel; Tool = Tool; }) -- Update dock Roact.update(DockHandle, Roact.createElement(DockComponent, { Core = Core; Tools = Cryo.List.join(ToolList); })) end Core.AddToolButton = AddToolButton -- Clean up UI on tool teardown UIMaid = Maid.new() Tool.AncestryChanged:Connect(function (Item, Parent) if Parent == nil then UIMaid:Destroy() end end) end local UIElements = Tool:WaitForChild 'UI' local ExplorerTemplate = require(UIElements:WaitForChild 'Explorer') Core.ExplorerVisibilityChanged = Signal.new() Core.ExplorerVisible = false function ToggleExplorer() if not Core.ExplorerVisible then OpenExplorer() else CloseExplorer() end end function OpenExplorer() -- Ensure explorer not already open if ExplorerHandle then return end -- Initialize explorer Explorer = Roact.createElement(ExplorerTemplate, { Core = getfenv(0), Close = CloseExplorer, Scope = Targeting.Scope }) -- Mount explorer ExplorerHandle = Roact.mount(Explorer, UI, 'Explorer') Core.ExplorerVisible = true -- Unmount explorer on tool cleanup UIMaid.Explorer = Support.Call(Roact.unmount, ExplorerHandle) UIMaid.ExplorerScope = Targeting.ScopeChanged:Connect(function (Scope) local UpdatedProps = Support.Merge({}, Explorer.props, { Scope = Scope }) local UpdatedExplorer = Roact.createElement(ExplorerTemplate, UpdatedProps) ExplorerHandle = Roact.update(ExplorerHandle, UpdatedExplorer) end) -- Fire signal Core.ExplorerVisibilityChanged:Fire() end function CloseExplorer() -- Clean up explorer UIMaid.Explorer = nil UIMaid.ExplorerScope = nil ExplorerHandle = nil Core.ExplorerVisible = false -- Fire signal Core.ExplorerVisibilityChanged:Fire() end
-- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
local anim = animTable[animName][idx].anim -- load it to the humanoid; get AnimationTrack toolAnimTrack = humanoid:LoadAnimation(anim) -- play the animation toolAnimTrack:Play(transitionTime) toolAnimName = animName currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc) end end function stopToolAnimations() local oldAnim = toolAnimName if (currentToolAnimKeyframeHandler ~= nil) then currentToolAnimKeyframeHandler:disconnect() end toolAnimName = "" if (toolAnimTrack ~= nil) then toolAnimTrack:Stop() toolAnimTrack:Destroy() toolAnimTrack = nil end return oldAnim end
--Click/Touch
local cmdBar = main.gui.CmdBar local textBox = cmdBar.SearchFrame.TextBox local arrowKeys = {[Enum.KeyCode.Left] = true, [Enum.KeyCode.Right] = true, [Enum.KeyCode.Up] = true, [Enum.KeyCode.Down] = true} local movementKeys = {[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"} main.movementKeysPressed = {} main.userInputService.InputBegan:Connect(function(input, pressedUI) if (input.UserInputType == clickInput or input.UserInputType == touchInput) and (not pressedUI or frameDragging) and not main.mouseDown then main.mouseDown = true checkPressFunctions(input.Position) elseif not main.chatting or (cmdBar.Visible and #textBox.Text < 2) then local direction = movementKeys[input.KeyCode] if direction then table.insert(main.movementKeysPressed, direction) elseif input.KeyCode == Enum.KeyCode.E then 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 elseif input.KeyCode == Enum.KeyCode.Quote or input.KeyCode == Enum.KeyCode.Semicolon then main:GetModule("CmdBar"):ToggleBar(input.KeyCode) end end if arrowKeys[input.KeyCode] then main:GetModule("CmdBar"):PressedArrowKey(input.KeyCode) end end) main.userInputService.InputEnded:Connect(function(input, pressedUI) local direction = movementKeys[input.KeyCode] if input.UserInputType == clickInput or input.UserInputType == touchInput then main.mouseDown = false elseif direction then for i,v in pairs(main.movementKeysPressed) do if v == direction then table.remove(main.movementKeysPressed,i) end end end end)
-- Connection class
local Connection = {} Connection.__index = Connection function Connection.new(signal, fn) return setmetatable({ _connected = true, _signal = signal, _fn = fn, _next = false, }, Connection) end function Connection:Disconnect() self._connected = false -- Unhook the node, but DON'T clear it. That way any fire calls that are -- currently sitting on this node will be able to iterate forwards off of -- it, but any subsequent fire calls will not hit it, and it will be GCed -- when no more fire calls are sitting on it. if self._signal._handlerListHead == self then self._signal._handlerListHead = self._next else local prev = self._signal._handlerListHead while prev and prev._next ~= self do prev = prev._next end if prev then prev._next = self._next end end end Connection.Destroy = Connection.Disconnect
--[[Manage Plugins]]
script.Parent["A-Chassis Interface"].Car.Value=car for i,v in pairs(script.Parent.Plugins:GetChildren()) do for _,a in pairs(v:GetDescendants()) do if a:IsA("RemoteEvent") or a:IsA("RemoteFunction") then a.Parent=car for _,b in pairs(a:GetChildren()) do if b:IsA("Script") then b.Disabled=false end end end end v.Parent = script.Parent["A-Chassis Interface"] end script.Parent.Plugins:Destroy()
--/////////////////////////////////////////////////////////--
local dZIndex = 2 local dScrollBar = 4 local dBackground = Color3.new(31/255, 31/255, 31/255) local dTransparency = 0 local dPixelSize = 0 local dBorder = Color3.new(27/255,42/255,53/255) local dPosition = UDim2.new(0,5,0,5) local dCanvasSize = UDim2.new(0, 0, 0, 0) local dScrollImage = "http://roblox.com/asset?id=158348114" local dTextColor = Color3.new(1,1,1) local dSize = UDim2.new(1,-10,1,-10) local dFont = "Gotham" local dTextSize = 15 local dPlaceholderColor = Color3.fromRGB(178, 178, 178) local MouseIcons = { Horizontal = "rbxassetid://1243146213"; Vertical = "rbxassetid://1243145985"; LeftCorner = "rbxassetid://1243145459"; RightCorner = "rbxassetid://1243145350"; TopRight = "rbxassetid://1243145459"; TopLeft = "rbxassetid://1243145350"; }
--------RIGHT DOOR --------
game.Workspace.doorright.l11.BrickColor = BrickColor.new(106) game.Workspace.doorright.l23.BrickColor = BrickColor.new(106) game.Workspace.doorright.l32.BrickColor = BrickColor.new(106) game.Workspace.doorright.l41.BrickColor = BrickColor.new(106) game.Workspace.doorright.l53.BrickColor = BrickColor.new(106) game.Workspace.doorright.l62.BrickColor = BrickColor.new(106) game.Workspace.doorright.l71.BrickColor = BrickColor.new(106) game.Workspace.doorright.l12.BrickColor = BrickColor.new(1013) game.Workspace.doorright.l21.BrickColor = BrickColor.new(1013) game.Workspace.doorright.l33.BrickColor = BrickColor.new(1013) game.Workspace.doorright.l42.BrickColor = BrickColor.new(1013) game.Workspace.doorright.l51.BrickColor = BrickColor.new(1013) game.Workspace.doorright.l63.BrickColor = BrickColor.new(1013) game.Workspace.doorright.l72.BrickColor = BrickColor.new(1013) game.Workspace.doorright.l13.BrickColor = BrickColor.new(1023) game.Workspace.doorright.l22.BrickColor = BrickColor.new(1023) game.Workspace.doorright.l31.BrickColor = BrickColor.new(1023) game.Workspace.doorright.l43.BrickColor = BrickColor.new(1023) game.Workspace.doorright.l52.BrickColor = BrickColor.new(1023) game.Workspace.doorright.l61.BrickColor = BrickColor.new(1023) game.Workspace.doorright.l73.BrickColor = BrickColor.new(1023) game.Workspace.doorright.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.Lighting.flashcurrent.Value = "12"
-- if (Health- ultimavida < 0) then -- Sang.Value = Sang.Value + (Health - ultimavida)*((configuracao.BloodMult)*(configuracao.BloodMult)*(configuracao.BloodMult)) -- Dor.Value = math.clamp(Dor.Value+ (Health - ultimavida)*(-configuracao.PainMult), 0, 300) -- MLs.Value = MLs.Value + ((ultimavida - Health) * (configuracao.BloodMult)) -- end
-- Set local variables
local player = players:GetPlayerFromCharacter(script.Parent) local character = player.Character or player.CharacterAdded:wait() local humanoid = character.Humanoid
--Collision checking--
core.spawn(function() while myHuman.Health > 0 do if not criticalAction and engineRunning then flight.checkCollisions() end wait() end end)
-- Player's tank GUI
GUI = script.Parent.Parent.Parent.PlayerGui.TankGUI; GUI.HP.Hitpoints.Text = parts.Parent:findFirstChild("Damage").Value local Hull = parts.Parent:findFirstChild("Damage") if Hull.Value<0 then GUI.HP.Hitpoints.Text = "DISABLED" end local MGDamage = math.random(40,80) braking = false; firingMg = false; reloading = false; currRound = tankStats.Round; -- Current loaded ammo (AP/HE) myMouse = nil; function updateAmmo() GUI.Ammo.Text = "Cannon Ammo = " .. tankStats[tankStats.Round.Value .. "Ammo"].Value; GUI.MG_Ammo.Text = tankStats.MGAmmo.Value; GUI.HP.Hitpoints.Text = parts.Parent:findFirstChild("Damage").Value end function Brakes() for i = 1, 5 do parts.Engine.BodyVelocity.Velocity = Vector3.new(0,0,0) print("Brakes activated") end end Loaded = false
--[[ Constants ]]
-- local ZERO_VECTOR3 = Vector3.new(0,0,0) local TOUCH_CONTROLS_SHEET = "rbxasset://textures/ui/Input/TouchControlsSheetV2.png" local DYNAMIC_THUMBSTICK_ACTION_NAME = "DynamicThumbstickAction" local DYNAMIC_THUMBSTICK_ACTION_PRIORITY = Enum.ContextActionPriority.High.Value local MIDDLE_TRANSPARENCIES = { 1 - 0.89, 1 - 0.70, 1 - 0.60, 1 - 0.50, 1 - 0.40, 1 - 0.30, 1 - 0.25 } local NUM_MIDDLE_IMAGES = #MIDDLE_TRANSPARENCIES local FADE_IN_OUT_BACKGROUND = true local FADE_IN_OUT_MAX_ALPHA = 0.35 local FADE_IN_OUT_HALF_DURATION_DEFAULT = 0.3 local FADE_IN_OUT_BALANCE_DEFAULT = 0.5 local ThumbstickFadeTweenInfo = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut) local Players = game:GetService("Players") local GuiService = game:GetService("GuiService") local UserInputService = game:GetService("UserInputService") local ContextActionService = game:GetService("ContextActionService") local RunService = game:GetService("RunService") local TweenService = game:GetService("TweenService")
-- This function merges the Packages folder from a DevModule into a shared -- location. Until we have an improved package implementation, we need to -- manually dedupe our libraries to cut down on bloat
local function dedupePackages(packages: Folder) local packageStorage = getPackageStorage() for _, package in ipairs(packages:GetChildren()) do if package ~= script then local version = getPackageVersion(package) local existingVersion for _, otherPackage in ipairs(packageStorage:GetChildren()) do if otherPackage.Name:match(("^%s_"):format(package.Name)) then if version == getPackageVersion(otherPackage) then existingVersion = otherPackage break end end end if not existingVersion then local clone = package:Clone() clone.Parent = packageStorage clone.Name = ("%s_%s"):format(clone.Name, version) existingVersion = clone end -- Link the package with the existing version (which was either -- there previously, or is the one we just generated) local packageRef = constants.PACKAGE_REF:Clone() packageRef.Name = package.Name packageRef.package.Value = existingVersion packageRef.Parent = package.Parent package:Destroy() log("link", ("%s <-> %s"):format(package.Name, existingVersion:GetFullName())) end end end
--[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]
-- local PlayerSpawning=false; --[[ Change this to true if you want the NPC to spawn like a player, and change this to false if you want the NPC to spawn at it's current position. ]]-- local AdvancedRespawnScript=script; repeat Wait(0)until script and script.Parent and script.Parent.ClassName=="Model"; local JeffTheKiller=AdvancedRespawnScript.Parent; if AdvancedRespawnScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then JeffTheKiller:FindFirstChild("Thumbnail"):Destroy(); end; local GameDerbis=Game:GetService("Debris"); local JeffTheKillerHumanoid; for _,Child in pairs(JeffTheKiller:GetChildren())do if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then JeffTheKillerHumanoid=Child; end; end; local Respawndant=JeffTheKiller:Clone(); if PlayerSpawning then --[[ LOOK AT LINE: 2. ]]-- coroutine.resume(coroutine.create(function() if JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid:FindFirstChild("Status")and not JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns")then SpawnModel=Instance.new("Model"); SpawnModel.Parent=JeffTheKillerHumanoid.Status; SpawnModel.Name="AvalibleSpawns"; else SpawnModel=JeffTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns"); end; function FindSpawn(SearchValue) local PartsArchivable=SearchValue:GetChildren(); for AreaSearch=1,#PartsArchivable do if PartsArchivable[AreaSearch].className=="SpawnLocation"then local PositionValue=Instance.new("Vector3Value",SpawnModel); PositionValue.Value=PartsArchivable[AreaSearch].Position; PositionValue.Name=PartsArchivable[AreaSearch].Duration; end; FindSpawn(PartsArchivable[AreaSearch]); end; end; FindSpawn(Game:GetService("Workspace")); local SpawnChilden=SpawnModel:GetChildren(); if#SpawnChilden>0 then local SpawnItself=SpawnChilden[math.random(1,#SpawnChilden)]; local RespawningForceField=Instance.new("ForceField"); RespawningForceField.Parent=JeffTheKiller; RespawningForceField.Name="SpawnForceField"; GameDerbis:AddItem(RespawningForceField,SpawnItself.Name); JeffTheKiller:MoveTo(SpawnItself.Value+Vector3.new(0,3.5,0)); else if JeffTheKiller:FindFirstChild("SpawnForceField")then JeffTheKiller:FindFirstChild("SpawnForceField"):Destroy(); end; JeffTheKiller:MoveTo(Vector3.new(0,115,0)); end; end)); end; function Respawn() Wait(5); Respawndant.Parent=JeffTheKiller.Parent; Respawndant:makeJoints(); Respawndant:FindFirstChild("Head"):MakeJoints(); Respawndant:FindFirstChild("Torso"):MakeJoints(); JeffTheKiller:remove(); end; if AdvancedRespawnScript and JeffTheKiller and JeffTheKillerHumanoid then JeffTheKillerHumanoid.Died:connect(Respawn); end;
--------------------------------------------------------------------
if horn == true then mouse.KeyDown:connect(function(key) if key == camkey and enabled == false then local seat = car.DriveSeat local effect = script.soundeffect:Clone() effect.Name = "soundeffectCop" effect.Parent = seat.Horn elseif key == camkey and enabled == true then local seat = car.DriveSeat seat.Horn.soundeffectCop:Destroy() end car.DriveSeat.ChildRemoved:Connect(function(child) if child.Name == "SeatWeld" then local seat = car.DriveSeat seat.Horn.soundeffectCop:Destroy() end end) end) end
--this function runs when players join your game
game.Players.PlayerAdded:Connect(function(player) DataManger.AddPlayerData(player) --this function runs when your player is added to the world, it also runs again when you reset player.CharacterAdded:Connect(function(char) --this is called the player humanoid, it handles a lot of things like animations, jumping, walkspeed local humanoid = char:WaitForChild("Humanoid") --this is setting your jump power to 0, too disable player jumping! humanoid.JumpPower = 0 humanoid.JumpHeight = 0 --this is handling for teleporting players to the checkPoints :) if player.Data.spawnpoint.Value ~= "" then local rootPart = char:WaitForChild("HumanoidRootPart") local foundCheckpoint = workspace.Interactions.Checkpoints:FindFirstChild(player.Data.spawnpoint.Value) if foundCheckpoint then task.wait(.5) rootPart.CFrame = (foundCheckpoint.Root.CFrame * CFrame.new(0,3,0)) else warn("NO CHECKPOINT FOUND WITH THE NAME: "..player.Data.spawnpoint.Value.." DID YOU SET UP A CHECKPOINT WITH THAT NAME?") end end end) end) game.Players.PlayerRemoving:Connect(DataManger.RemovePlayerData)
--EDIT BELOW----------------------------------------------------------------------
settings.PianoSoundRange = 50 settings.KeyAesthetics = true settings.PianoSounds = { "233836579", "233844049", "233845680", "233852841", "233854135", "233856105" }
-- Input related functions
function ShoulderCamera:applyInput(yaw, pitch) local yInvertValue = UserGameSettings:GetCameraYInvertValue() self.yaw = self.yaw + yaw self.pitch = math.clamp(self.pitch + pitch * yInvertValue, self.minPitch, self.maxPitch) end function ShoulderCamera:processGamepadInput(dt) local gamepadPan = self.gamepadPan if gamepadPan then gamepadPan = gamepadLinearToCurve(gamepadPan) if gamepadPan.X == 0 and gamepadPan.Y == 0 then self.lastThumbstickTime = nil if self.lastThumbstickPos.X == 0 and self.lastThumbstickPos.Y == 0 then self.currentGamepadSpeed = 0 end end local finalConstant = 0 local currentTime = tick() if self.lastThumbstickTime then local elapsed = (currentTime - self.lastThumbstickTime) * 10 self.currentGamepadSpeed = self.currentGamepadSpeed + (6 * ((elapsed ^ 2) / 0.7)) if self.currentGamepadSpeed > 6 then self.currentGamepadSpeed = 6 end if self.lastGamepadVelocity then local velocity = (gamepadPan - self.lastThumbstickPos) / (currentTime - self.lastThumbstickTime) local velocityDeltaMag = (velocity - self.lastGamepadVelocity).Magnitude if velocityDeltaMag > 12 then self.currentGamepadSpeed = self.currentGamepadSpeed * (20 / velocityDeltaMag) if self.currentGamepadSpeed > 6 then self.currentGamepadSpeed = 6 end end end finalConstant = GameSettings.GamepadCameraSensitivity * self.currentGamepadSpeed * dt self.lastGamepadVelocity = (gamepadPan - self.lastThumbstickPos) / (currentTime - self.lastThumbstickTime) end self.lastThumbstickPos = gamepadPan self.lastThumbstickTime = currentTime local yawInput = -gamepadPan.X * finalConstant * self.gamepadSensitivityModifier.X local pitchInput = finalConstant * gamepadPan.Y * GameSettings:GetCameraYInvertValue() * self.gamepadSensitivityModifier.Y self:applyInput(yawInput, pitchInput) end end function ShoulderCamera:handleTouchToolFiring() if self.touchObj then if self.lastTapEndTime then -- and not (self.zoomState and self.hasScope) then local touchTime = tick() - self.lastTapEndTime if touchTime < self.touchDelayTime and self.currentTool and self.touchPanAccumulator.Magnitude < 0.5 and not self.firingTool and not self.applyingTouchPan then self.firingTool = true self.currentTool:Activate() end end else if self.currentTool and self.firingTool then self.currentTool:Deactivate() end self.firingTool = false end end function ShoulderCamera:isTouchPositionForCamera(pos) if LocalPlayer then local guiObjects = LocalPlayer.PlayerGui:GetGuiObjectsAtPosition(pos.X, pos.Y) for _, guiObject in ipairs(guiObjects) do if guiObject.Name == "DynamicThumbstickFrame" then return false end end return true end return false end function ShoulderCamera:onInputBegan(inputObj, wasProcessed) if self.touchObj then self.touchObj = nil wasProcessed = false end if inputObj.KeyCode == Enum.KeyCode.Thumbstick2 then self.gamepadPan = Vector2.new(inputObj.Position.X, inputObj.Position.Y) elseif inputObj.KeyCode == Enum.KeyCode.Thumbstick1 then self.movementPan = Vector2.new(inputObj.Position.X, inputObj.Position.Y) elseif inputObj.UserInputType == Enum.UserInputType.Touch then local touchStartPos = Vector2.new(inputObj.Position.X, inputObj.Position.Y) if not wasProcessed and self:isTouchPositionForCamera(touchStartPos) and not self.touchObj then self.touchObj = inputObj self.touchStartTime = tick() self.eventConnections.touchChanged = inputObj.Changed:Connect(function(prop) if prop == "Position" then local touchTime = tick() - self.touchStartTime local newTouchPos = Vector2.new(inputObj.Position.X, inputObj.Position.Y) local delta = (newTouchPos - touchStartPos) * self.currentTouchSensitivity local yawInput = -delta.X local pitchInput = -delta.Y if self.touchPanAccumulator.Magnitude > 0.01 and touchTime > self.touchDelayTime then if not self.applyingTouchPan then self.applyingTouchPan = true self.touchPanAccumulator = Vector2.new(0, 0) end end self:applyInput(yawInput, pitchInput) self.touchPanAccumulator = self.touchPanAccumulator + Vector2.new(yawInput, pitchInput) touchStartPos = newTouchPos end end) end end end function ShoulderCamera:onInputChanged(inputObj, wasProcessed) if inputObj.UserInputType == Enum.UserInputType.MouseMovement then local yawInput = -inputObj.Delta.X * self.currentMouseRadsPerPixel.X local pitchInput = -inputObj.Delta.Y * self.currentMouseRadsPerPixel.Y self:applyInput(yawInput, pitchInput) elseif inputObj.KeyCode == Enum.KeyCode.Thumbstick2 then self.gamepadPan = Vector2.new(inputObj.Position.X, inputObj.Position.Y) elseif inputObj.KeyCode == Enum.KeyCode.Thumbstick1 then self.movementPan = Vector2.new(inputObj.Position.X, inputObj.Position.Y) end end function ShoulderCamera:onInputEnded(inputObj, wasProcessed) if inputObj.KeyCode == Enum.KeyCode.Thumbstick2 then self.gamepadPan = Vector2.new(0, 0) elseif inputObj.KeyCode == Enum.KeyCode.Thumbstick1 then self.movementPan = Vector2.new(0, 0) elseif inputObj.UserInputType == Enum.UserInputType.Touch then if self.touchObj == inputObj then if self.eventConnections and self.eventConnections.touchChanged then self.eventConnections.touchChanged:Disconnect() self.eventConnections.touchChanged = nil end local touchTime = tick() - self.touchStartTime if self.currentTool and self.firingTool then self.currentTool:Deactivate() elseif self.zoomState and self.hasScope and touchTime < self.touchDelayTime and not self.applyingTouchPan then self.currentTool:Activate() -- this makes sure to shoot the sniper with a single tap when it is zoomed in self.currentTool:Deactivate() end self.firingTool = false self.touchPanAccumulator = Vector2.new(0, 0) if touchTime < self.touchDelayTime and not self.applyingTouchPan then self.lastTapEndTime = tick() else self.lastTapEndTime = nil end self.applyingTouchPan = false self.gamepadPan = Vector2.new(0, 0) self.touchObj = nil end end end return ShoulderCamera
--------AUDIENCE BACK LEFT--------
game.Workspace.audiencebackleft1.Part1.BrickColor = BrickColor.new(106) game.Workspace.audiencebackleft1.Part2.BrickColor = BrickColor.new(106) game.Workspace.audiencebackleft1.Part3.BrickColor = BrickColor.new(106) game.Workspace.audiencebackleft1.Part4.BrickColor = BrickColor.new(1013) game.Workspace.audiencebackleft1.Part5.BrickColor = BrickColor.new(1013) game.Workspace.audiencebackleft1.Part6.BrickColor = BrickColor.new(1013) game.Workspace.audiencebackleft1.Part7.BrickColor = BrickColor.new(1023) game.Workspace.audiencebackleft1.Part8.BrickColor = BrickColor.new(1023) game.Workspace.audiencebackleft1.Part9.BrickColor = BrickColor.new(1023)
--// Probabilities
JamChance = 0; -- This is percent scaled. For 100% Chance of jamming, put 100, for 0%, 0; and everything inbetween TracerChance = 60; -- This is the percen scaled. For 100% Chance of showing tracer, put 100, for 0%, 0; and everything inbetween
--[[ AnimateKey(note1,px,py,pz,ox,oy,oz,Time) --note1(1-61), position x, position y, position z, orientation x, orientation y, orientation z, time local obj = --object or gui or wahtever goes here local Properties = {} Properties.Size = UDim2.new() Tween(obj,Properties,2,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false) --Obj,Property,Time,wait,Easingstyle,EasingDirection,RepeatAmt,Reverse ]]
function HighlightPianoKey(note1,transpose) if not Settings.KeyAesthetics then return end local octave = math.ceil(note1/12) local note2 = (note1 - 1)%12 + 1 local key = Piano.Keys.Keys:FindFirstChild(note1) local emitter = Piano.Case.ParticleEmitters:FindFirstChild(note1) if key and emitter then local obj = key local Properties = {} emitter.ParticleEmitter:Emit(1) if IsBlack(note1) then key.Material = "Neon" Properties.Color = Color3.fromRGB(70, 158, 44) Tween(obj,Properties,.15,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false) key.Material = "Neon" else key.Material = "Neon" Properties.Color = Color3.fromRGB(106, 255, 106) Tween(obj,Properties,.15,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false) key.Material = "Neon" end Properties = {} Properties.Color = Color3.fromRGB(130, 130, 130) Tween(obj,Properties,.05,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false) key.Material = "SmoothPlastic" else print(note1..' was not found as either a key or emitter or both') end return end
--[[Weight and CG]]
Tune.Weight = 250 -- 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 = 1 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100) Tune.CGHeight = .9 -- 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
---Creator function return object keys
local KEY_BASE_FRAME = "BaseFrame" local KEY_BASE_MESSAGE = "BaseMessage" local KEY_UPDATE_TEXT_FUNC = "UpdateTextFunction" local KEY_GET_HEIGHT = "GetHeightFunction" local KEY_FADE_IN = "FadeInFunction" local KEY_FADE_OUT = "FadeOutFunction" local KEY_UPDATE_ANIMATION = "UpdateAnimFunction" local TextService = game:GetService("TextService") local Players = game:GetService("Players") local LocalPlayer = Players.LocalPlayer while not LocalPlayer do Players.ChildAdded:wait() LocalPlayer = Players.LocalPlayer end local clientChatModules = script.Parent.Parent local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings")) local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants")) local okShouldClipInGameChat, valueShouldClipInGameChat = pcall(function() return UserSettings():IsUserFeatureEnabled("UserShouldClipInGameChat") end) local shouldClipInGameChat = okShouldClipInGameChat and valueShouldClipInGameChat local module = {} local methods = {} methods.__index = methods function methods:GetStringTextBounds(text, font, textSize, sizeBounds) sizeBounds = sizeBounds or Vector2.new(10000, 10000) return TextService:GetTextSize(text, textSize, font, sizeBounds) end
-- Function to bind to render stepped if player is on PC
local function pcFrame() frame(mouse.Hit.p) end
--Script:
Button.Activated:Connect(function() if MarketplaceService:UserOwnsGamePassAsync(PlayerId, Gamepass.Value) then --FireMessage Message.Properties.Type.ItemAlreadyOwn.Value = true Message.Properties.FireMessage.Value = true else if GamepassInfo["IsForSale"] == true then MarketplaceService:PromptProductPurchase(Player, Gamepass.Value) else Message.Properties.Type.NotForSale.Value = true Message.Properties.FireMessage.Value = true end end end)
--OptionsManager
local OptionsFrame = Frames.OptionsFrame local FrameBase = OptionsFrame.BaseFrame local OptionsFrames = OptionsFrame.Frames local OptionFrameName = nil local OptionFrameToOpen = nil local OptionFrameIsOpened = false local OptionDebounce = false local function OptionOpenGUI() for i = 1,0.6,-0.025 do OptionFrameToOpen.Visible = true OptionFrameToOpen.BackgroundTransparency = i Frames.Back.Transparency = i print(i) OptionFrameToOpen = true OptionDebounce = true task.wait() end end local function OptionCloseGUI() for i = 0.6,1,0.025 do OptionFrameToOpen.BackgroundTransparency = i Frames.Back.Transparency = i print(i) task.wait() end OptionFrameToOpen.Visible = false OptionFrameIsOpened = false task.wait(0.4) OptionDebounce = false end for _, OptionButton in pairs(Buttonsframe:GetDescendants()) do if OptionButton:IsA("TextButton") then OptionButton.MouseButton1Click:Connect(function() OptionFrameName = OptionButton.Name.."Frame" OptionFrameToOpen = OptionsFrames:FindFirstChild(OptionFrameName) if not OptionFrameToOpen.Visible then if not OptionFrameIsOpened and not OptionDebounce then for _, OptionButtons in pairs(FrameBase:GetDescendants()) do if OptionButtons:IsA("TextButton") and OptionButton.Name ~= ButtonSelected then OptionButtons.BackgroundTransparency = 0.95 OptionButtons.Selectable = false OptionButton.BackgroundTransparency = 0.5 end end OptionOpenGUI() end else for _, OptionButtons in pairs(FrameBase:GetDescendants()) do if OptionButtons:IsA("TextButton") and OptionButton.Name ~= ButtonSelected then OptionButtons.BackgroundTransparency = 0.6 OptionButtons.Selectable = true OptionButton.BackgroundTransparency = 0.6 end end OptionCloseGUI() end end) end end
--[=[ An already dead brio which may be used for identity purposes. ```lua print(Brio.DEAD:IsDead()) --> true ``` @prop DEAD Brio @within Brio ]=]
Brio.DEAD = Brio.new() Brio.DEAD:Kill() return Brio
--Made by Shea from RTWS on YouTube - If you haven't already, make sure to check out my tutorial on NPC animations--
-- shorthands
local v3 = Vector3.new local NSK010 = NumberSequenceKeypoint.new(0, 1, 0) local NSK110 = NumberSequenceKeypoint.new(1, 1, 0) local volumeScanGrid = {} -- Pre-generate grid used for raining area distance scanning for _,v in pairs(RAIN_VOLUME_SCAN_GRID) do table.insert(volumeScanGrid, v * RAIN_VOLUME_SCAN_RADIUS) end table.sort(volumeScanGrid, function(a,b) -- Optimization: sort from close to far away for fast evaluation if closeby return a.magnitude < b.magnitude end)
-- Preload animations
function playAnimation(animName, transitionTime, humanoid) local idleFromEmote = (animName == "idle" and emoteNames[currentAnim] ~= nil) if (animName ~= currentAnim and not idleFromEmote) then if (currentAnimTrack ~= nil) then currentAnimTrack:Stop(transitionTime) currentAnimTrack:Destroy() end currentAnimSpeed = 1.0 local roll = math.random(1, animTable[animName].totalWeight) local origRoll = roll local idx = 1 while (roll > animTable[animName][idx].weight) do roll = roll - animTable[animName][idx].weight idx = idx + 1 end
-- Make all the Hotbar Slots
for i = 1, NumberOfHotbarSlots do local slot = MakeSlot(HotbarFrame, i) slot.Frame.Visible = false if not LowestEmptySlot then LowestEmptySlot = slot end end InventoryIcon.selected:Connect(function() if not GuiService.MenuIsOpen then BackpackScript.OpenClose() end end) InventoryIcon.deselected:Connect(function() if InventoryFrame.Visible then BackpackScript.OpenClose() end end) LeftBumperButton = NewGui('ImageLabel', 'LeftBumper') LeftBumperButton.Size = UDim2.new(0, 40, 0, 40) LeftBumperButton.Position = UDim2.new(0, -LeftBumperButton.Size.X.Offset, 0.5, -LeftBumperButton.Size.Y.Offset/2) RightBumperButton = NewGui('ImageLabel', 'RightBumper') RightBumperButton.Size = UDim2.new(0, 40, 0, 40) RightBumperButton.Position = UDim2.new(1, 0, 0.5, -RightBumperButton.Size.Y.Offset/2)
--Turbo Gauge GUI--
local fix = 0 script.Parent.Parent.Values.RPM.Changed:connect(function() script.Parent.BAnalog.Visible = BoostGaugeVisible script.Parent.Background.Visible = BoostGaugeVisible script.Parent.DontTouch.Visible = BoostGaugeVisible script.Parent.Num.Visible = BoostGaugeVisible local turbo = ((totalPSI/2)*WasteGatePressure) local turbo2 = WasteGatePressure fix = -turbo2 + turbo*2 script.Parent.BAnalog.Rotation= 110 + (totalPSI/2)*220 script.Parent.Num.N1.TextLabel.Text = math.floor(WasteGatePressure*(3/3)) script.Parent.Num.N2.TextLabel.Text = math.floor(WasteGatePressure*(2/3)) script.Parent.Num.N3.TextLabel.Text = math.floor(WasteGatePressure*(1/3)) script.Parent.Num.N4.TextLabel.Text = math.floor(WasteGatePressure*(-1/3)) script.Parent.Num.N5.TextLabel.Text = math.floor(WasteGatePressure*(-2/3)) script.Parent.Num.N6.TextLabel.Text = math.floor(WasteGatePressure*(-3/3)) end)
-- Create component
local Notifications = Roact.PureComponent:extend(script.Name) function Notifications:init() self.Active = true self:setState({ ShouldWarnAboutHttpService = false; ShouldWarnAboutUpdate = false; }) fastSpawn(function () local IsOutdated = self.props.Core.IsVersionOutdated() if self.Active then self:setState({ ShouldWarnAboutUpdate = IsOutdated; }) end end) fastSpawn(function () local Core = self.props.Core local IsHttpServiceDisabled = (Core.Mode == 'Tool') and not Core.SyncAPI:Invoke('IsHttpServiceEnabled') if self.Active then self:setState({ ShouldWarnAboutHttpService = IsHttpServiceDisabled; }) end end) end function Notifications:willUnmount() self.Active = false end function Notifications:render() return new('ScreenGui', {}, { Container = new('Frame', { AnchorPoint = Vector2.new(0.5, 0.5); BackgroundTransparency = 1; Position = UDim2.new(0.5, 0, 0.5, 0); Size = UDim2.new(0, 300, 1, 0); }, { Layout = new('UIListLayout', { Padding = UDim.new(0, 10); FillDirection = Enum.FillDirection.Vertical; HorizontalAlignment = Enum.HorizontalAlignment.Left; VerticalAlignment = Enum.VerticalAlignment.Center; SortOrder = Enum.SortOrder.LayoutOrder; }); UpdateNotification = (self.state.ShouldWarnAboutUpdate or nil) and new(NotificationDialog, { LayoutOrder = 1; ThemeColor = Color3.fromRGB(255, 170, 0); NoticeText = 'This version of Building Tools is <b>outdated.</b>'; DetailText = (self.props.Core.Mode == 'Plugin') and 'To update plugins, go to\n<b>PLUGINS</b> > <b>Manage Plugins</b> :-)' or 'Own this place? Simply <b>reinsert</b> the Building Tools model.'; OnDismiss = function () self:setState({ ShouldWarnAboutUpdate = false; }) end; }); HTTPEnabledNotification = (self.state.ShouldWarnAboutHttpService or nil) and new(NotificationDialog, { LayoutOrder = 0; ThemeColor = Color3.fromRGB(255, 0, 4); NoticeText = 'HTTP requests must be <b>enabled</b> for some features of Building Tools to work, including exporting.'; DetailText = 'Own this place? Edit it in Studio, and toggle on\nHOME > <b>Game Settings</b> > Security > <b>Allow HTTP Requests</b> :-)'; OnDismiss = function () self:setState({ ShouldWarnAboutHttpService = false; }) end; }); }); }) end return Notifications
--- Helper method that registers types from all module scripts in a specific container.
function Registry:RegisterTypesIn (container) for _, object in pairs(container:GetChildren()) do if object:IsA("ModuleScript") then object.Parent = self.Cmdr.ReplicatedRoot.Types require(object)(self) else self:RegisterTypesIn(object) end end end
-- Checks for conditions for enabling/disabling the active controller and updates whether the active controller is enabled/disabled
function ControlModule:UpdateActiveControlModuleEnabled() -- helpers for disable/enable local disable = function() self.activeController:Enable(false) if self.moveFunction then self.moveFunction(Players.LocalPlayer, Vector3.new(0,0,0), true) end end local enable = function() if self.activeControlModule == ClickToMove then -- For ClickToMove, when it is the player's choice, we also enable the full keyboard controls. -- When the developer is forcing click to move, the most keyboard controls (WASD) are not available, only jump. self.activeController:Enable( true, Players.LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.UserChoice, self.touchJumpController ) elseif self.touchControlFrame then self.activeController:Enable(true, self.touchControlFrame) else self.activeController:Enable(true) end end -- there is no active controller if not self.activeController then return end -- developer called ControlModule:Disable(), don't turn back on if not self.controlsEnabled then disable() return end -- GuiService.TouchControlsEnabled == false and the active controller is a touch controller, -- disable controls if not GuiService.TouchControlsEnabled and UserInputService.TouchEnabled and (self.activeControlModule == ClickToMove or self.activeControlModule == TouchThumbstick or self.activeControlModule == DynamicThumbstick) then disable() return end -- no settings prevent enabling controls enable() end function ControlModule:Enable(enable: boolean?) if enable == nil then enable = true end self.controlsEnabled = enable if not self.activeController then return end self:UpdateActiveControlModuleEnabled() end
-- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
local anim = animTable[animName][idx].anim if (toolAnimInstance ~= anim) then if (toolAnimTrack ~= nil) then toolAnimTrack:Stop() toolAnimTrack:Destroy() transitionTime = 0 end -- load it to the humanoid; get AnimationTrack toolAnimTrack = humanoid:LoadAnimation(anim) -- play the animation toolAnimTrack:Play(transitionTime) toolAnimName = animName toolAnimInstance = anim currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc) end end function stopToolAnimations() local oldAnim = toolAnimName if (currentToolAnimKeyframeHandler ~= nil) then currentToolAnimKeyframeHandler:disconnect() end toolAnimName = "" toolAnimInstance = nil if (toolAnimTrack ~= nil) then toolAnimTrack:Stop() toolAnimTrack:Destroy() toolAnimTrack = nil end return oldAnim end
--// Firemode Settings
CanSelectFire = true; BurstEnabled = false; SemiEnabled = true; AutoEnabled = true; BoltAction = false; ExplosiveEnabled = false;
--[[ Constants ]]
-- local ZERO_VECTOR3 = Vector3.new(0,0,0) local TOUCH_CONTROLS_SHEET = "rbxasset://textures/ui/Input/TouchControlsSheetV2.png" local DYNAMIC_THUMBSTICK_ACTION_NAME = "DynamicThumbstickAction" local DYNAMIC_THUMBSTICK_ACTION_PRIORITY = Enum.ContextActionPriority.High.Value local MIDDLE_TRANSPARENCIES = { 1 - 0.89, 1 - 0.70, 1 - 0.60, 1 - 0.50, 1 - 0.40, 1 - 0.30, 1 - 0.25 } local NUM_MIDDLE_IMAGES = #MIDDLE_TRANSPARENCIES local FADE_IN_OUT_BACKGROUND = true local FADE_IN_OUT_MAX_ALPHA = 0.35 local FADE_IN_OUT_HALF_DURATION_DEFAULT = 0.3 local FADE_IN_OUT_BALANCE_DEFAULT = 0.5 local ThumbstickFadeTweenInfo = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut) local Players = game:GetService("Players") local GuiService = game:GetService("GuiService") local UserInputService = game:GetService("UserInputService") local ContextActionService = game:GetService("ContextActionService") local RunService = game:GetService("RunService") local TweenService = game:GetService("TweenService") local LocalPlayer = Players.LocalPlayer if not LocalPlayer then Players:GetPropertyChangedSignal("LocalPlayer"):Wait() LocalPlayer = Players.LocalPlayer end
--------END LIGHT SET 1-------- --------DJ BACKLIGHT--------
game.Workspace.djbacklight.l1.BrickColor = BrickColor.new(194) game.Workspace.djbacklight.l2.BrickColor = BrickColor.new(194) game.Workspace.djbacklight.l3.BrickColor = BrickColor.new(194) game.Workspace.djbacklight.l4.BrickColor = BrickColor.new(194)
--script.Parent.Parent.Parent.Sound.Idle:Play() --script.Parent.Parent.Parent.Sound.Grab:Stop()
script.Disabled = true
-- Loop through all players when model added
for _, player in pairs(game.Players:GetPlayers()) do addScriptAtRespawn(player) addMyLocalScript(player) end
--
leftshoulderclone = leftshoulder:Clone() leftshoulderclone.Name = "LeftShoulderClone" leftshoulderclone.Parent = torso leftshoulderclone.Part0 = torso
-- / Workspace Assets / --
local GameHolder = game.Workspace.GameHolder local GamemodesMapHolder = GameHolder.GamemodesMapHolder local GameAssetsHolder = GameHolder.GameAssetsHolder local Lobby = game.Workspace.Lobby
--<模块>--
local BezierCurve = {} function BezierCurve.Lerp(Start , End , Time) if typeof(Start) ~= "Vector3" then Start = Start.Position end if typeof(End) ~= "Vector3" then End = End.Position end return Start + (End - Start) * Time end function BezierCurve.GetFrameByDistance(Start , End , Multiply) if typeof(Start) ~= "Vector3" then Start = Start.Position end if typeof(End) ~= "Vector3" then End = End.Position end if not Multiply then Multiply = 1 else Multiply = 1 + Multiply end local Distance = (Start - End).Magnitude--旋转半径 local Frame = math.round(Distance * 2 / Multiply) return Frame end function BezierCurve.GetMotionTime(Frame , FPS) local Time = 0 Time += task.wait(1 / FPS) * Frame return Time end function BezierCurve.GetMiddlePosition(StartPosition , TargetPosition , Angle , Offset) if typeof(StartPosition) ~= "Vector3" then StartPosition = StartPosition.Position end if typeof(TargetPosition) ~= "Vector3" then TargetPosition = TargetPosition.Position end if not Angle then Angle = 0 end if not Offset then Offset = 1 else Offset = 1 + Offset end local HalfVector3 = (StartPosition - TargetPosition) * 0.5 --起始与目标之间一半长度的向量 local MiddlePosition = StartPosition - HalfVector3 --中间位置点 local RotateCFrame = CFrame.new(MiddlePosition,TargetPosition) --从起始与目标之间的中心点指向目标的向量,用此向量进行旋转 RotateCFrame = RotateCFrame * CFrame.Angles(0,0,math.rad(Angle)) --根据角度旋转此向量 local Radius = HalfVector3.Magnitude * Offset--旋转半径 local ResultPosition = MiddlePosition + RotateCFrame.UpVector * Radius --中间位置 + 旋转后的上朝向 * 半径 return ResultPosition end function BezierCurve.Get2MiddlePosition(StartPosition , TargetPosition , Angle1 , Offset1 , Angle2 , Offset2) if typeof(StartPosition) ~= "Vector3" then StartPosition = StartPosition.Position end if typeof(TargetPosition) ~= "Vector3" then TargetPosition = TargetPosition.Position end if not Angle1 then Angle1 = 0 end if not Angle2 then Angle2 = 0 end if not Offset1 then Offset1 = 1 else Offset1 = 1 + Offset1 end if not Offset2 then Offset2 = 1 else Offset2 = 1 + Offset2 end local function GetResultPosition(StartPosition , TargetPosition , Angle , Offset , Length) local HalfVector3 = (StartPosition - TargetPosition) * Length --起始与目标之间三分之一长度的向量 local MiddlePosition = StartPosition - HalfVector3 --中间位置点 local RotateCFrame = CFrame.new(MiddlePosition,TargetPosition) --从起始与目标之间的中心点指向目标的向量,用此向量进行旋转 RotateCFrame = RotateCFrame * CFrame.Angles(0,0,math.rad(Angle)) --根据角度旋转此向量 local Radius = HalfVector3.Magnitude * Offset--旋转半径 local ResultPosition = MiddlePosition + RotateCFrame.UpVector * Radius --中间位置 + 旋转后的上朝向 * 半径 return ResultPosition end local ResultPosition1 = GetResultPosition(StartPosition , TargetPosition , Angle1 , Offset1 , 1/3) local ResultPosition2 = GetResultPosition(StartPosition , TargetPosition , Angle2 , Offset2 , 1/3 * 2) return ResultPosition1 , ResultPosition2 end
--// All global vars will be wiped/replaced except script --// All guis are autonamed codeName..gui.Name
return function(data, env) if env then setfenv(1, env) end local player = service.Players.LocalPlayer local playergui = player.PlayerGui local gui = script.Parent.Parent local frame = gui.Frame local text = gui.Frame.TextBox local scroll = gui.Frame.ScrollingFrame local players = gui.Frame.PlayerList local entry = gui.Entry local BindEvent = gTable.BindEvent local opened = false local scrolling = false local scrollOpen = false local debounce = false local settings = client.Remote.Get("Setting",{"SplitKey","ConsoleKeyCode","BatchKey","Prefix"}) local splitKey = settings.SplitKey local consoleKey = settings.ConsoleKeyCode local batchKey = settings.BatchKey local prefix = settings.Prefix local commands = client.Remote.Get('FormattedCommands') or {} local scrollOpenSize = UDim2.new(0.36, 0, 0, 200) local scrollCloseSize = UDim2.new(0.36, 0, 0, 47) local openPos = UDim2.new(0.32, 0, 0.353, 0) local closePos = UDim2.new(0.32, 0, 0, -200) local tweenInfo = TweenInfo.new(0.15)----service.SafeTweenSize(frame,UDim2.new(1,0,0,40),nil,nil,0.3,nil,function() if scrollOpen then frame.Size = UDim2.new(1,0,0,140) end end) local scrollOpenTween = service.TweenService:Create(frame, tweenInfo, { Size = scrollOpenSize; }) local scrollCloseTween = service.TweenService:Create(frame, tweenInfo, { Size = scrollCloseSize; }) local consoleOpenTween = service.TweenService:Create(frame, tweenInfo, { Position = openPos; }) local consoleCloseTween = service.TweenService:Create(frame, tweenInfo, { Position = closePos; }) frame.Position = closePos frame.Visible = false frame.Size = scrollCloseSize scroll.Visible = false client.Variables.ChatEnabled = service.StarterGui:GetCoreGuiEnabled("Chat") client.Variables.PlayerListEnabled = service.StarterGui:GetCoreGuiEnabled('PlayerList') local function close() if gui:IsDescendantOf(game) and not debounce then debounce = true scroll:ClearAllChildren() scroll.CanvasSize = UDim2.new(0,0,0,0) scroll.ScrollingEnabled = false frame.Size = scrollCloseSize scroll.Visible = false players.Visible = false scrollOpen = false consoleCloseTween:Play(); debounce = false opened = false end end local function open() if gui:IsDescendantOf(game) and not debounce then debounce = true scroll.ScrollingEnabled = true players.ScrollingEnabled = true consoleOpenTween:Play(); frame.Size = scrollCloseSize scroll.Visible = false players.Visible = false scrollOpen = false text.Text = '' frame.Visible = true frame.Position = openPos; text:CaptureFocus() text.Text = '' wait() text.Text = '' debounce = false opened = true end end text.FocusLost:Connect(function(enterPressed) if enterPressed then if text.Text~='' and string.len(text.Text)>1 then client.Remote.Send('ProcessCommand',text.Text) end end close() end) text.Changed:Connect(function(c) if c == 'Text' and text.Text ~= '' and open then if string.sub(text.Text, string.len(text.Text)) == " " then if players:FindFirstChild("Entry 0") then text.Text = `{string.sub(text.Text, 1, (string.len(text.Text) - 1))}{players["Entry 0"].Text} ` elseif scroll:FindFirstChild("Entry 0") then text.Text = string.split(scroll["Entry 0"].Text, "<")[1] else text.Text = text.Text..prefix end text.CursorPosition = string.len(text.Text) + 1 text.Text = string.gsub(text.Text, " ", "") end scroll:ClearAllChildren() players:ClearAllChildren() local nText = text.Text if string.match(nText,`.*{batchKey}([^']+)`) then nText = string.match(nText,`.*{batchKey}([^']+)`) nText = string.match(nText,"^%s*(.-)%s*$") end local pNum = 0 local pMatch = string.match(nText,`.+{splitKey}(.*)$`) for i,v in next,service.Players:GetPlayers() do if (pMatch and string.sub(string.lower(tostring(v)),1,#pMatch) == string.lower(pMatch)) or string.match(nText,`{splitKey}$`) then local new = entry:Clone() new.Text = tostring(v) new.Name = `Entry {pNum}` new.TextXAlignment = "Right" new.Visible = true new.Parent = players new.Position = UDim2.new(0,0,0,20*pNum) new.MouseButton1Down:Connect(function() text.Text = text.Text..tostring(v) text:CaptureFocus() end) pNum = pNum+1 end end players.CanvasSize = UDim2.new(0,0,0,pNum*20) local num = 0 for i,v in next,commands do if string.sub(string.lower(v),1,#nText) == string.lower(nText) or string.find(string.lower(v), string.match(string.lower(nText),`^(.-){splitKey}`) or string.lower(nText), 1, true) then if not scrollOpen then scrollOpenTween:Play(); --frame.Size = UDim2.new(1,0,0,140) scroll.Visible = true players.Visible = true scrollOpen = true end local b = entry:Clone() b.Visible = true b.Parent = scroll b.Text = v b.Name = `Entry {num}` b.Position = UDim2.new(0,0,0,20*num) b.MouseButton1Down:Connect(function() text.Text = b.Text text:CaptureFocus() end) num = num+1 end end if num > 0 then frame.Size = UDim2.new(0.36, 0, 0, math.clamp((math.max(num, pNum)*20)+53, 47, 200)) else players.Visible = false frame.Size = scrollCloseSize end scroll.CanvasSize = UDim2.new(0,0,0,num*20) elseif c == 'Text' and text.Text == '' and opened then scrollCloseTween:Play(); --service.SafeTweenSize(frame,UDim2.new(1,0,0,40),nil,nil,0.3,nil,function() if scrollOpen then frame.Size = UDim2.new(1,0,0,140) end end) scroll.Visible = false players.Visible = false scrollOpen = false scroll:ClearAllChildren() scroll.CanvasSize = UDim2.new(0,0,0,0) end end) BindEvent(service.UserInputService.InputBegan, function(InputObject) local textbox = service.UserInputService:GetFocusedTextBox() if not (textbox) and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) and InputObject.KeyCode.Name == (client.Variables.CustomConsoleKey or consoleKey) then if opened then close() else open() end client.Variables.ConsoleOpen = opened end end) gTable:Ready() end
-- Called when the player's character is added. -- Sets up mirroring of the player's head for first person.
function FpsCamera:OnCharacterAdded(character) local mirrorBin = self.MirrorBin if mirrorBin then mirrorBin:ClearAllChildren() mirrorBin.Parent = nil end self.HeadMirrors = {} for _,desc in pairs(character:GetDescendants()) do self:AddHeadMirror(desc) end self:Connect("AddHeadMirror", character.DescendantAdded) self:Connect("RemoveHeadMirror", character.DescendantRemoving) end
--[=[ Service bags handle recursive initialization of services, and the retrieval of services from a given source. This allows the composition of services without the initialization of those services becoming a pain, which makes refactoring downstream services very easy. This also allows multiple copies of a service to exist at once, although many services right now are not designed for this. ```lua local serviceBag = ServiceBag.new() serviceBag:GetService({ Init = function(self) print("Service initialized") end; }) serviceBag:Init() serviceBag:Start() ``` @class ServiceBag ]=]
local require = require(script.Parent.loader).load(script) local Signal = require("Signal") local BaseObject = require("BaseObject")
--edit the below function to execute code when this response is chosen OR this prompt is shown --player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder) dialogueFolder.Parent.OrbThrow.Use:Fire(player.Character) delay(4,function() print("New character") game.ReplicatedStorage.Events.System.NewCharacterServer:Fire(player) end) end
-- Initialization
game.StarterGui.ResetPlayerGuiOnSpawn = false ScreenGui.Parent = Player.PlayerGui
--// All global vars will be wiped/replaced except script --// All guis are autonamed client.Variables.CodeName..gui.Name --// Be sure to update the console gui's code if you change stuff
return function(data) local gui = script.Parent.Parent local playergui = service.PlayerGui local localplayer = service.Players.LocalPlayer local storedChats = client.Variables.StoredChats local desc = gui.Desc local nohide = data.KeepChat local function Expand(ent, point) ent.MouseLeave:connect(function(x,y) point.Visible = false end) ent.MouseMoved:connect(function(x,y) point.Text = ent.Desc.Value point.Size = UDim2.new(0, 10000, 0, 10000) local bounds = point.TextBounds.X local rows = math.floor(bounds/500) rows = rows+1 if rows<1 then rows = 1 end local newx = 500 if bounds<500 then newx = bounds end point.Visible = true point.Size = UDim2.new(0, newx+10, 0, rows*20) point.Position = UDim2.new(0, x, 0, y-40-(rows*20)) end) end local function UpdateChat() if gui then local globalTab = gui.Drag.Frame.Frame.Global local teamTab = gui.Drag.Frame.Frame.Team local localTab = gui.Drag.Frame.Frame.Local local adminsTab = gui.Drag.Frame.Frame.Admins local crossTab = gui.Drag.Frame.Frame.Cross local entry = gui.Entry local tester = gui.BoundTest globalTab:ClearAllChildren() teamTab:ClearAllChildren() localTab:ClearAllChildren() adminsTab:ClearAllChildren() crossTab:ClearAllChildren() local globalNum = 0 local teamNum = 0 local localNum = 0 local adminsNum = 0 local crossNum = 0 for i,v in pairs(storedChats) do local clone = entry:Clone() clone.Message.Text = service.MaxLen(v.Message,100) clone.Desc.Value = v.Message Expand(clone,desc) if not string.match(v.Player, "%S") then clone.Nameb.Text = v.Player else clone.Nameb.Text = "["..v.Player.."]: " end clone.Visible = true clone.Nameb.Font = "SourceSansBold" local color = v.Color or BrickColor.White() clone.Nameb.TextColor3 = color.Color tester.Text = "["..v.Player.."]: " local naml = tester.TextBounds.X + 5 if naml>100 then naml = 100 end tester.Text = v.Message local mesl = tester.TextBounds.X clone.Message.Position = UDim2.new(0,naml,0,0) clone.Message.Size = UDim2.new(1,-(naml+10),1,0) clone.Nameb.Size = UDim2.new(0,naml,0,20) clone.Visible = false clone.Parent = globalTab local rows = math.floor((mesl+naml)/clone.AbsoluteSize.X) rows = rows + 1 if rows<1 then rows = 1 end if rows>3 then rows = 3 end --rows = rows+1 clone.Parent = nil clone.Visible = true clone.Size = UDim2.new(1,0,0,rows*20) if v.Private then clone.Nameb.TextColor3 = Color3.new(150/255, 57/255, 176/255) end if v.Mode=="Global" then clone.Position = UDim2.new(0,0,0,globalNum*20) globalNum = globalNum + 1 if rows>1 then globalNum = globalNum + rows-1 end clone.Parent = globalTab elseif v.Mode=="Team" then clone.Position = UDim2.new(0,0,0,teamNum*20) teamNum = teamNum + 1 if rows>1 then teamNum = teamNum + rows-1 end clone.Parent = teamTab elseif v.Mode=="Local" then clone.Position = UDim2.new(0,0,0,localNum*20) localNum = localNum + 1 if rows>1 then localNum = localNum + rows-1 end clone.Parent = localTab elseif v.Mode=="Admins" then clone.Position = UDim2.new(0,0,0,adminsNum*20) adminsNum = adminsNum + 1 if rows>1 then adminsNum = adminsNum + rows-1 end clone.Parent = adminsTab elseif v.Mode=="Cross" then clone.Position = UDim2.new(0,0,0,crossNum*20) crossNum = crossNum + 1 if rows>1 then crossNum = crossNum + rows-1 end clone.Parent = crossTab end end globalTab.CanvasSize = UDim2.new(0, 0, 0, ((globalNum)*20)) teamTab.CanvasSize = UDim2.new(0, 0, 0, ((teamNum)*20)) localTab.CanvasSize = UDim2.new(0, 0, 0, ((localNum)*20)) adminsTab.CanvasSize = UDim2.new(0, 0, 0, ((adminsNum)*20)) crossTab.CanvasSize = UDim2.new(0, 0, 0, ((crossNum)*20)) local glob = (((globalNum)*20) - globalTab.AbsoluteWindowSize.Y) local tea = (((teamNum)*20) - teamTab.AbsoluteWindowSize.Y) local loc = (((localNum)*20) - localTab.AbsoluteWindowSize.Y) local adm = (((adminsNum)*20) - adminsTab.AbsoluteWindowSize.Y) local cro = (((crossNum)*20) - crossTab.AbsoluteWindowSize.Y) if glob<0 then glob=0 end if tea<0 then tea=0 end if loc<0 then loc=0 end if adm<0 then adm=0 end if cro<0 then cro=0 end globalTab.CanvasPosition =Vector2.new(0,glob) teamTab.CanvasPosition =Vector2.new(0,tea) localTab.CanvasPosition = Vector2.new(0,loc) adminsTab.CanvasPosition = Vector2.new(0,adm) crossTab.CanvasPosition = Vector2.new(0,cro) end end if not storedChats then client.Variables.StoredChats = {} storedChats = client.Variables.StoredChats end gTable:Ready() local bubble = gui.Bubble local toggle = gui.Toggle local drag = gui.Drag local frame = gui.Drag.Frame local frame2 = gui.Drag.Frame.Frame local box = gui.Drag.Frame.Chat local globalTab = gui.Drag.Frame.Frame.Global local teamTab = gui.Drag.Frame.Frame.Team local localTab = gui.Drag.Frame.Frame.Local local adminsTab = gui.Drag.Frame.Frame.Admins local crossTab = gui.Drag.Frame.Frame.Cross local global = gui.Drag.Frame.Global local team = gui.Drag.Frame.Team local localb = gui.Drag.Frame.Local local admins = gui.Drag.Frame.Admins local cross = gui.Drag.Frame.Cross local ChatScript,ChatMain,Chatted = service.Player.PlayerScripts:FindFirstChild("ChatScript") if ChatScript then ChatMain = ChatScript:FindFirstChild("ChatMain") if ChatMain then Chatted = require(ChatMain).MessagePosted end end if not nohide then client.Variables.CustomChat = true client.Variables.ChatEnabled = false service.StarterGui:SetCoreGuiEnabled('Chat',false) else drag.Position = UDim2.new(0,10,1,-180) end local dragger = gui.Drag.Frame.Dragger local fakeDrag = gui.Drag.Frame.FakeDragger local boxFocused = false local mode = "Global" local lastChat = 0 local lastClick = 0 local isAdmin = client.Remote.Get("CheckAdmin") if not isAdmin then admins.BackgroundTransparency = 0.8 admins.TextTransparency = 0.8 cross.BackgroundTransparency = 0.8 cross.TextTransparency = 0.8 end if client.UI.Get("HelpButton") then toggle.Position = UDim2.new(1, -(45+45),1, -45) end local function openGlobal() globalTab.Visible = true teamTab.Visible = false localTab.Visible = false adminsTab.Visible = false crossTab.Visible = false global.Text = "Global" mode = "Global" global.BackgroundTransparency = 0 team.BackgroundTransparency = 0.5 localb.BackgroundTransparency = 0.5 if isAdmin then admins.BackgroundTransparency = 0.5 admins.TextTransparency = 0 cross.BackgroundTransparency = 0.5 cross.TextTransparency = 0 else admins.BackgroundTransparency = 0.8 admins.TextTransparency = 0.8 cross.BackgroundTransparency = 0.8 cross.TextTransparency = 0.8 end end local function openTeam() globalTab.Visible = false teamTab.Visible = true localTab.Visible = false adminsTab.Visible = false crossTab.Visible = false team.Text = "Team" mode = "Team" global.BackgroundTransparency = 0.5 team.BackgroundTransparency = 0 localb.BackgroundTransparency = 0.5 admins.BackgroundTransparency = 0.5 if isAdmin then admins.BackgroundTransparency = 0.5 admins.TextTransparency = 0 cross.BackgroundTransparency = 0.5 cross.TextTransparency = 0 else admins.BackgroundTransparency = 0.8 admins.TextTransparency = 0.8 cross.BackgroundTransparency = 0.8 cross.TextTransparency = 0.8 end end local function openLocal() globalTab.Visible = false teamTab.Visible = false localTab.Visible = true adminsTab.Visible = false crossTab.Visible = false localb.Text = "Local" mode = "Local" global.BackgroundTransparency = 0.5 team.BackgroundTransparency = 0.5 localb.BackgroundTransparency = 0 admins.BackgroundTransparency = 0.5 if isAdmin then admins.BackgroundTransparency = 0.5 admins.TextTransparency = 0 cross.BackgroundTransparency = 0.5 cross.TextTransparency = 0 else admins.BackgroundTransparency = 0.8 admins.TextTransparency = 0.8 cross.BackgroundTransparency = 0.8 cross.TextTransparency = 0.8 end end local function openAdmins() globalTab.Visible = false teamTab.Visible = false localTab.Visible = false adminsTab.Visible = true crossTab.Visible = false admins.Text = "Admins" mode = "Admins" global.BackgroundTransparency = 0.5 team.BackgroundTransparency = 0.5 localb.BackgroundTransparency = 0.5 if isAdmin then admins.BackgroundTransparency = 0 admins.TextTransparency = 0 cross.BackgroundTransparency = 0.5 cross.TextTransparency = 0 else admins.BackgroundTransparency = 0.8 admins.TextTransparency = 0.8 cross.BackgroundTransparency = 0.8 cross.TextTransparency = 0.8 end end local function openCross() globalTab.Visible = false teamTab.Visible = false localTab.Visible = false adminsTab.Visible = false crossTab.Visible = true cross.Text = "Cross" mode = "Cross" global.BackgroundTransparency = 0.5 team.BackgroundTransparency = 0.5 localb.BackgroundTransparency = 0.5 if isAdmin then admins.BackgroundTransparency = 0.5 admins.TextTransparency = 0 cross.BackgroundTransparency = 0 cross.TextTransparency = 0 else admins.BackgroundTransparency = 0.8 admins.TextTransparency = 0.8 cross.BackgroundTransparency = 0.8 cross.TextTransparency = 0.8 end end local function fadeIn() --[[ frame.BackgroundTransparency = 0.5 frame2.BackgroundTransparency = 0.5 box.BackgroundTransparency = 0.5 for i=0.1,0.5,0.1 do --wait(0.1) frame.BackgroundTransparency = 0.5-i frame2.BackgroundTransparency = 0.5-i box.BackgroundTransparency = 0.5-i end-- Disabled ]] frame.BackgroundTransparency = 0 frame2.BackgroundTransparency = 0 box.BackgroundTransparency = 0 fakeDrag.Visible = true end local function fadeOut() --[[ frame.BackgroundTransparency = 0 frame2.BackgroundTransparency = 0 box.BackgroundTransparency = 0 for i=0.1,0.5,0.1 do --wait(0.1) frame.BackgroundTransparency = i frame2.BackgroundTransparency = i box.BackgroundTransparency = i end-- Disabled ]] frame.BackgroundTransparency = 0.7 frame2.BackgroundTransparency = 1 box.BackgroundTransparency = 1 fakeDrag.Visible = false end fadeOut() frame.MouseEnter:connect(function() fadeIn() end) frame.MouseLeave:connect(function() if not boxFocused then fadeOut() end end) toggle.MouseButton1Click:connect(function() if drag.Visible then drag.Visible = false toggle.Image = "rbxassetid://417301749"--417285299" else drag.Visible = true toggle.Image = "rbxassetid://417301773"--417285351" end end) global.MouseButton1Click:connect(function() openGlobal() end) team.MouseButton1Click:connect(function() openTeam() end) localb.MouseButton1Click:connect(function() openLocal() end) admins.MouseButton1Click:connect(function() if isAdmin or tick() - lastClick>5 then isAdmin = client.Remote.Get("CheckAdmin") if isAdmin then openAdmins() else admins.BackgroundTransparency = 0.8 admins.TextTransparency = 0.8 end lastClick = tick() end end) cross.MouseButton1Click:connect(function() if isAdmin or tick() - lastClick>5 then isAdmin = client.Remote.Get("CheckAdmin") if isAdmin then openCross() else cross.BackgroundTransparency = 0.8 cross.TextTransparency = 0.8 end lastClick = tick() end end) box.FocusLost:connect(function(enterPressed) boxFocused = false if enterPressed and not client.Variables.Muted then if box.Text~='' and ((mode~="Cross" and tick()-lastChat>=0.5) or (mode=="Cross" and tick()-lastChat>=10)) then if not client.Variables.Muted then client.Remote.Send('ProcessCustomChat',box.Text,mode) lastChat = tick() if Chatted then --Chatted:fire(box.Text) end end elseif not ((mode~="Cross" and tick()-lastChat>=0.5) or (mode=="Cross" and tick()-lastChat>=10)) then local tim if mode == "Cross" then tim = 10-(tick()-lastChat) else tim = 0.5-(tick()-lastChat) end tim = string.sub(tostring(tim),1,3) client.Handlers.ChatHandler("SpamBot","Sending too fast! Please wait "..tostring(tim).." seconds.","System") end box.Text = "Click here or press the '/' key to chat" fadeOut() if mode ~= "Cross" then lastChat = tick() end end end) box.Focused:connect(function() boxFocused = true if box.Text=="Click here or press the '/' key to chat" then box.Text = '' end fadeIn() end) if not nohide then service.UserInputService.InputBegan:connect(function(InputObject) local textbox = service.UserInputService:GetFocusedTextBox() if not (textbox) and InputObject.UserInputType==Enum.UserInputType.Keyboard and InputObject.KeyCode == Enum.KeyCode.Slash then if box.Text=="Click here or press the '/' key to chat" then box.Text='' end service.RunService.RenderStepped:Wait() box:CaptureFocus() end end) end local mouse=service.Players.LocalPlayer:GetMouse() local nx,ny=drag.AbsoluteSize.X,frame.AbsoluteSize.Y--450,200 local dragging=false local defx,defy=nx,ny mouse.Move:connect(function(x,y) if dragging then nx=defx+(dragger.Position.X.Offset+20) ny=defy+(dragger.Position.Y.Offset+20) if nx<260 then nx=260 end if ny<100 then ny=100 end frame.Size=UDim2.new(1, 0, 0, ny) drag.Size=UDim2.new(0, nx, 0, 30) end end) dragger.DragBegin:connect(function(init) dragging=true end) dragger.DragStopped:connect(function(x,y) dragging=false defx=nx defy=ny dragger.Position=UDim2.new(1,-20,1,-20) UpdateChat() end) UpdateChat() --[[ if not service.UserInputService.KeyboardEnabled then warn("User is on mobile :: CustomChat Disabled") chatenabled = true drag.Visible = false service.StarterGui:SetCoreGuiEnabled('Chat',true) end --]] client.Handlers.RemoveCustomChat = function() local chat=gui if chat then chat:Destroy() client.Variables.ChatEnabled = true service.StarterGui:SetCoreGuiEnabled('Chat',true) end end client.Handlers.ChatHandler = function(plr, message, mode) if not message then return end if string.sub(message,1,2)=='/e' then return end if gui then local globalTab = gui.Drag.Frame.Frame.Global local teamTab = gui.Drag.Frame.Frame.Team local localTab = gui.Drag.Frame.Frame.Local local adminsTab = gui.Drag.Frame.Frame.Admins local global = gui.Drag.Frame.Global local team = gui.Drag.Frame.Team local localb = gui.Drag.Frame.Local local admins = gui.Drag.Frame.Admins local entry = gui.Entry local bubble = gui.Bubble local tester = gui.BoundTest local num = 0 local player if plr and type(plr) == "userdata" then player = plr else player = {Name = tostring(plr or "System"), TeamColor = BrickColor.White()} end if #message>150 then message = string.sub(message,1,150).."..." end if mode then if mode=="Private" or mode=="System" then table.insert(storedChats,{Color=player.TeamColor or BrickColor.White(),Player=player.Name,Message=message,Mode="Global",Private=true}) table.insert(storedChats,{Color=player.TeamColor or BrickColor.White(),Player=player.Name,Message=message,Mode="Team",Private=true}) table.insert(storedChats,{Color=player.TeamColor or BrickColor.White(),Player=player.Name,Message=message,Mode="Local",Private=true}) table.insert(storedChats,{Color=player.TeamColor or BrickColor.White(),Player=player.Name,Message=message,Mode="Admins",Private=true}) table.insert(storedChats,{Color=player.TeamColor or BrickColor.White(),Player=player.Name,Message=message,Mode="Cross",Private=true}) else local plr = player.Name table.insert(storedChats,{Color=player.TeamColor or BrickColor.White(),Player=plr,Message=message,Mode=mode}) end else local plr = player.Name table.insert(storedChats,{Color=player.TeamColor or BrickColor.White(),Player=plr,Message=message,Mode="Global"}) end if mode=="Local" then if not localTab.Visible then localb.Text = "Local*" end elseif mode=="Team" then if not teamTab.Visible then team.Text = "Team*" end elseif mode=="Admins" then if not adminsTab.Visible then admins.Text = "Admins*" end elseif mode=="Cross" then if not crossTab.Visible then cross.Text = "Cross*" end else if not globalTab.Visible then global.Text = "Global*" end end if #storedChats>=50 then table.remove(storedChats,1) end UpdateChat() if not nohide then if player and type(player)=="userdata" then local char = player.Character local head = char:FindFirstChild("Head") if head then local cont = service.LocalContainer():FindFirstChild(player.Name.."Bubbles") if not cont then cont = Instance.new("BillboardGui",service.LocalContainer()) cont.Name = player.Name.."Bubbles" cont.StudsOffset = Vector3.new(0,2,0) cont.SizeOffset = Vector2.new(0,0.5) cont.Size = UDim2.new(0,200,0,150) end cont.Adornee = head local clone = bubble:Clone() clone.TextLabel.Text = message clone.Parent = cont local xsize = clone.TextLabel.TextBounds.X+40 if xsize>400 then xsize=400 end clone.Size = UDim2.new(0,xsize,0,50) if #cont:children()>3 then cont:children()[1]:Destroy() end for i,v in pairs(cont:children()) do local xsize = v.TextLabel.TextBounds.X+40 if xsize>400 then xsize=400 end v.Position = UDim2.new(0.5,-xsize/2,1,-(math.abs((i-1)-#cont:children())*50)) end local cam = service.Workspace.CurrentCamera local char = player.Character local head = char:FindFirstChild("Head") local label = clone.TextLabel Routine(function() repeat if not head then break end local dist = (head.Position - cam.CoordinateFrame.p).magnitude if dist <= 50 then clone.Visible = true else clone.Visible = false end wait(0.1) until not clone.Parent or not clone or not head or not head.Parent or not char end) wait(10) if clone then clone:Destroy() end end end end end end local textbox = service.UserInputService:GetFocusedTextBox() if textbox then textbox:ReleaseFocus() end end
--[[ Manages batch updating of tween objects. ]]
local RunService = game:GetService("RunService") local Package = script.Parent.Parent local Types = require(Package.Types) local lerpType = require(Package.Animation.lerpType) local getTweenRatio = require(Package.Animation.getTweenRatio) local updateAll = require(Package.Dependencies.updateAll) local TweenScheduler = {} type Set<T> = {[T]: any} type Tween = Types.Tween<any> local WEAK_KEYS_METATABLE = {__mode = "k"}
--[[** Calls each Object's `MethodName` (or calls the Object if `MethodName == true`) and removes them from the Janitor. Also clears the namespace. This function is also called when you call a Janitor Object (so it can be used as a destructor callback). @returns [t:void] **--]]
function Janitor.__index:Cleanup() if not self.CurrentlyCleaning then self.CurrentlyCleaning = nil for Object, MethodName in next, self do if Object == IndicesReference then continue end if MethodName == true then Object() else local ObjectMethod = Object[MethodName] if ObjectMethod then ObjectMethod(Object) end end self[Object] = nil end local This = self[IndicesReference] if This then for Index in next, This do This[Index] = nil end self[IndicesReference] = {} end self.CurrentlyCleaning = false end end
---------------------------------- ------------VARIABLES------------- ----------------------------------
InputService = game:GetService("UserInputService") Mouse = Player:GetMouse() TextBoxFocused = false FocusLost = false ShiftLock = false
-- loop to handle timed state transitions and tool animations
while Figure.Parent~=nil do local _, time = wait(0.1) move(time) end