prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
-- / Values / --
local CurrentLayer = Button.Parent.CurrentLayer
--For Omega Rainbow Katana thumbnail to display a lot of particles.
for i, v in pairs(Handle:GetChildren()) do if v:IsA("ParticleEmitter") then v.Rate = 20 end end Tool.Grip = Grips.Up Tool.Enabled = true function IsTeamMate(Player1, Player2) return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor) end function TagHumanoid(humanoid, player) local Creator_Tag = Instance.new("ObjectValue") Creator_Tag.Name = "creator" Creator_Tag.Value = player Debris:AddItem(Creator_Tag, 2) Creator_Tag.Parent = humanoid end function UntagHumanoid(humanoid) for i, v in pairs(humanoid:GetChildren()) do if v:IsA("ObjectValue") and v.Name == "creator" then v:Destroy() end end end function Blow(Hit) if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped then return end local RightArm = Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand") if not RightArm then return end local RightGrip = RightArm:FindFirstChild("RightGrip") if not RightGrip or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then return end local character = Hit.Parent if character == Character then return end local humanoid = character:FindFirstChildOfClass("Humanoid") if not humanoid or humanoid.Health == 0 then return end local player = Players:GetPlayerFromCharacter(character) if player and (player == Player or IsTeamMate(Player, player)) then return end UntagHumanoid(humanoid) TagHumanoid(humanoid, Player) humanoid:TakeDamage(Damage) end function Attack() Damage = DamageValues.SlashDamage Sounds.Slash:Play() if Humanoid then if Humanoid.RigType == Enum.HumanoidRigType.R6 then local Anim = Instance.new("StringValue") Anim.Name = "toolanim" Anim.Value = "Slash" Anim.Parent = Tool elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then local Anim = Tool:FindFirstChild("R15Slash") if Anim then local Track = Humanoid:LoadAnimation(Anim) Track:Play(0) end end end end function Lunge() Damage = DamageValues.LungeDamage Sounds.Lunge:Play() if Humanoid then if Humanoid.RigType == Enum.HumanoidRigType.R6 then local Anim = Instance.new("StringValue") Anim.Name = "toolanim" Anim.Value = "Lunge" Anim.Parent = Tool elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then local Anim = Tool:FindFirstChild("R15Lunge") if Anim then local Track = Humanoid:LoadAnimation(Anim) Track:Play(0) end end end --[[ if CheckIfAlive() then local Force = Instance.new("BodyVelocity") Force.velocity = Vector3.new(0, 10, 0) Force.maxForce = Vector3.new(0, 4000, 0) Debris:AddItem(Force, 0.4) Force.Parent = Torso end ]] wait(0.2) Tool.Grip = Grips.Out wait(0.2) Tool.Grip = Grips.Up Damage = DamageValues.SlashDamage end Tool.Enabled = true LastAttack = 0 function Activated() if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then return end Tool.Enabled = false local Tick = RunService.Stepped:wait() if (Tick - LastAttack < 0.2) then Lunge() else Attack() end LastAttack = Tick --wait(0.2) Damage = DamageValues.BaseDamage local SlashAnim = (Tool:FindFirstChild("R15Slash") or Create("Animation"){ Name = "R15Slash", AnimationId = BaseUrl .. Animations.R15Slash, Parent = Tool }) local LungeAnim = (Tool:FindFirstChild("R15Lunge") or Create("Animation"){ Name = "R15Lunge", AnimationId = BaseUrl .. Animations.R15Lunge, Parent = Tool }) Tool.Enabled = true end function CheckIfAlive() return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent) and true) or false) end function Equipped() Character = Tool.Parent Player = Players:GetPlayerFromCharacter(Character) Humanoid = Character:FindFirstChildOfClass("Humanoid") Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart") if not CheckIfAlive() then return end ToolEquipped = true Sounds.Unsheath:Play() end function Unequipped() Tool.Grip = Grips.Up ToolEquipped = false end Tool.Activated:Connect(Activated) Tool.Equipped:Connect(Equipped) Tool.Unequipped:Connect(Unequipped) Connection = Handle.Touched:Connect(Blow)
-- send nil to client to mark repair cancelled
local repairTarget local repairingValue local apparentHolder local requestStop = false script.RepairChannel.OnServerEvent:Connect(function(plr, engine, valObj) local holder = game.Players:GetPlayerFromCharacter(script.Parent.Parent) print(holder, plr) if holder == plr then apparentHolder = plr if engine ~= nil then repairingValue = valObj repairTarget = repairingValue.Parent.Parent.Parent.Engine script.Internal:Fire() else requestStop = true end end end) while true do requestStop = false script.Internal.Event:Wait() while wait(.5) do local engine = repairingValue.Parent.Parent.Parent.Engine local dist = (script.Parent.Handle.Position - engine.Position).Magnitude local vel = engine.Velocity.Magnitude if requestStop or dist > 50 or vel > 3 or script.Parent.Parent:FindFirstChildOfClass("Humanoid") == nil or repairingValue.Value >= 100 then script.RepairChannel:FireClient(apparentHolder) repairingValue = nil break else repairingValue.Value = math.min(repairingValue.Value + 1, 100) end end end
--[[Engine (Avxnturador)]]
-- Everything below can be illustrated and tuned with the graph below. -- https://www.desmos.com/calculator/oishj9m1tq -- This includes everything, from the engines, to boost, to electric. -- To import engines prior to AC6C V1.3, consult the README. -- Naturally Aspirated Engine Tune.Engine = false Tune.Horsepower = 220 Tune.IdleRPM = 750 Tune.PeakRPM = 6800 Tune.Redline = 8000 Tune.EqPoint = 5252 Tune.PeakSharpness = 10 Tune.CurveMult = 0.4 -- Electric Engine Tune.Electric = true Tune.E_Redline = 12700 Tune.E_Trans1 = 4000 Tune.E_Trans2 = 7000 -- Horsepower Tune.E_Horsepower = 600 Tune.EH_FrontMult = 0.15 Tune.EH_EndMult = 2.9 Tune.EH_EndPercent = 7 -- Torque Tune.E_Torque = 286 Tune.ET_EndMult = 1.505 Tune.ET_EndPercent = 27.5 -- Turbocharger Tune.Turbochargers = 1 -- Number of turbochargers in the engine -- Set to 0 for no turbochargers Tune.T_Boost = 7 Tune.T_Efficiency = 8.5 Tune.T_Size = 80 -- Turbo Size; Bigger size = more turbo lag -- Supercharger Tune.Superchargers = 1 -- Number of superchargers in the engine -- Set to 0 for no superchargers Tune.S_Boost = 7 Tune.S_Efficiency = 8.5 Tune.S_Sensitivity = 0.05 -- Supercharger responsiveness/sensitivity, applied per tick (recommended values between 0.05 to 0.1) --Misc Tune.ThrotAccel = .05 -- Throttle acceleration, applied per tick (recommended values between 0.05 to 0.1) Tune.ThrotDecel = .2 -- Throttle deceleration, applied per tick (recommended values between 0.1 to 0.3) Tune.BrakeAccel = .2 -- Brake acceleration, applied per tick Tune.BrakeDecel = .5 -- Brake deceleration, applied per tick Tune.RevAccel = 250 -- RPM acceleration when clutch is off Tune.RevDecay = 75 -- RPM decay when clutch is off Tune.RevBounce = 500 -- RPM kickback from redline Tune.IdleThrottle = 3 -- Percent throttle at idle Tune.Flywheel = 500 -- Flywheel weight (higher = faster response, lower = more stable RPM) Tune.InclineComp = 1 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--[[Susupension]]
Tune.SusEnabled = true -- Sets whether suspension is enabled for PGS --Front Suspension Tune.FSusStiffness = 25000 -- Spring Force Tune.FSusDamping = 400 -- Spring Dampening Tune.FAntiRoll = 400 -- Anti-Roll (Gyro Dampening) Tune.FSusLength = 1.9 -- Resting Suspension length (in studs) Tune.FPreCompress = .1 -- Pre-compression adds resting length force Tune.FExtensionLim = .4 -- Max Extension Travel (in studs) Tune.FCompressLim = .2 -- Max Compression Travel (in studs) Tune.FSusAngle = 75 -- Suspension Angle (degrees from horizontal) Tune.FWsBoneLen = 5 -- Wishbone Length Tune.FWsBoneAngle = 2 -- Wishbone angle (degrees from horizontal) Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward --Rear Suspension Tune.RSusStiffness = 20000 -- Spring Force Tune.RSusDamping = 400 -- Spring Dampening Tune.RAntiRoll = 400 -- Anti-Roll (Gyro Dampening) Tune.RSusLength = 2.1 -- Resting Suspension length (in studs) Tune.RPreCompress = .1 -- Pre-compression adds resting length force Tune.RExtensionLim = .4 -- Max Extension Travel (in studs) Tune.RCompressLim = .2 -- Max Compression Travel (in studs) Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal) Tune.RWsBoneLen = 5 -- Wishbone Length Tune.RWsBoneAngle = 2 -- Wishbone angle (degrees from horizontal) Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward --Aesthetics (PGS ONLY) Tune.SusVisible = true -- Spring Visible Tune.WsBVisible = false -- Wishbone Visible Tune.SusRadius = .2 -- Suspension Coil Radius Tune.SusThickness = .1 -- Suspension Coil Thickness Tune.SusColor = "Red" -- Suspension Color [BrickColor] Tune.SusCoilCount = 8 -- Suspension Coil Count Tune.WsColor = "Black" -- Wishbone Color [BrickColor] Tune.WsThickness = .1 -- Wishbone Rod Thickness
--[[ Public API ]]
-- function KeyboardMovement:Enable() if not UserInputService.KeyboardEnabled then return end local forwardValue = 0 local backwardValue = 0 local leftValue = 0 local rightValue = 0 local updateMovement = function(inputState) if inputState == Enum.UserInputState.Cancel then MasterControl:AddToPlayerMovement(-currentMoveVector) currentMoveVector = Vector3.new(0, 0, 0) else MasterControl:AddToPlayerMovement(-currentMoveVector) currentMoveVector = Vector3.new(leftValue + rightValue,0,forwardValue + backwardValue) MasterControl:AddToPlayerMovement(currentMoveVector) end end local moveForwardFunc = function(actionName, inputState, inputObject) if inputState == Enum.UserInputState.Begin then forwardValue = -1 elseif inputState == Enum.UserInputState.End then forwardValue = 0 end updateMovement(inputState) end local moveBackwardFunc = function(actionName, inputState, inputObject) if inputState == Enum.UserInputState.Begin then backwardValue = 1 elseif inputState == Enum.UserInputState.End then backwardValue = 0 end updateMovement(inputState) end local moveLeftFunc = function(actionName, inputState, inputObject) if inputState == Enum.UserInputState.Begin then leftValue = -1 elseif inputState == Enum.UserInputState.End then leftValue = 0 end updateMovement(inputState) end local moveRightFunc = function(actionName, inputState, inputObject) if inputState == Enum.UserInputState.Begin then rightValue = 1 elseif inputState == Enum.UserInputState.End then rightValue = 0 end updateMovement(inputState) end local jumpFunc = function(actionName, inputState, inputObject) MasterControl:SetIsJumping(inputState == Enum.UserInputState.Begin) end -- TODO: remove up and down arrows, these seem unnecessary ContextActionService:BindActionToInputTypes("forwardMovement", moveForwardFunc, false, Enum.PlayerActions.CharacterForward) ContextActionService:BindActionToInputTypes("backwardMovement", moveBackwardFunc, false, Enum.PlayerActions.CharacterBackward) ContextActionService:BindActionToInputTypes("leftMovement", moveLeftFunc, false, Enum.PlayerActions.CharacterLeft) ContextActionService:BindActionToInputTypes("rightMovement", moveRightFunc, false, Enum.PlayerActions.CharacterRight) ContextActionService:BindActionToInputTypes("jumpAction", jumpFunc, false, Enum.PlayerActions.CharacterJump) -- TODO: make sure we check key state before binding to check if key is already down local function onFocusReleased() local humanoid = getHumanoid() if humanoid then MasterControl:AddToPlayerMovement(-currentMoveVector) currentMoveVector = Vector3.new(0, 0, 0) forwardValue, backwardValue, leftValue, rightValue = 0, 0, 0, 0 MasterControl:SetIsJumping(false) end end local function onTextFocusGained(textboxFocused) MasterControl:SetIsJumping(false) end SeatJumpCn = UserInputService.InputBegan:connect(function(inputObject, isProcessed) if inputObject.KeyCode == Enum.KeyCode.Backspace and not isProcessed then local humanoid = getHumanoid() if humanoid and (humanoid.Sit or humanoid.PlatformStand) then MasterControl:DoJump() end end end) TextFocusReleasedCn = UserInputService.TextBoxFocusReleased:connect(onFocusReleased) TextFocusGainedCn = UserInputService.TextBoxFocused:connect(onTextFocusGained) -- TODO: remove pcall when API is live WindowFocusReleasedCn = UserInputService.WindowFocused:connect(onFocusReleased) end function KeyboardMovement:Disable() ContextActionService:UnbindAction("forwardMovement") ContextActionService:UnbindAction("backwardMovement") ContextActionService:UnbindAction("leftMovement") ContextActionService:UnbindAction("rightMovement") ContextActionService:UnbindAction("jumpAction") if SeatJumpCn then SeatJumpCn:disconnect() SeatJumpCn = nil end if TextFocusReleasedCn then TextFocusReleasedCn:disconnect() TextFocusReleasedCn = nil end if TextFocusGainedCn then TextFocusGainedCn:disconnect() TextFocusGainedCn = nil end if WindowFocusReleasedCn then WindowFocusReleasedCn:disconnect() WindowFocusReleasedCn = nil end MasterControl:AddToPlayerMovement(-currentMoveVector) currentMoveVector = Vector3.new(0,0,0) MasterControl:SetIsJumping(false) end return KeyboardMovement
--returns a table of vector3s that represent the corners of any given part
function RoomPackager:CornersOfPart(part) local cframe = part.CFrame local halfSizeX = part.Size.X / 2 local halfSizeY = part.Size.Y / 2 local halfSizeZ = part.Size.Z / 2 local corners = { RightTopBack = cframe:pointToWorldSpace(Vector3.new(halfSizeX, halfSizeY, halfSizeZ)), RightBottomBack = cframe:pointToWorldSpace(Vector3.new(halfSizeX, -halfSizeY, halfSizeZ)), RightTopFront = cframe:pointToWorldSpace(Vector3.new(halfSizeX, halfSizeY, -halfSizeZ)), RightBottomFront = cframe:pointToWorldSpace(Vector3.new(halfSizeX, -halfSizeY, -halfSizeZ)), LeftTopBack = cframe:pointToWorldSpace(Vector3.new(-halfSizeX, halfSizeY, halfSizeZ)), LeftBottomBack = cframe:pointToWorldSpace(Vector3.new(-halfSizeX, -halfSizeY, halfSizeZ)), LeftTopFront = cframe:pointToWorldSpace(Vector3.new(-halfSizeX, halfSizeY, -halfSizeZ)), LeftBottomFront = cframe:pointToWorldSpace(Vector3.new(-halfSizeX, -halfSizeY, -halfSizeZ)), } return corners end
-- Gets a part from the cache, or creates one if no more are available.
function PartCacheStatic:GetPart(): BasePart assert(getmetatable(self) == PartCacheStatic, ERR_NOT_INSTANCE:format("GetPart", "PartCache.new")) if #self.Open == 0 then --warn("No parts available in the cache! Creating [" .. self.ExpansionSize .. "] new part instance(s) - this amount can be edited by changing the ExpansionSize property of the PartCache instance... (This cache now contains a grand total of " .. tostring(#self.Open + #self.InUse + self.ExpansionSize) .. " parts.)") for i = 1, self.ExpansionSize, 1 do table.insert(self.Open, MakeFromTemplate(self.Template, self.CurrentCacheParent)) end end local part = self.Open[#self.Open] self.Open[#self.Open] = nil table.insert(self.InUse, part) return part end
--[[ Attempts to get the default value of a given property on a Roblox instance. This is used by the reconciler in cases where a prop was previously set on a primitive component, but is no longer present in a component's new props. Eventually, Roblox might provide a nicer API to query the default property of an object without constructing an instance of it. ]]
local Symbol = require(script.Parent.Symbol) local Nil = Symbol.named("Nil") local _cachedPropertyValues = {} local function getDefaultInstanceProperty(className, propertyName) local classCache = _cachedPropertyValues[className] if classCache then local propValue = classCache[propertyName] -- We have to use a marker here, because Lua doesn't distinguish -- between 'nil' and 'not in a table' if propValue == Nil then return true, nil end if propValue ~= nil then return true, propValue end else classCache = {} _cachedPropertyValues[className] = classCache end local created = Instance.new(className) local ok, defaultValue = pcall(function() return created[propertyName] end) created:Destroy() if ok then if defaultValue == nil then classCache[propertyName] = Nil else classCache[propertyName] = defaultValue end end return ok, defaultValue end return getDefaultInstanceProperty
--[[ The Module ]]
-- local TransparencyController = {} TransparencyController.__index = TransparencyController function TransparencyController.new() local self = setmetatable({}, TransparencyController) self.lastUpdate = tick() self.transparencyDirty = false self.enabled = false self.lastTransparency = nil self.descendantAddedConn, self.descendantRemovingConn = nil, nil self.toolDescendantAddedConns = {} self.toolDescendantRemovingConns = {} self.cachedParts = {} return self end function TransparencyController:HasToolAncestor(object) if object.Parent == nil then return false end return object.Parent:IsA('Tool') or self:HasToolAncestor(object.Parent) end function TransparencyController:IsValidPartToModify(part) if part:IsA('BasePart') or part:IsA('Decal') then return not self:HasToolAncestor(part) end return false end function TransparencyController:CachePartsRecursive(object) if object then if self:IsValidPartToModify(object) then self.cachedParts[object] = true self.transparencyDirty = true end for _, child in pairs(object:GetChildren()) do self:CachePartsRecursive(child) end end end function TransparencyController:TeardownTransparency() for child, _ in pairs(self.cachedParts) do child.LocalTransparencyModifier = 0 end self.cachedParts = {} self.transparencyDirty = true self.lastTransparency = nil if self.descendantAddedConn then self.descendantAddedConn:disconnect() self.descendantAddedConn = nil end if self.descendantRemovingConn then self.descendantRemovingConn:disconnect() self.descendantRemovingConn = nil end for object, conn in pairs(self.toolDescendantAddedConns) do conn:Disconnect() self.toolDescendantAddedConns[object] = nil end for object, conn in pairs(self.toolDescendantRemovingConns) do conn:Disconnect() self.toolDescendantRemovingConns[object] = nil end end function TransparencyController:SetupTransparency(character) self:TeardownTransparency() if self.descendantAddedConn then self.descendantAddedConn:disconnect() end self.descendantAddedConn = character.DescendantAdded:Connect(function(object) -- This is a part we want to invisify if self:IsValidPartToModify(object) then self.cachedParts[object] = true self.transparencyDirty = true -- There is now a tool under the character elseif object:IsA('Tool') then if self.toolDescendantAddedConns[object] then self.toolDescendantAddedConns[object]:Disconnect() end self.toolDescendantAddedConns[object] = object.DescendantAdded:Connect(function(toolChild) self.cachedParts[toolChild] = nil if toolChild:IsA('BasePart') or toolChild:IsA('Decal') then -- Reset the transparency toolChild.LocalTransparencyModifier = 0 end end) if self.toolDescendantRemovingConns[object] then self.toolDescendantRemovingConns[object]:disconnect() end self.toolDescendantRemovingConns[object] = object.DescendantRemoving:Connect(function(formerToolChild) wait() -- wait for new parent if character and formerToolChild and formerToolChild:IsDescendantOf(character) then if self:IsValidPartToModify(formerToolChild) then self.cachedParts[formerToolChild] = true self.transparencyDirty = true end end end) end end) if self.descendantRemovingConn then self.descendantRemovingConn:disconnect() end self.descendantRemovingConn = character.DescendantRemoving:connect(function(object) if self.cachedParts[object] then self.cachedParts[object] = nil -- Reset the transparency object.LocalTransparencyModifier = 0 end end) self:CachePartsRecursive(character) end function TransparencyController:Enable(enable) if self.enabled ~= enable then self.enabled = enable self:Update() end end function TransparencyController:SetSubject(subject) local character = nil if subject and subject:IsA("Humanoid") then character = subject.Parent end if subject and subject:IsA("VehicleSeat") and subject.Occupant then character = subject.Occupant.Parent end if character then self:SetupTransparency(character) else self:TeardownTransparency() end end function TransparencyController:Update() local instant = false local now = tick() local currentCamera = workspace.CurrentCamera if currentCamera then local transparency = 0 if not self.enabled then instant = true else local distance = (currentCamera.Focus.p - currentCamera.CoordinateFrame.p).magnitude transparency = (distance<2) and (1.0-(distance-0.5)/1.5) or 0 --(7 - distance) / 5 if transparency < 0.5 then transparency = 0 end if self.lastTransparency then local deltaTransparency = transparency - self.lastTransparency -- Don't tween transparency if it is instant or your character was fully invisible last frame if not instant and transparency < 1 and self.lastTransparency < 0.95 then local maxDelta = MAX_TWEEN_RATE * (now - self.lastUpdate) deltaTransparency = math.clamp(deltaTransparency, -maxDelta, maxDelta) end transparency = self.lastTransparency + deltaTransparency else self.transparencyDirty = true end transparency = math.clamp(Util.Round(transparency, 2), 0, 1) end if self.transparencyDirty or self.lastTransparency ~= transparency then for child, _ in pairs(self.cachedParts) do child.LocalTransparencyModifier = _G.COFF and 1 or transparency end self.transparencyDirty = false self.lastTransparency = transparency end end self.lastUpdate = now end return TransparencyController
--W8 = script.Parent.WaterSwirl8.ParticleEmitter --Clicks = script.Parent.Sensor.Beep
script.Parent.Pushed.Disabled = true
----------------- --| Variables |-- -----------------
local DebrisService = game:GetService('Debris') local PlayersService = game:GetService('Players') local Rocket = script.Parent local CreatorTag = Rocket:WaitForChild('creator', 60) local SwooshSound = Rocket:WaitForChild('Swoosh', 60)
-- NOTE: This will fire for ControlMode when the settings menu is closed. If ControlMode is -- MouseLockSwitch on settings close, it will change the mode to Classic, then to ShiftLockSwitch. -- This is a silly hack, but needed to raise an event when the settings menu closes.
GameSettings.Changed:connect(function(property) if property == 'ControlMode' then if GameSettings.ControlMode == Enum.ControlMode.MouseLockSwitch then enableShiftLock() else disableShiftLock() end elseif property == 'ComputerMovementMode' then if GameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove then disableShiftLock() else enableShiftLock() end end end) LocalPlayer.Changed:connect(function(property) if property == 'DevEnableMouseLock' then if LocalPlayer.DevEnableMouseLock then enableShiftLock() else disableShiftLock() end elseif property == 'DevComputerMovementMode' then if LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.ClickToMove or LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.Scriptable then -- disableShiftLock() else enableShiftLock() end end end) LocalPlayer.CharacterAdded:connect(function(character) -- we need to recreate guis on character load if not UserInputService.TouchEnabled then initialize() end end)
----[UPDATE RGB SLIDERS]----
local function UpdateRGBSliders(z) for i = 1,#RGBSliders[z] do RGBSliders[z][i].Position = UDim2.new(0, PreviewColor[z].BackgroundColor3[rgb[i]] * RGBSliderHitboxes[z][i].AbsoluteSize.X, RGBSliders[z][i].Position.Y.Scale, 0) RGBInputs[z][i].Text = math.floor(PreviewColor[z].BackgroundColor3[rgb[i]] * 255) end end
--Made by Stickmasterluke
sp = script.Parent speedboost = 4 --100% speed bonus speedforsmoke = math.huge --smoke apears when character running >= 10 studs/second. local tooltag = script:WaitForChild("ToolTag",2) if tooltag~=nil then local tool=tooltag.Value local h=sp:FindFirstChild("Humanoid") if h~=nil then h.WalkSpeed=16+16*speedboost local hrp = sp:FindFirstChild("HumanoidRootPart") if hrp ~= nil then smokepart=Instance.new("Part") smokepart.FormFactor="Custom" smokepart.Size=Vector3.new(0,0,0) smokepart.TopSurface="Smooth" smokepart.BottomSurface="Smooth" smokepart.CanCollide=false smokepart.Transparency=1 local weld=Instance.new("Weld") weld.Name="SmokePartWeld" weld.Part0 = hrp weld.Part1=smokepart weld.C0=CFrame.new(0,-3.5,0)*CFrame.Angles(math.pi/4,0,0) weld.Parent=smokepart smokepart.Parent=sp smoke=Instance.new("Smoke") smoke.Enabled = hrp.Velocity.magnitude>speedforsmoke smoke.RiseVelocity=2 smoke.Opacity=.25 smoke.Size=.5 smoke.Parent=smokepart h.Running:connect(function(speed) if smoke and smoke~=nil then smoke.Enabled=speed>speedforsmoke end end) end end while tool~=nil and tool.Parent==sp and h~=nil do sp.ChildRemoved:wait() end local h=sp:FindFirstChild("Humanoid") if h~=nil then h.WalkSpeed=16 end end if smokepart~=nil then smokepart:Destroy() end script:Destroy()
--MainScriptValues
local Color = Color3.fromRGB(0, 255, 0) local Screen1 = script.Parent.Digit1Panel.Screen local AddButton1 = script.Parent.Digit1Panel.AddButton local SubtractButton1 = script.Parent.Digit1Panel.SubtractButton local Screen2 = script.Parent.Digit2Panel.Screen local AddButton2 = script.Parent.Digit2Panel.AddButton local SubtractButton2 = script.Parent.Digit2Panel.SubtractButton local Screen3 = script.Parent.Digit3Panel.Screen local AddButton3 = script.Parent.Digit3Panel.AddButton local SubtractButton3 = script.Parent.Digit3Panel.SubtractButton local Size = Vector3.new(0.175, 1, 1) local Material = "Metal"
-- GROUPS
Groups = { [0] = { [254] = "Admin";chin1091 [1] = "VIP"; }; }; -- FRIENDS Friends = "NonAdmin"; -- VIP SERVER OWNER VipServerOwner = "NonAdmin"; -- FREE ADMIN FreeAdmin = "NonAdmin"; --------------| BANLAND |-------------- Banned = {"",0}; --------------| SYSTEM SETTINGS |-------------- Prefix = ";"; -- The character you use before every command (e.g. ';jump me'). SplitKey = " "; -- The character inbetween command arguments (e.g. setting it to '/' would change ';jump me' to ';jump/me'). BatchKey = ""; -- The character inbetween batch commands (e.g. setting it to '|' would change ';jump me ;fire me ;smoke me' to ';jump me | ;fire me | ;smoke me' QualifierBatchKey = ","; -- The character used to split up qualifiers (e.g. ;jump player1,player2,player3) Theme = "Blue"; -- The default UI theme. NoticeSoundId = 2865227271; -- The SoundId for notices. NoticeVolume = 0.1; -- The Volume for notices. NoticePitch = 1; -- The Pitch/PlaybackSpeed for notices. ErrorSoundId = 2865228021; -- The SoundId for error notifications. ErrorVolume = 0.1; -- The Volume for error notifications. ErrorPitch = 1; -- The Pitch/PlaybackSpeed for error notifications. AlertSoundId = 3140355872; -- The SoundId for alerts. AlertVolume = 0.5; -- The Volume for alerts. AlertPitch = 1; -- The Pitch/PlaybackSpeed for alerts. WelcomeBadgeId = 0; -- Award new players a badge, such as 'Welcome to the game!'. Set to 0 for no badge. CommandDebounce = true; -- Wait until the command effect is over to use again. Helps to limit abuse & lag. Set to 'false' to disable. SaveRank = true; -- Saves a player's rank in the server they received it. (e.g. ;rank plrName rank). Use ';permRank plrName rank' to permanently save a rank. Set to 'false' to disable. LoopCommands = 3; -- The minimum rank required to use LoopCommands. MusicList = {505757009,}; -- Songs which automatically appear in a user's radio. Type '!radio' to display the radio. ThemeColors = { -- The colours players can set their HD Admin UI (in the 'Settings' menu). | Format: {ThemeName, ThemeColor3Value}; {"Red", Color3.fromRGB(150, 0, 0), }; {"Orange", Color3.fromRGB(150, 75, 0), }; {"Brown", Color3.fromRGB(120, 80, 30), }; {"Yellow", Color3.fromRGB(130, 120, 0), }; {"Green", Color3.fromRGB(0, 120, 0), }; {"Blue", Color3.fromRGB(0, 100, 150), }; {"Purple", Color3.fromRGB(100, 0, 150), }; {"Pink", Color3.fromRGB(150, 0, 100), }; {"Black", Color3.fromRGB(60, 60, 60), }; }; Colors = { -- The colours for ChatColors and command arguments. | Format: {"ShortName", "FullName", Color3Value}; {"r", "Red", Color3.fromRGB(255, 0, 0) }; {"o", "Orange", Color3.fromRGB(250, 100, 0) }; {"y", "Yellow", Color3.fromRGB(255, 255, 0) }; {"g", "Green" , Color3.fromRGB(0, 255, 0) }; {"dg", "DarkGreen" , Color3.fromRGB(0, 125, 0) }; {"b", "Blue", Color3.fromRGB(0, 255, 255) }; {"db", "DarkBlue", Color3.fromRGB(0, 50, 255) }; {"p", "Purple", Color3.fromRGB(150, 0, 255) }; {"pk", "Pink", Color3.fromRGB(255, 85, 185) }; {"bk", "Black", Color3.fromRGB(0, 0, 0) }; {"w", "White", Color3.fromRGB(255, 255, 255) }; }; ChatColors = { -- The colour a player's chat will appear depending on their rank. '["Owner"] = "Yellow";' makes the owner's chat yellow. [5] = "Yellow"; }; Cmdbar = 1; -- The minimum rank required to use the Cmdbar. Cmdbar2 = 3; -- The minimum rank required to use the Cmdbar2. ViewBanland = 3; -- The minimum rank required to view the banland. OnlyShowUsableCommands = false; -- Only display commands equal to or below the user's rank on the Commands page. RankRequiredToViewPage = { -- || The pages on the main menu || ["Commands"] = 0; ["Admin"] = 0; ["Settings"] = 0; }; RankRequiredToViewRank = { -- || The rank categories on the 'Ranks' subPage under Admin || ["Owner"] = 0; ["HeadAdmin"] = 0; ["Admin"] = 0; ["Mod"] = 0; ["VIP"] = 0; }; RankRequiredToViewRankType = { -- || The collection of loader-rank-rewarders on the 'Ranks' subPage under Admin || ["Owner"] = 0; ["SpecificUsers"] = 5; ["Gamepasses"] = 0; ["Assets"] = 0; ["Groups"] = 0; ["Friends"] = 0; ["FreeAdmin"] = 0; ["VipServerOwner"] = 0; }; RankRequiredToViewIcon = 0; WelcomeRankNotice = true; -- The 'You're a [rankName]' notice that appears when you join the game. Set to false to disable. WelcomeDonorNotice = true; -- The 'You're a Donor' notice that appears when you join the game. Set to false to disable. WarnIncorrectPrefix = true; -- Warn the user if using the wrong prefix | "Invalid prefix! Try using [correctPrefix][commandName] instead!" DisableAllNotices = false; -- Set to true to disable all HD Admin notices. ScaleLimit = 4; -- The maximum size players with a rank lower than 'IgnoreScaleLimit' can scale theirself. For example, players will be limited to ;size me 4 (if limit is 4) - any number above is blocked. IgnoreScaleLimit = 3; -- Any ranks equal or above this value will ignore 'ScaleLimit' CommandLimits = { -- Enables you to set limits for commands which have a number argument. Ranks equal to or higher than 'IgnoreLimit' will not be affected by Limit. ["fly"] = { Limit = 10000; IgnoreLimit = 3; }; ["fly2"] = { Limit = 10000; IgnoreLimit = 3; }; ["noclip"] = { Limit = 10000; IgnoreLimit = 3; }; ["noclip2"] = { Limit = 10000; IgnoreLimit = 3; }; ["speed"] = { Limit = 10000; IgnoreLimit = 3; }; ["jumpPower"] = { Limit = 10000; IgnoreLimit = 3; }; }; VIPServerCommandBlacklist = {"permRank", "permBan", "globalAnnouncement"}; -- Commands players are probihited from using in VIP Servers. GearBlacklist = {67798397}; -- The IDs of gear items to block when using the ;gear command. IgnoreGearBlacklist = 4; -- The minimum rank required to ignore the gear blacklist. PlayerDataStoreVersion = "V1.0"; -- Data about the player (i.e. permRanks, custom settings, etc). Changing the Version name will reset all PlayerData. SystemDataStoreVersion = "V1.0"; -- Data about the game (i.e. the banland, universal message system, etc). Changing the Version name will reset all SystemData. CoreNotices = { -- Modify core notices. You can find a table of all CoreNotices under [MainModule > Client > SharedModules > CoreNotices] --NoticeName = NoticeDetails; }; --------------| MODIFY COMMANDS |-------------- SetCommandRankByName = { --["jump"] = "VIP"; }; SetCommandRankByTag = { --["abusive"] = "Admin"; }; };
-- / world / --
local world = workspace.World local assets = world.Assets local papers = assets.Papers local audios = world.Audios
--Tune
local WheelieButton = "T" local DeadZone = 380
---------------------------------------------------------------------------------------------------- --------------------=[ OUTROS ]=-------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
,FastReload = true --- Automatically operates the bolt on reload if needed ,SlideLock = true ,MoveBolt = false ,BoltLock = false ,CanBreachDoor = false ,CanBreak = false --- Weapon can jam? ,JamChance = 1000 --- This old piece of brick doesn't work fine >;c ,IncludeChamberedBullet = true --- Include the chambered bullet on next reload ,Chambered = false --- Start with the gun chambered? ,LauncherReady = false --- Start with the GL ready? ,CanCheckMag = true --- You can check the magazine ,ArcadeMode = false --- You can see the bullets left in magazine ,RainbowMode = false --- Operation: Party Time xD ,ModoTreino = false --- Surrender enemies instead of killing them ,GunSize = 4.5 ,GunFOVReduction = 5 ,BoltExtend = Vector3.new(0, 0, 0.4) ,SlideExtend = Vector3.new(0, -0.03, 0.4)
--[=[ Observes for the key @param key TKey @param retrieveInitialValue callback -- Optional @return Observable<TEmit> ]=]
function ObservableSubscriptionTable:Observe(key, retrieveInitialValue) assert(key ~= nil, "Bad key") return Observable.new(function(sub) if not self._subMap[key] then self._subMap[key] = { sub } else table.insert(self._subMap[key], sub) end if retrieveInitialValue then retrieveInitialValue(sub) end return function() if not self._subMap[key] then return end local current = self._subMap[key] local index = table.find(current, sub) if not index then return end table.remove(current, index) if #current == 0 then self._subMap[key] = nil end -- Complete the subscription if sub:IsPending() then task.spawn(function() sub:Complete() end) end end end) end
--[[Engine]]
--Torque Curve Tune.Horsepower = 213 -- [TORQUE CURVE VISUAL] Tune.IdleRPM = 800 -- https://www.desmos.com/calculator/2uo3hqwdhf Tune.PeakRPM = 8000 -- Use sliders to manipulate values Tune.Redline = 9000 -- Copy and paste slider values into the respective tune values Tune.EqPoint = 6100 Tune.PeakSharpness = 3.8 Tune.CurveMult = 0.07 --Incline Compensation Tune.InclineComp = 1.5 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees) --Misc Tune.RevAccel = 900 -- RPM acceleration when clutch is off Tune.RevDecay = 450 -- RPM decay when clutch is off Tune.RevBounce = 500 -- RPM kickback from redline Tune.IdleThrottle = 0 -- Percent throttle at idle Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
------------------------------------------------------------------------ -- -- * used in (lparser) luaY:assignment(), luaY:localfunc(), luaY:funcstat() ------------------------------------------------------------------------
function luaK:storevar(fs, var, ex) local k = var.k if k == "VLOCAL" then self:freeexp(fs, ex) self:exp2reg(fs, ex, var.info) return elseif k == "VUPVAL" then local e = self:exp2anyreg(fs, ex) self:codeABC(fs, "OP_SETUPVAL", e, var.info, 0) elseif k == "VGLOBAL" then local e = self:exp2anyreg(fs, ex) self:codeABx(fs, "OP_SETGLOBAL", e, var.info) elseif k == "VINDEXED" then local e = self:exp2RK(fs, ex) self:codeABC(fs, "OP_SETTABLE", var.info, var.aux, e) else assert(0) -- invalid var kind to store end self:freeexp(fs, ex) end
--Rescripted by Luckymaxer
Tool = script.Parent Handle = Tool:WaitForChild("Handle") Players = game:GetService("Players") Debris = game:GetService("Debris") Speed = 300 Duration = 50 NozzleOffset = Vector3.new(0, 0.4, -1.1) Sounds = { Fire = Handle:WaitForChild("Fire"), Reload = Handle:WaitForChild("Reload"), HitFade = Handle:WaitForChild("HitFade") } PointLight = Handle:WaitForChild("PointLight") ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction")) ServerControl.Name = "ServerControl" ServerControl.Parent = Tool ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction")) ClientControl.Name = "ClientControl" ClientControl.Parent = Tool ServerControl.OnServerInvoke = (function(player, Mode, Value, arg) if player ~= Player or Humanoid.Health == 0 or not Tool.Enabled then return end if Mode == "Click" and Value then Activated(arg) end end) function InvokeClient(Mode, Value) pcall(function() ClientControl:InvokeClient(Player, Mode, Value) end) end function TagHumanoid(humanoid, player) local Creator_Tag = Instance.new("ObjectValue") Creator_Tag.Name = "creator" Creator_Tag.Value = player Debris:AddItem(Creator_Tag, 2) Creator_Tag.Parent = humanoid end function UntagHumanoid(humanoid) for i, v in pairs(humanoid:GetChildren()) do if v:IsA("ObjectValue") and v.Name == "creator" then v:Destroy() end end end function FindCharacterAncestor(Parent) if Parent and Parent ~= game:GetService("Workspace") then local humanoid = Parent:FindFirstChild("Humanoid") if humanoid then return Parent, humanoid else return FindCharacterAncestor(Parent.Parent) end end return nil end function GetTransparentsRecursive(Parent, PartsTable) local PartsTable = (PartsTable or {}) for i, v in pairs(Parent:GetChildren()) do local TransparencyExists = false pcall(function() local Transparency = v["Transparency"] if Transparency then TransparencyExists = true end end) if TransparencyExists then table.insert(PartsTable, v) end GetTransparentsRecursive(v, PartsTable) end return PartsTable end function SelectionBoxify(Object) local SelectionBox = Instance.new("SelectionBox") SelectionBox.Adornee = Object SelectionBox.Color = BrickColor.new("Really red") SelectionBox.Parent = Object return SelectionBox end local function Light(Object) local Light = PointLight:Clone() Light.Range = (Light.Range + 2) Light.Parent = Object end function FadeOutObjects(Objects, FadeIncrement) repeat local LastObject = nil for i, v in pairs(Objects) do v.Transparency = (v.Transparency + FadeIncrement) LastObject = v end wait() until LastObject.Transparency >= 1 or not LastObject end function Dematerialize(character, humanoid, FirstPart) if not character or not humanoid then return end humanoid.WalkSpeed = 0 local Parts = {} for i, v in pairs(character:GetChildren()) do if v:IsA("BasePart") then v.Anchored = true table.insert(Parts, v) elseif v:IsA("LocalScript") or v:IsA("Script") then v:Destroy() end end local SelectionBoxes = {} local FirstSelectionBox = SelectionBoxify(FirstPart) Light(FirstPart) wait(0.05) for i, v in pairs(Parts) do if v ~= FirstPart then table.insert(SelectionBoxes, SelectionBoxify(v)) Light(v) end end local ObjectsWithTransparency = GetTransparentsRecursive(character) FadeOutObjects(ObjectsWithTransparency, 0.1) wait(0.5) character:BreakJoints() humanoid.Health = 0 Debris:AddItem(character, 2) local FadeIncrement = 0.05 Delay(0.2, function() FadeOutObjects({FirstSelectionBox}, FadeIncrement) if character and character.Parent then character:Destroy() end end) FadeOutObjects(SelectionBoxes, FadeIncrement) end function Touched(Projectile, Hit) if not Hit or not Hit.Parent then return end local character, humanoid = FindCharacterAncestor(Hit) if character and humanoid and character ~= Character then local ForceFieldExists = false for i, v in pairs(character:GetChildren()) do if v:IsA("ForceField") then ForceFieldExists = true end end if not ForceFieldExists then if Projectile then local HitFadeSound = Projectile:FindFirstChild(Sounds.HitFade.Name) local torso = humanoid.Torso if HitFadeSound and torso then HitFadeSound.Parent = torso HitFadeSound:Play() end end Dematerialize(character, humanoid, Hit) end if Projectile and Projectile.Parent then Projectile:Destroy() end end end function Equipped() Character = Tool.Parent Player = Players:GetPlayerFromCharacter(Character) Humanoid = Character:FindFirstChild("Humanoid") if not Player or not Humanoid or Humanoid.Health == 0 then return end end function Activated(target) if Tool.Enabled and Humanoid.Health > 0 then Tool.Enabled = false InvokeClient("PlaySound", Sounds.Fire) local HandleCFrame = Handle.CFrame local FiringPoint = HandleCFrame.p + HandleCFrame:vectorToWorldSpace(NozzleOffset) local ShotCFrame = CFrame.new(FiringPoint, target) local LaserShotClone = BaseShot:Clone() LaserShotClone.CFrame = ShotCFrame + (ShotCFrame.lookVector * (BaseShot.Size.Z / 2)) local BodyVelocity = Instance.new("BodyVelocity") BodyVelocity.velocity = ShotCFrame.lookVector * Speed BodyVelocity.Parent = LaserShotClone LaserShotClone.Touched:connect(function(Hit) if not Hit or not Hit.Parent then return end Touched(LaserShotClone, Hit) end) Debris:AddItem(LaserShotClone, Duration) LaserShotClone.Parent = game:GetService("Workspace") wait(0.01) -- FireSound length InvokeClient("PlaySound", Sounds.Reload) wait(0.01) -- ReloadSound length Tool.Enabled = true end end function Unequipped() end BaseShot = Instance.new("Part") BaseShot.Name = "Effect" BaseShot.BrickColor = BrickColor.new("Really red") BaseShot.Material = Enum.Material.Plastic BaseShot.Shape = Enum.PartType.Block BaseShot.TopSurface = Enum.SurfaceType.Smooth BaseShot.BottomSurface = Enum.SurfaceType.Smooth BaseShot.FormFactor = Enum.FormFactor.Custom BaseShot.Size = Vector3.new(0.2, 0.2, 3) BaseShot.CanCollide = false BaseShot.Locked = true SelectionBoxify(BaseShot) Light(BaseShot) BaseShotSound = Sounds.HitFade:Clone() BaseShotSound.Parent = BaseShot Tool.Equipped:connect(Equipped) Tool.Unequipped:connect(Unequipped)
------------------------------------------------------------------------ -- general function to write an instruction into the instruction buffer, -- sets debug information too -- * used in luaK:codeABC(), luaK:codeABx() -- * called directly by (lparser) luaY:whilestat() ------------------------------------------------------------------------
function luaK:code(fs, i, line) local f = fs.f self:dischargejpc(fs) -- 'pc' will change -- put new instruction in code array luaY:growvector(fs.L, f.code, fs.pc, f.sizecode, nil, luaY.MAX_INT, "code size overflow") f.code[fs.pc] = i -- save corresponding line information luaY:growvector(fs.L, f.lineinfo, fs.pc, f.sizelineinfo, nil, luaY.MAX_INT, "code size overflow") f.lineinfo[fs.pc] = line local pc = fs.pc fs.pc = fs.pc + 1 return pc end
--wait1 = math.random(0.5,2) --wait2 = math.random(1,2) -- the purpose of these two math variables is to make a higher chance of waiting longer --local WaitTimeB = wait1 * wait2
--[=[ @return Keyboard Constructs a new keyboard input capturer. ```lua local keyboard = Keyboard.new() ``` ]=]
function Keyboard.new() local self = setmetatable({}, Keyboard) self._trove = Trove.new() self.KeyDown = self._trove:Construct(Signal) self.KeyUp = self._trove:Construct(Signal) self:_setup() return self end
-- {Id = "slash.xml", Weight = 10},
}, ToolLunge = { {Id = "http://www.roblox.com/asset/?id=129967478", Weight = 10}, }, Wave = { {Id = "http://www.roblox.com/asset/?id=128777973", Weight = 10}, }, Point = { {Id = "http://www.roblox.com/asset/?id=128853357", Weight = 10}, }, Dance = { {Id = "http://www.roblox.com/asset/?id=130018893", Weight = 10}, {Id = "http://www.roblox.com/asset/?id=132546839", Weight = 10}, {Id = "http://www.roblox.com/asset/?id=132546884", Weight = 10}, }, Dance2 = { {Id = "http://www.roblox.com/asset/?id=160934142", Weight = 10}, {Id = "http://www.roblox.com/asset/?id=160934298", Weight = 10}, {Id = "http://www.roblox.com/asset/?id=160934376", Weight = 10}, }, Dance3 = { {Id = "http://www.roblox.com/asset/?id=160934458", Weight = 10}, {Id = "http://www.roblox.com/asset/?id=160934530", Weight = 10}, {Id = "http://www.roblox.com/asset/?id=160934593", Weight = 10}, }, Laugh = { {Id = "http://www.roblox.com/asset/?id=129423131", Weight = 10}, }, Cheer = { {Id = "http://www.roblox.com/asset/?id=129423030", Weight = 10}, }, }
-- Container for temporary connections (disconnected automatically)
local Connections = {}; function NewPartTool.Equip() -- Enables the tool's equipped functionality -- Start up our interface ShowUI(); EnableClickCreation(); -- Set our current type SetType(NewPartTool.Type); end; function NewPartTool.Unequip() -- Disables the tool's equipped functionality -- Clear unnecessary resources HideUI(); ClearConnections(); ContextActionService:UnbindAction('BT: Create part') end; function ClearConnections() -- Clears out temporary connections for ConnectionKey, Connection in pairs(Connections) do Connection:Disconnect(); Connections[ConnectionKey] = nil; end; end; function ShowUI() -- Creates and reveals the UI -- Reveal UI if already created if UI then -- Reveal the UI UI.Visible = true; -- Skip UI creation return; end; -- Create the UI UI = Core.Tool.Interfaces.BTNewPartToolGUI:Clone(); UI.Parent = Core.UI; UI.Visible = true; -- Creatable part types Types = { 'Normal', 'Truss', 'Wedge', 'Corner', 'Cylinder', 'Ball', 'Seat', 'Vehicle Seat', 'Spawn' }; -- Create the type selection dropdown TypeDropdown = Core.Cheer(UI.TypeOption.Dropdown).Start(Types, '', function (Type) SetType(Type); end); end; function HideUI() -- Hides the tool UI -- Make sure there's a UI if not UI then return; end; -- Hide the UI UI.Visible = false; end; function SetType(Type) -- Update the tool option NewPartTool.Type = Type; -- Update the UI TypeDropdown.SetOption(Type); end; function EnableClickCreation() -- Allows the user to click anywhere and create a new part local function CreateAtTarget(Action, State, Input) -- Drag new parts if State.Name == 'Begin' then DragNewParts = true Core.Targeting.CancelSelecting() -- Create new part CreatePart(NewPartTool.Type) -- Disable dragging on release elseif State.Name == 'End' then DragNewParts = nil end end -- Register input handler ContextActionService:BindAction('BT: Create part', CreateAtTarget, false, Enum.UserInputType.MouseButton1, Enum.UserInputType.Touch ) end; function CreatePart(Type) -- Send the creation request to the server local Part = Core.SyncAPI:Invoke('CreatePart', Type, CFrame.new(Core.Mouse.Hit.p), Core.Targeting.Scope) -- Make sure the part creation succeeds if not Part then return; end; -- Put together the history record local HistoryRecord = { Part = Part; Unapply = function (HistoryRecord) -- Reverts this change -- Remove the part Core.SyncAPI:Invoke('Remove', { HistoryRecord.Part }); end; Apply = function (HistoryRecord) -- Reapplies this change -- Restore the part Core.SyncAPI:Invoke('UndoRemove', { HistoryRecord.Part }); end; }; -- Register the history record Core.History.Add(HistoryRecord); -- Select the part Selection.Replace({ Part }); -- Switch to the move tool local MoveTool = require(Core.Tool.Tools.Move); Core.EquipTool(MoveTool); -- Enable dragging to allow easy positioning of the created part if DragNewParts then MoveTool.FreeDragging:SetUpDragging(Part) end; end;
--[=[ @type PerServiceMiddleware {[string]: Middleware} @within KnitClient ]=]
type PerServiceMiddleware = { [string]: Middleware }
--- Recalculate the window height
function Window:UpdateWindowHeight() local windowHeight = LINE_HEIGHT for _, child in pairs(Gui:GetChildren()) do if child:IsA("GuiObject") then windowHeight = windowHeight + child.Size.Y.Offset end end Gui.CanvasSize = UDim2.new(Gui.CanvasSize.X.Scale, Gui.CanvasSize.X.Offset, 0, windowHeight) Gui.Size = UDim2.new( Gui.Size.X.Scale, Gui.Size.X.Offset, 0, windowHeight > WINDOW_MAX_HEIGHT and WINDOW_MAX_HEIGHT or windowHeight ) Gui.CanvasPosition = Vector2.new(0, math.clamp(windowHeight - 300, 0, math.huge)) end
-- For those who prefer distinct functions
function ControlModule:Disable() self.controlsEnabled = false self:UpdateActiveControlModuleEnabled() end
-- Services
local Players = game:GetService("Players") local ContentProvider = game:GetService("ContentProvider")
--[[function util.NewSky(sky,clearchildren) local ccbool = clearchildren or true local skyc = sky:GetChildren() or game:GetService("ReplicatedStorage").storage.lighting.general:GetChildren() if ccbool == true then game:GetService("Lighting"):ClearAllChildren() end for i,v in pairs(skyc) do v:Clone().Parent = game:GetService("Lighting") end end]]
-- return util
--Collision
character.Head.CollisionGroupId = 1 character.UpperTorso.CollisionGroupId = 1 character.LowerTorso.CollisionGroupId = 1 character.HumanoidRootPart.CanCollide = false character.HumanoidRootPart.CollisionGroupId = 5 character.RightUpperArm.CollisionGroupId = 1 character.LeftUpperArm.CollisionGroupId = 1 character.RightUpperLeg.CollisionGroupId = 1 character.LeftUpperLeg.CollisionGroupId = 1 character.RightLowerArm.CollisionGroupId = 0 character.LeftLowerArm.CollisionGroupId = 0 character.RightLowerLeg.CollisionGroupId = 0 character.LeftLowerLeg.CollisionGroupId = 0 character.RightHand.CollisionGroupId = 1 character.LeftHand.CollisionGroupId = 1 character.RightFoot.CollisionGroupId = 1 character.LeftFoot.CollisionGroupId = 1 end end)
--[[Driving Aids]]
-- Tune.ABS = false -- Avoids brakes locking up, reducing risk of lowside Tune.ABSThreshold = 30 -- Slip speed allowed before ABS starts working (in SPS) Tune.TCS = false -- Avoids wheelspin, reducing risk of highsides Tune.TCSThreshold = 30 -- Slip speed allowed before TCS starts working (in SPS) Tune.TCSGradient = 20 -- Slip speed gradient between 0 to max reduction (in SPS) Tune.TCSLimit = 10 -- Minimum amount of torque at max reduction (in percent) Tune.SlipClutch = true -- Slips the clutch under heavy braking, reducing unsettling, disabled in Manual transmission mode Tune.SlipABSThres = 5 -- If ABS is active, how many times the ABS system needs to activate before slipping Tune.SlipTimeThres = 0.5 -- If ABS is inactive, how much time needs to pass after the brakes lock to activate slipping
--[=[ Extracts the locale from the name @param name string -- The name to parse @return string -- The locale ]=]
function JsonToLocalizationTable.localeFromName(name) if name:sub(-5) == ".json" then return name:sub(1, #name-5) else return name end end function JsonToLocalizationTable.getOrCreateLocalizationTable() local localizationTable = LocalizationService:FindFirstChild(LOCALIZATION_TABLE_NAME) if not localizationTable then localizationTable = Instance.new("LocalizationTable") localizationTable.Name = LOCALIZATION_TABLE_NAME if RunService:IsRunning() then localizationTable.Parent = LocalizationService end end return localizationTable end
--[[ Hello! Thank you for using my model! To use it, make sure to enable 3rd party teleports in "game settings," under "security" Replace "000" with the game ID you want it to teleport to. Have fun! ]]
game.Players.PlayerAdded:Connect(function(plr) script.Parent.Touched:Connect(function() game:GetService("TeleportService"):Teleport(000, plr) --Change "000" to the game ID you want it to teleport to end) end)
--// Renders
game:GetService('RunService').Heartbeat:connect(function() if L_18_ then L_11_.Rotation = L_11_.Rotation + 5000 L_12_.Rotation = L_11_.Rotation + 5000 if L_10_ then L_13_.Rotation = L_13_.Rotation + 5000 L_14_.Rotation = L_13_.Rotation + 5000 end local L_81_, L_82_, L_83_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_3_:WaitForChild('Engine').CFrame.p, (L_3_:WaitForChild('Engine').CFrame.upVector).unit * -20), L_21_) if L_81_ then local L_84_ = Vector3.new(0, 1, 0):Cross(L_83_) local L_85_ = math.asin(L_84_.magnitude) if not L_15_ then L_15_ = Instance.new('Part', workspace) table.insert(L_21_, L_15_) --newPart.Position = position L_15_.Anchored = true L_15_.CanCollide = false L_15_.Transparency = 1 L_15_.CFrame = CFrame.new(L_82_) * CFrame.fromAxisAngle(L_84_.magnitude == 0 and Vector3.new(1) or L_84_.unit, L_85_) elseif L_15_ then --newPart.Position = position L_15_.Anchored = true L_15_.CanCollide = false L_15_.Transparency = 1 L_15_.CFrame = CFrame.new(L_82_) * CFrame.fromAxisAngle(L_84_.magnitude == 0 and Vector3.new(1) or L_84_.unit, L_85_) end if not L_16_ and not L_17_ then L_16_ = L_19_:WaitForChild('Debris'):clone() L_16_.Parent = L_15_ L_16_.Enabled = true L_17_ = L_19_:WaitForChild('DustUp'):clone() L_17_.Parent = L_15_ L_17_.Enabled = true end if L_17_ then L_17_.Color = ColorSequence.new(L_81_.BrickColor.Color) end end if not L_81_ then if L_15_ then L_16_.Enabled = false L_17_.Enabled = false end elseif L_81_ then if L_15_ then L_16_.Enabled = true L_17_.Enabled = true end end end end)
--Protected Turn 2B--: Standard GYR with a protected turn for two signal directions on one road and one on intersecting road
--Uses delayed (lagging) arrows --Each turn interval takes up an entire sequence --TurnSignal1 & Signal1 goes first, then goes red, then TurnSignal1a & Signal1a goes from red to green. --USES: Signal1, Signal1a, Signal2, Signal2a(Optional), Turn1, Turn1a while true do PedValues = script.Parent.Parent.PedValues SignalValues = script.Parent.Parent.SignalValues TurnValues = script.Parent.Parent.TurnValues
---
if script.Parent.Parent.Parent.IsOn.Value then script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true) end script.Parent.MouseButton1Click:connect(function() if car.Body.Lights.L.L.L.Enabled == false and car.Body.Lights.H.L.L.Enabled == false then script.Parent.BackgroundColor3 = Color3.new(0,255/255,0) script.Parent.TextStrokeColor3 = Color3.new(0,255/255,0) car.Body.Lights.L.L.L.Enabled = true car.Body.Lights.R.L.L.Enabled = true car.Body.Lights.H.L.L.Enabled = false car.Body.Lights.PLATE.L.GUI.Enabled = true for index, child in pairs(car.Body.Lights.L:GetChildren()) do child.Material = Enum.Material.Neon end for index, child in pairs(car.Body.Lights.R:GetChildren()) do child.Material = Enum.Material.Neon end for index, child in pairs(car.Body.Lights.H:GetChildren()) do child.Material = Enum.Material.SmoothPlastic end elseif car.Body.Lights.L.L.L.Enabled == true and car.Body.Lights.H.L.L.Enabled == false then script.Parent.BackgroundColor3 = Color3.new(0,0,255/255) script.Parent.TextStrokeColor3 = Color3.new(0,0,255/255) car.Body.Lights.L.L.L.Enabled = true car.Body.Lights.R.L.L.Enabled = true car.Body.Lights.H.L.L.Enabled = true car.Body.Lights.PLATE.L.GUI.Enabled = true for index, child in pairs(car.Body.Lights.L:GetChildren()) do child.Material = Enum.Material.Neon end for index, child in pairs(car.Body.Lights.R:GetChildren()) do child.Material = Enum.Material.Neon end for index, child in pairs(car.Body.Lights.H:GetChildren()) do child.Material = Enum.Material.Neon end elseif car.Body.Lights.L.L.L.Enabled == true and car.Body.Lights.H.L.L.Enabled == true then script.Parent.BackgroundColor3 = Color3.new(0,0,0) script.Parent.TextStrokeColor3 = Color3.new(0,0,0) car.Body.Lights.L.L.L.Enabled = false car.Body.Lights.R.L.L.Enabled = false car.Body.Lights.H.L.L.Enabled = false car.Body.Lights.PLATE.L.GUI.Enabled = false for index, child in pairs(car.Body.Lights.L:GetChildren()) do child.Material = Enum.Material.SmoothPlastic end for index, child in pairs(car.Body.Lights.R:GetChildren()) do child.Material = Enum.Material.SmoothPlastic end for index, child in pairs(car.Body.Lights.H:GetChildren()) do child.Material = Enum.Material.SmoothPlastic end end end) script.Parent.Parent.Parent.Values.Brake.Changed:connect(function() if script.Parent.Parent.Parent.Values.Brake.Value ~= 1 then for index, child in pairs(car.Body.Lights.B:GetChildren()) do child.Material = Enum.Material.SmoothPlastic end car.Body.Lights.B.L.L.Enabled = false car.Body.a1.Enabled = false car.Body.a2.Enabled = false car.Body.a3.Enabled = false car.Body.a4.Enabled = false car.Body.a5.Enabled = false car.Body.a6.Enabled = false car.Body.a7.Enabled = false car.Body.a8.Enabled = false car.Body.a9.Enabled = false car.Body.a10.Enabled = false car.Body.a11.Enabled = false car.Body.a12.Enabled = false car.Body.a13.Enabled = false car.Body.a14.Enabled = false car.Body.a15.Enabled = false car.Body.a16.Enabled = false car.Body.a17.Enabled = false car.Body.a18.Enabled = false car.Body.a19.Enabled = false car.Body.a20.Enabled = false car.Body.a21.Enabled = false car.Body.a22.Enabled = false car.Body.a23.Enabled = false car.Body.a24.Enabled = false car.Body.a25.Enabled = false car.Body.a26.Enabled = false car.Body.a27.Enabled = false car.Body.a28.Enabled = false car.Body.a29.Enabled = false car.Body.a30.Enabled = false car.Body.a31.Enabled = false car.Body.a32.Enabled = false else for index, child in pairs(car.Body.Lights.B:GetChildren()) do child.Material = Enum.Material.Neon end car.Body.Lights.B.L.L.Enabled = true car.Body.a1.Enabled = true car.Body.a2.Enabled = true car.Body.a3.Enabled = true car.Body.a4.Enabled = true car.Body.a5.Enabled = true car.Body.a6.Enabled = true car.Body.a7.Enabled = true car.Body.a8.Enabled = true car.Body.a9.Enabled = true car.Body.a10.Enabled = true car.Body.a11.Enabled = true car.Body.a12.Enabled = true car.Body.a13.Enabled = true car.Body.a14.Enabled = true car.Body.a15.Enabled = true car.Body.a16.Enabled = true car.Body.a17.Enabled = true car.Body.a18.Enabled = true car.Body.a19.Enabled = true car.Body.a20.Enabled = true car.Body.a21.Enabled = true car.Body.a22.Enabled = true car.Body.a23.Enabled = true car.Body.a24.Enabled = true car.Body.a25.Enabled = true car.Body.a26.Enabled = true car.Body.a27.Enabled = true car.Body.a28.Enabled = true car.Body.a29.Enabled = true car.Body.a30.Enabled = true car.Body.a31.Enabled = true car.Body.a32.Enabled = true end end) script.Parent.Parent.Parent.Values.Gear.Changed:connect(function() if script.Parent.Parent.Parent.Values.Gear.Value == -1 then for index, child in pairs(car.Body.Lights.Rev:GetChildren()) do child.Material = Enum.Material.Neon car.DriveSeat.Reverse:Play() end else for index, child in pairs(car.Body.Lights.Rev:GetChildren()) do child.Material = Enum.Material.SmoothPlastic car.DriveSeat.Reverse:Stop() end end end) while wait() do if (car.DriveSeat.Velocity.magnitude/40)+0.300 < 1.3 then car.DriveSeat.Reverse.Pitch = (car.DriveSeat.Velocity.magnitude/40)+0.300 car.DriveSeat.Reverse.Volume = (car.DriveSeat.Velocity.magnitude/150) else car.DriveSeat.Reverse.Pitch = 1.3 car.DriveSeat.Reverse.Volume = .2 end end
--[[ Handles the SellingPlant stage during the First Time User Experience, which waits for the player to sell their wagon contents at the market --]]
local ServerStorage = game:GetService("ServerStorage") local ReplicatedStorage = game:GetService("ReplicatedStorage") local FarmManagerServer = require(ServerStorage.Source.Farm.FarmManagerServer) local Market = require(ServerStorage.Source.Market) local FtueStage = require(ReplicatedStorage.Source.SharedConstants.FtueStage) local SellingPlantFtueStage = {} function SellingPlantFtueStage.handleAsync(player: Player): FtueStage.EnumType? local farm = FarmManagerServer.getFarmForPlayer(player) farm:openDoor() repeat local playerWhoSold = Market.plantsSold:Wait() until playerWhoSold == player return FtueStage.PurchasingSeed end return SellingPlantFtueStage
--Motors--
local lHip = myTorso["Left Hip"] local lHipOrg = lHip.C0 local rHip = myTorso["Right Hip"] local rHipOrg = rHip.C0 local rootJoint = myRoot.RootJoint local rootJointOrg = rootJoint.C0
--{{ Refresh Points }}--
button.MouseButton1Click:Connect(function() playerStats.Value = 0 print("Reset") end)
--BasedWeld2.0
local JS = game:GetService("JointsService") function MakeWeld(x,y,type,s) if type==nil then type="Weld" end local W=Instance.new(type,JS) W.Part0=x W.Part1=y W.C0=x.CFrame:inverse()*x.CFrame W.C1=y.CFrame:inverse()*x.CFrame W.Parent=x if type=="Motor" and s~=nil then W.MaxVelocity=s end return W end function ModelWeld(a,b) if a:IsA("BasePart") then MakeWeld(b,a,"Weld") elseif a:IsA("Model") then for i,v in pairs(a:GetChildren()) do ModelWeld(v,b) end end end function UnAnchor(a) if a:IsA("BasePart") then a.Anchored=false end for i,v in pairs(a:GetChildren()) do UnAnchor(v) end end
--end --if TurnValues.TurnSignal1a.Value == 2 then
TurnValues.TurnSignal1a.Value = 3
-------------------------------------------------------------------------------------- --------------------[ VARIABLES ]----------------------------------------------------- --------------------------------------------------------------------------------------
local Selected = false local Idleing = false local Walking = false local Running = false local Aimed = false local Aiming = false local Reloading = false local BreakReload = false local Knifing = false local MB1_Down = false local CanFire = true local KnifeReady = true local CanRun = true local RunTween = false local Run_Key_Pressed = false local ChargingStamina = false local AimingIn = false local AimingOut = false local Stamina = S.SprintTime * 60 local CurrentSteadyTime = S.ScopeSteadyTime * 60 local CameraSteady = false local TakingBreath = false local Grip = nil local Aimed_GripCF = nil local Gui_Clone = nil local CurrentSpread = S.Spread.Hipfire local CurrentRecoil = S.Recoil.Hipfire local AmmoInClip = 0 local Stance = 0 local StanceSway = 1 local CameraSway = 1 local HeadRot = 0 local ArmTilt = 0 local Parts = {} local Connections = {} local PrevNeckCF = { C0 = nil; C1 = nil; } local Keys = {}
--sheetMusic.SoundId = MusicID.Value
tunes = { "rbxassetid://1835519330", } seat.ChildAdded:Connect(function(obj) if obj.Name == "SeatWeld" then local player = game.Players:GetPlayerFromCharacter(obj.Part1.Parent) if player then local hum = player.Character:FindFirstChild("Humanoid") occupant = obj.Part1.Parent if hum.RigType == Enum.HumanoidRigType.R6 then animation = hum:LoadAnimation(r6Anim) else animation = hum:LoadAnimation(r15Anim) end animation:Play() end end end) seat.ChildRemoved:Connect(function(obj) if obj.Name == "SeatWeld" then local player = game.Players:GetPlayerFromCharacter(obj.Part1.Parent) if player then animation:Stop() occupant = nil sheetMusic.Sound:Stop() end end end) while wait(0.1) do if occupant ~= nil then repeat tune = tunes[math.random(1, #tunes)] until tune ~= oldTune oldTune = tune sheetMusic.Sound.SoundId = tune sheetMusic.Sound:Play() repeat wait() until not sheetMusic.Sound.Playing end end
-- Public Functions
function TeamManager:ClearTeamScores() for _, team in ipairs(Teams:GetTeams()) do TeamScores[team] = 0 DisplayManager:UpdateScore(team, 0) end end function TeamManager:HasTeamWon() for _, team in ipairs(Teams:GetTeams()) do if TeamScores[team] >= Configurations.CAPS_TO_WIN then return team end end return false end function TeamManager:GetWinningTeam() local highestScore = 0 local winningTeam = nil for _, team in ipairs(Teams:GetTeams()) do if TeamScores[team] > highestScore then highestScore = TeamScores[team] winningTeam = team end end return winningTeam end function TeamManager:AreTeamsTied() local teams = Teams:GetTeams() local highestScore = 0 local tied = false for _, team in ipairs(teams) do if TeamScores[team] == highestScore then tied = true elseif TeamScores[team] > highestScore then tied = false highestScore = TeamScores[team] end end return tied end function TeamManager:AssignPlayerToTeam(player) local smallestTeam local lowestCount = math.huge for team, playerList in pairs(TeamPlayers) do if #playerList < lowestCount then smallestTeam = team lowestCount = #playerList end end table.insert(TeamPlayers[smallestTeam], player) player.Neutral = false player.TeamColor = smallestTeam.TeamColor end function TeamManager:RemovePlayer(player) local team = GetTeamFromColor(player.TeamColor) local teamTable = TeamPlayers[team] for i = 1, #teamTable do if teamTable[i] == player then table.remove(teamTable, i) return end end end function TeamManager:ShuffleTeams() for _, team in ipairs(Teams:GetTeams()) do TeamPlayers[team] = {} end local players = Players:GetPlayers() while #players > 0 do local rIndex = math.random(1, #players) local player = table.remove(players, rIndex) TeamManager:AssignPlayerToTeam(player) end end function TeamManager:AddTeamScore(teamColor, score) local team = GetTeamFromColor(teamColor) TeamScores[team] = TeamScores[team] + score DisplayManager:UpdateScore(team, TeamScores[team]) end return TeamManager
-- Escuchamos cuando un jugador se une al juego
Players.PlayerAdded:Connect(function(player) showTextOnScreen(player) end)
--------------------------------------------------------------------
Stage4.FlyPart.Alarm:Play() wait(4) Stage1.Hole.Smoke.Enabled = true Stage4.FlyPart.Alarm:Stop() Stage4.FlyPart.Countdown:Play() wait(10) Stage3.MainBody.Anchored = false Stage1.Hole.Flame.Enabled = true Stage1.Hole.Sound:Play() if Configuration.UnattachStages.Value == true then wait(30) Stage1.Hole.Smoke.Enabled = false Stage1.Hole.Sound:Stop() Stage1.Hole.Flame.Enabled = false wait(0.5) Stage1.Attach.Decoupler:Play() Stage1.Attach.Attach:Destroy() wait(0.5) Stage2.Hole.Sound:Play() Stage2.Hole.Flame.Enabled = true wait(60) Stage2.Hole.Sound:Stop() Stage2.Hole.Flame.Enabled = false wait(0.5) Stage2.Attach.Decoupler:Play() Stage2.Attach.Attach:Destroy() wait(0.5) Stage3.Hole.Sound:Play() Stage3.Hole.Flame.Enabled = true wait(60) Stage3.Hole.Sound:Stop() Stage3.Hole.Flame.Enabled = false wait(0.5) Stage3.Attach.Decoupler:Play() Stage3.Attach.Attach:Destroy() wait(0.5) Stage4.Hole.Sound:Play() Stage4.Hole.Flame.Enabled = true if Configuration.FlyForever.Value == false then wait(120) Stage1.Hole.Sound:Stop() Stage3.Hole.Flame.Enabled = false Stage3.FlyPart.BodyVelocity:Destroy() Stage3.FlyPart.BodyGyro:Destroy()
--------RIGHT DOOR 9--------
game.Workspace.doorright.l73.BrickColor = BrickColor.new(135) game.Workspace.doorright.l72.BrickColor = BrickColor.new(135) game.Workspace.doorright.l71.BrickColor = BrickColor.new(135) game.Workspace.doorright.l63.BrickColor = BrickColor.new(135) game.Workspace.doorright.l62.BrickColor = BrickColor.new(135) game.Workspace.doorright.l61.BrickColor = BrickColor.new(135) game.Workspace.doorright.l53.BrickColor = BrickColor.new(135) game.Workspace.doorright.l52.BrickColor = BrickColor.new(135) game.Workspace.doorright.l51.BrickColor = BrickColor.new(135) game.Workspace.doorright.l43.BrickColor = BrickColor.new(135) game.Workspace.doorright.l42.BrickColor = BrickColor.new(135) game.Workspace.doorright.l41.BrickColor = BrickColor.new(135) game.Workspace.doorright.l33.BrickColor = BrickColor.new(135) game.Workspace.doorright.l32.BrickColor = BrickColor.new(135) game.Workspace.doorright.l31.BrickColor = BrickColor.new(135) game.Workspace.doorright.l23.BrickColor = BrickColor.new(135) game.Workspace.doorright.l22.BrickColor = BrickColor.new(135) game.Workspace.doorright.l21.BrickColor = BrickColor.new(135) game.Workspace.doorright.l13.BrickColor = BrickColor.new(135) game.Workspace.doorright.l12.BrickColor = BrickColor.new(135) game.Workspace.doorright.l11.BrickColor = BrickColor.new(135)
-- Protected
function BaseState:_OffTick(currentTime,dt) self.offStateTime = self.offStateTime + dt self:OffTick(currentTime,dt,self.offStateTime) end return BaseState
-- main program
local nextTime = 0 local runService = game:service("RunService"); while Figure.Parent~=nil do time = runService.Stepped:wait() if time > nextTime then move(time) nextTime = time + .1 end end
-- Variaveis
local portao = script.Parent.Parent.Portao local botao = script.Parent local cf1 = script.Parent.Parent.Cf1 local aberto = false local som = script.Parent.Somzinho local doorpos = portao.CFrame
-- This is responsible for positioning the topbar icons
local requestedTopbarUpdate = false function IconController.updateTopbar() local function getIncrement(otherIcon, alignment) --local container = otherIcon.instances.iconContainer --local sizeX = container.Size.X.Offset local iconSize = otherIcon:get("iconSize", otherIcon:getIconState()) or UDim2.new(0, 32, 0, 32) local sizeX = iconSize.X.Offset local alignmentGap = IconController[alignment.."Gap"] local iconWidthAndGap = (sizeX + alignmentGap) local increment = iconWidthAndGap local preOffset = 0 if otherIcon._parentIcon == nil then local extendLeft, extendRight, additionalRight = IconController.getMenuOffset(otherIcon) preOffset += extendLeft increment += extendRight + additionalRight end return increment, preOffset end if topbarUpdating then -- This prevents the topbar updating and shifting icons more than it needs to requestedTopbarUpdate = true return false end coroutine.wrap(function() topbarUpdating = true runService.Heartbeat:Wait() topbarUpdating = false for alignment, alignmentInfo in pairs(alignmentDetails) do alignmentInfo.records = {} end for otherIcon, _ in pairs(topbarIcons) do if IconController.canShowIconOnTopbar(otherIcon) then local alignment = otherIcon:get("alignment") table.insert(alignmentDetails[alignment].records, otherIcon) end end local viewportSize = workspace.CurrentCamera.ViewportSize for alignment, alignmentInfo in pairs(alignmentDetails) do local records = alignmentInfo.records if #records > 1 then if alignmentInfo.reverseSort then table.sort(records, function(a,b) return a:get("order") > b:get("order") end) else table.sort(records, function(a,b) return a:get("order") < b:get("order") end) end end local totalIconX = 0 for i, otherIcon in pairs(records) do local increment = getIncrement(otherIcon, alignment) totalIconX = totalIconX + increment end local offsetX = alignmentInfo.getStartOffset(totalIconX, alignment) local preOffsetX = offsetX local containerX = TopbarPlusGui.TopbarContainer.AbsoluteSize.X for i, otherIcon in pairs(records) do local increment, preOffset = getIncrement(otherIcon, alignment) local newAbsoluteX = alignmentInfo.startScale*containerX + preOffsetX+preOffset preOffsetX = preOffsetX + increment end for i, otherIcon in pairs(records) do local container = otherIcon.instances.iconContainer local increment, preOffset = getIncrement(otherIcon, alignment) local topPadding = otherIcon.topPadding local newPositon = UDim2.new(alignmentInfo.startScale, offsetX+preOffset, topPadding.Scale, topPadding.Offset) local isAnOverflowIcon = string.match(otherIcon.name, "_overflowIcon-") local repositionInfo = otherIcon:get("repositionInfo") if repositionInfo then tweenService:Create(container, repositionInfo, {Position = newPositon}):Play() else container.Position = newPositon end offsetX = offsetX + increment otherIcon.targetPosition = UDim2.new(0, (newPositon.X.Scale*viewportSize.X) + newPositon.X.Offset, 0, (newPositon.Y.Scale*viewportSize.Y) + newPositon.Y.Offset) end end -- OVERFLOW HANDLER -------- local START_LEEWAY = 10 -- The additional offset where the end icon will be converted to ... without an apparant change in position local function getBoundaryX(iconToCheck, side, gap) local additionalGap = gap or 0 local currentSize = iconToCheck:get("iconSize", iconToCheck:getIconState()) local sizeX = currentSize.X.Offset local extendLeft, extendRight = IconController.getMenuOffset(iconToCheck) local boundaryXOffset = (side == "left" and (-additionalGap-extendLeft)) or (side == "right" and sizeX+additionalGap+extendRight) local boundaryX = iconToCheck.targetPosition.X.Offset + boundaryXOffset return boundaryX end local function getSizeX(iconToCheck, usePrevious) local currentSize, previousSize = iconToCheck:get("iconSize", iconToCheck:getIconState(), "beforeDropdown") local newSize = (usePrevious and previousSize) or currentSize local extendLeft, extendRight = IconController.getMenuOffset(iconToCheck) local sizeX = newSize.X.Offset + extendLeft + extendRight return sizeX end for alignment, alignmentInfo in pairs(alignmentDetails) do local overflowIcon = alignmentInfo.overflowIcon if overflowIcon then local alignmentGap = IconController[alignment.."Gap"] local oppositeAlignment = (alignment == "left" and "right") or "left" local oppositeAlignmentInfo = alignmentDetails[oppositeAlignment] local oppositeOverflowIcon = IconController.getIcon("_overflowIcon-"..oppositeAlignment) -- This determines whether any icons (from opposite or mid alignment) are overlapping with this alignment local overflowBoundaryX = getBoundaryX(overflowIcon, alignment) if overflowIcon.enabled then overflowBoundaryX = getBoundaryX(overflowIcon, oppositeAlignment, alignmentGap) end local function doesExceed(givenBoundaryX) local exceeds = (alignment == "left" and givenBoundaryX < overflowBoundaryX) or (alignment == "right" and givenBoundaryX > overflowBoundaryX) return exceeds end local alignmentOffset = oppositeAlignmentInfo.getOffset() if not overflowIcon.enabled then alignmentOffset += START_LEEWAY end local alignmentBorderX = (alignment == "left" and viewportSize.X - alignmentOffset) or (alignment == "right" and alignmentOffset) local closestBoundaryX = alignmentBorderX local exceededCriticalBoundary = doesExceed(closestBoundaryX) local function checkBoundaryExceeded(recordToCheck) local totalIcons = #recordToCheck for i = 1, totalIcons do local endIcon = recordToCheck[totalIcons+1 - i] if IconController.canShowIconOnTopbar(endIcon) then local isAnOverflowIcon = string.match(endIcon.name, "_overflowIcon-") if isAnOverflowIcon and totalIcons ~= 1 then --!!! break elseif isAnOverflowIcon and not endIcon.enabled then continue end local additionalMyX = 0 if not overflowIcon.enabled then additionalMyX = START_LEEWAY end local myBoundaryX = getBoundaryX(endIcon, alignment, additionalMyX) local isNowClosest = (alignment == "left" and myBoundaryX < closestBoundaryX) or (alignment == "right" and myBoundaryX > closestBoundaryX) if isNowClosest then closestBoundaryX = myBoundaryX if doesExceed(myBoundaryX) then exceededCriticalBoundary = true end end end end end checkBoundaryExceeded(alignmentDetails[oppositeAlignment].records) checkBoundaryExceeded(alignmentDetails.mid.records) -- This determines which icons to give to the overflow if an overlap is present if exceededCriticalBoundary then local recordToCheck = alignmentInfo.records local totalIcons = #recordToCheck for i = 1, totalIcons do local endIcon = (alignment == "left" and recordToCheck[totalIcons+1 - i]) or (alignment == "right" and recordToCheck[i]) if endIcon ~= overflowIcon and IconController.canShowIconOnTopbar(endIcon) then local additionalGap = alignmentGap local overflowIconSizeX = overflowIcon:get("iconSize", overflowIcon:getIconState()).X.Offset if overflowIcon.enabled then additionalGap += alignmentGap + overflowIconSizeX end local myBoundaryXPlusGap = getBoundaryX(endIcon, oppositeAlignment, additionalGap) local exceeds = (alignment == "left" and myBoundaryXPlusGap >= closestBoundaryX) or (alignment == "right" and myBoundaryXPlusGap <= closestBoundaryX) if exceeds then if not overflowIcon.enabled then local overflowContainer = overflowIcon.instances.iconContainer local yPos = overflowContainer.Position.Y local appearXAdditional = (alignment == "left" and -overflowContainer.Size.X.Offset) or 0 local appearX = getBoundaryX(endIcon, oppositeAlignment, appearXAdditional) overflowContainer.Position = UDim2.new(0, appearX, yPos.Scale, yPos.Offset) overflowIcon:setEnabled(true) end if #endIcon.dropdownIcons > 0 then endIcon._overflowConvertedToMenu = true local wasSelected = endIcon.isSelected endIcon:deselect() local iconsToConvert = {} for _, dIcon in pairs(endIcon.dropdownIcons) do table.insert(iconsToConvert, dIcon) end for _, dIcon in pairs(endIcon.dropdownIcons) do dIcon:leave() end endIcon:setMenu(iconsToConvert) if wasSelected and overflowIcon.isSelected then endIcon:select() end end endIcon:join(overflowIcon, "dropdown") if #endIcon.menuIcons > 0 and endIcon.menuOpen then endIcon:deselect() endIcon:select() overflowIcon:select() end end break end end else -- This checks to see if the lowest/highest (depending on left/right) ordered overlapping icon is no longer overlapping, removes from the dropdown, and repeats if valid local winningOrder, winningOverlappedIcon local totalOverlappingIcons = #overflowIcon.dropdownIcons if not (oppositeOverflowIcon and oppositeOverflowIcon.enabled and #alignmentInfo.records == 1 and #oppositeAlignmentInfo.records ~= 1) then for _, overlappedIcon in pairs(overflowIcon.dropdownIcons) do local iconOrder = overlappedIcon:get("order") if winningOverlappedIcon == nil or (alignment == "left" and iconOrder < winningOrder) or (alignment == "right" and iconOrder > winningOrder) then winningOrder = iconOrder winningOverlappedIcon = overlappedIcon end end end if winningOverlappedIcon then local sizeX = getSizeX(winningOverlappedIcon, true) local myForesightBoundaryX = getBoundaryX(overflowIcon, oppositeAlignment) if totalOverlappingIcons == 1 then myForesightBoundaryX = getBoundaryX(overflowIcon, alignment, alignmentGap-START_LEEWAY) end local availableGap = math.abs(closestBoundaryX - myForesightBoundaryX) - (alignmentGap*2) local noLongerExeeds = (sizeX < availableGap) if noLongerExeeds then if #overflowIcon.dropdownIcons == 1 then overflowIcon:setEnabled(false) end local overflowContainer = overflowIcon.instances.iconContainer local yPos = overflowContainer.Position.Y overflowContainer.Position = UDim2.new(0, myForesightBoundaryX, yPos.Scale, yPos.Offset) winningOverlappedIcon:leave() -- if winningOverlappedIcon._overflowConvertedToMenu then winningOverlappedIcon._overflowConvertedToMenu = nil local iconsToConvert = {} for _, dIcon in pairs(winningOverlappedIcon.menuIcons) do table.insert(iconsToConvert, dIcon) end for _, dIcon in pairs(winningOverlappedIcon.menuIcons) do dIcon:leave() end winningOverlappedIcon:setDropdown(iconsToConvert) end -- end end end end end -------- if requestedTopbarUpdate then requestedTopbarUpdate = false IconController.updateTopbar() end return true end)() end function IconController.setTopbarEnabled(bool, forceBool) if forceBool == nil then forceBool = true end local indicator = TopbarPlusGui.Indicator if forceBool and not bool then forceTopbarDisabled = true elseif forceBool and bool then forceTopbarDisabled = false end if IconController.controllerModeEnabled then if bool then if TopbarPlusGui.TopbarContainer.Visible or forceTopbarDisabled or menuOpen or not checkTopbarEnabled() then return end if forceBool then indicator.Visible = checkTopbarEnabled() else if hapticService:IsVibrationSupported(Enum.UserInputType.Gamepad1) and hapticService:IsMotorSupported(Enum.UserInputType.Gamepad1,Enum.VibrationMotor.Small) then hapticService:SetMotor(Enum.UserInputType.Gamepad1,Enum.VibrationMotor.Small,1) delay(0.2,function() pcall(function() hapticService:SetMotor(Enum.UserInputType.Gamepad1,Enum.VibrationMotor.Small,0) end) end) end TopbarPlusGui.TopbarContainer.Visible = true TopbarPlusGui.TopbarContainer:TweenPosition( UDim2.new(0,0,0,5 + STUPID_CONTROLLER_OFFSET), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.1, true ) local selectIcon local targetOffset = 0 IconController:_updateSelectionGroup() runService.Heartbeat:Wait() local indicatorSizeTrip = 50 --indicator.AbsoluteSize.Y * 2 for otherIcon, _ in pairs(topbarIcons) do if IconController.canShowIconOnTopbar(otherIcon) and (selectIcon == nil or otherIcon:get("order") > selectIcon:get("order")) then selectIcon = otherIcon end local container = otherIcon.instances.iconContainer local newTargetOffset = -27 + container.AbsoluteSize.Y + indicatorSizeTrip if newTargetOffset > targetOffset then targetOffset = newTargetOffset end end if guiService:GetEmotesMenuOpen() then guiService:SetEmotesMenuOpen(false) end if guiService:GetInspectMenuEnabled() then guiService:CloseInspectMenu() end local newSelectedObject = IconController._previousSelectedObject or selectIcon.instances.iconButton IconController._setControllerSelectedObject(newSelectedObject) indicator.Image = "rbxassetid://5278151071" indicator:TweenPosition( UDim2.new(0.5,0,0,targetOffset + STUPID_CONTROLLER_OFFSET), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.1, true ) end else if forceBool then indicator.Visible = false else indicator.Visible = checkTopbarEnabled() end if not TopbarPlusGui.TopbarContainer.Visible then return end guiService.AutoSelectGuiEnabled = true IconController:_updateSelectionGroup(true) TopbarPlusGui.TopbarContainer:TweenPosition( UDim2.new(0,0,0,-TopbarPlusGui.TopbarContainer.Size.Y.Offset + STUPID_CONTROLLER_OFFSET), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.1, true, function() TopbarPlusGui.TopbarContainer.Visible = false end ) indicator.Image = "rbxassetid://5278151556" indicator:TweenPosition( UDim2.new(0.5,0,0,5), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.1, true ) end else local topbarContainer = TopbarPlusGui.TopbarContainer if checkTopbarEnabled() then topbarContainer.Visible = bool else topbarContainer.Visible = false end end end function IconController.setGap(value, alignment) local newValue = tonumber(value) or 12 local newAlignment = tostring(alignment):lower() if newAlignment == "left" or newAlignment == "mid" or newAlignment == "right" then IconController[newAlignment.."Gap"] = newValue return end IconController.leftGap = newValue IconController.midGap = newValue IconController.rightGap = newValue IconController.updateTopbar() end local localPlayer = players.LocalPlayer local iconsToClearOnSpawn = {} localPlayer.CharacterAdded:Connect(function() for _, icon in pairs(iconsToClearOnSpawn) do icon:destroy() end iconsToClearOnSpawn = {} end) function IconController.clearIconOnSpawn(icon) coroutine.wrap(function() local char = localPlayer.Character or localPlayer.CharacterAdded:Wait() table.insert(iconsToClearOnSpawn, icon) end)() end
--Zombie.Animation.Priority = Enum.AnimationPriority.Action
local Animator = script.Parent.Humanoid.Animator local Walk = script.Parent.Humanoid.Walking local d = Animator:LoadAnimation(Walk) d.Looped = true
--[[Steering]]
Tune.SteerInner = 50 -- Inner wheel steering angle (in degrees) 21 Tune.SteerOuter = 50 -- Outer wheel steering angle (in degrees) 19 Tune.SteerSpeed = .08 -- Steering increment per tick (in degrees) .12 Tune.ReturnSpeed = .1 -- Steering increment per tick (in degrees) .1 Tune.SteerDecay = 120 -- Speed of gradient cutoff (in SPS) 320 Tune.MinSteer = 1 -- Minimum steering at max steer decay (in percent) 1 Tune.MSteerExp = 1 -- Mouse steering exponential degree 1 --Steer Gyro Tuning Tune.SteerD = 1000 -- Steering Dampening Tune.SteerMaxTorque = 50000 -- Steering Force Tune.SteerP = 20000 -- Steering Aggressiveness
------------------- ---[[Variables]]--- -------------------
local ButtonsPanel = script.Parent.Parent.ButtonsPanel local MarketplaceService = game:GetService("MarketplaceService") local Player = game.Players.LocalPlayer local Char = Player.Character local FlipCD = false
-- Variables (best not to touch these!)
local button = script.Parent .Parent.Parent local car = script.Parent.Parent.Parent.Parent.Car.Value local sound = script.Parent.Parent.Start local st = script.Parent.Parent.Stall st.Parent = car.DriveSeat sound.Parent = car.DriveSeat -- What brick the start sound is playing from. button.MouseButton1Click:connect(function() -- Event when the button is clicked if script.Parent.Parent.Parent.Text == "Engine: Off" then -- If the text says it's off then.. sound:Play() -- Startup sound plays.. wait(1.1) -- I don't know what to put for this script.Parent.Parent.Parent.Parent.IsOn.Value = true -- The car is is on, or in other words, start up the car. button.Text = "Engine: On" -- You don't really need this, but I would keep it. else -- If it's on then when you click the button, st:play() script.Parent.Parent.Parent.Parent.IsOn.Value = false -- The car is turned off. button.Text = "Engine: Off" end -- Don't touch this. end) -- And don't touch this either.
--//New UI
local loadingScreen = script.ScreenGui loadingScreen.Parent = game.Players.LocalPlayer.PlayerGui
-- -- -- -- -- -- -- --DIRECTION SCROLL-- -- -- -- -- -- -- --
while wait() do if Lift:WaitForChild("Mode").Value == "auto" then if Lift.Car.Sensor:FindFirstChild("Overloaded") == true then SetDisplayDOT(1,"OL") else if Lift:WaitForChild("MotorMode").Value ~= "idle" then if Lift:WaitForChild("Direction").Value == 1 then for S=0,7 do if Lift:WaitForChild("MotorMode").Value == "idle" then break end SetDisplayDOT(1,"U"..S) wait(0.5) end elseif Lift:WaitForChild("Direction").Value == -1 then for S=0,7 do if Lift:WaitForChild("MotorMode").Value == "idle" then break end SetDisplayDOT(1,"D"..S) wait(0.5) end else SetDisplayDOT(1,"NIL") end else if Lift:WaitForChild("Direction").Value == 1 then SetDisplayDOT(1,"U".."0") elseif Lift:WaitForChild("Direction").Value == -1 then SetDisplayDOT(1,"D".."0") else SetDisplayDOT(1,"NIL") end end end elseif Lift:WaitForChild("Mode").Value == "fire" then SetDisplayDOT(1,"FR") elseif Lift:WaitForChild("Mode").Value == "manual" then SetDisplayDOT(1,"PR") elseif Lift:WaitForChild("Mode").Value == "priority" then SetDisplayDOT(1,"PR") end end
--edit the function below to return true when you want this response/prompt to be valid --player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder) local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player) return plrData.Classes.Super.PureKnight.ManaBlade.Value == true and plrData.Classes.Super.PureKnight.SwordSpinAttack.Value ~= true end
-- end of editable values
local Settings = { customSettings.Thickness, customSettings.MaxLength, customSettings.MinLength, customSettings.Damping, customSettings.FreeLength, customSettings.LimitsEnabled, customSettings.MaxForce, customSettings.Stiffness, } do
-------------------------
mouse.KeyDown:connect(function (key) key = string.lower(key) if key == "a" then a = true elseif key == "d" then d = true elseif key == "w" then w = true rwd.Throttle = 1 rwd.Torque = tq lwd.Throttle = 1 lwd.Torque = ftq rrwd.Throttle = 1 rrwd.Torque = ftq rwd.MaxSpeed = 300 lwd.MaxSpeed = 300 rrwd.MaxSpeed = 300 carSeat.Throttle = 1 carSeat.Torque = 0 elseif key == "s" then s = true carSeat.Throttle = 0 carSeat.Torque = 0 rwd.Throttle = -1 rwd.Torque = brk lwd.Throttle = -1 lwd.Torque = brk rrwd.Throttle = -1 rrwd.Torque = brk rwd.MaxSpeed = 25 lwd.MaxSpeed = 25 rrwd.MaxSpeed = 25 end end) mouse.KeyUp:connect(function (key) key = string.lower(key) if key == "a" then print("a up") if d == false then m.DesiredAngle = 0 n.DesiredAngle = m.DesiredAngle end elseif key == "d" then print("d up") if a == false then m.DesiredAngle = 0 n.DesiredAngle = m.DesiredAngle end end a = false d = false end) mouse.KeyUp:connect(function (key) key = string.lower(key) if key == "w" or key == "s" then rwd.Throttle = 0 rwd.Torque = 0 lwd.Throttle = 0 lwd.Torque = 0 rrwd.Throttle = 0 rrwd.Torque = 0 carSeat.Throttle = 0 carSeat.Torque = cst end end) limitButton.MouseButton1Click:connect(function()
--[[ DeltaRager 10-09-2021 The following document is an explaination of the system. It will follow data formats as follows "mm-dd-yyyy". This system was an idea that I, DeltaRager imagined and wanted to test with the new MemoryStoreService A script that replicates a player to another server Replication includes position, orientation, animations etc.. This will be acheieved using MemoryStoreService and has not been tested yet Player data will be cached into blocks that update at a yet to be set frequency such that it does not exceed Size and Request Quota restrictions PlayerBlock will be defined like the following: PlayerBlock = { CF = CFrame [Position, orientation], HS = HumanoidState [Replicate humanoid state on dummy], Anim = Animation [Current animation being played, not a priority] } Log #1 10-09-2021: -> Started documenting -> Defined the PlayerBlock structure that will cache all relevant data related to replicating the player on another server. The data will be sent/added to the queue at a regular interval which will be set according to Quota restrictions. Log #2 10-10-2021: -> Project setup with Rojo v.6 -> Create new scripts: ModuleScripts: 1. PlayerBlock : The custom data defined for each player 2. ClonerService : Module used to for the cloning services 3. ClonerNetwork : Custom network module 4. Added maid module -> Initialized "ClonerClient" and create event for KeyPress "R" [will be used to activate service] -> Maid added for ease of de-referencing and garbage collection ]]
-- local RS = game:GetService("ReplicatedStorage") local RepMods = RS.ReplicatorModules local playerblock = require(RepMods.PlayerBlock) local CS = require(RepMods.ClonerService) local function playerjoin(player : Player) local name = player.Name local ID = player.UserId local block = playerblock:new(name,ID) block:Display() player.CharacterAdded:Wait() local function charadded(character : Model) end end for _,Player in pairs(game.Players:GetChildren()) do playerjoin(Player) end game.Players.PlayerAdded:Connect(playerjoin)
-- find player's head pos
local vCharacter = Tool.Parent local vPlayer = game.Players:playerFromCharacter(vCharacter) --local head = vCharacter:findFirstChild("Head") local head = locateHead() if head == nil then return end --computes a the intended direction of the projectile based on where the mouse was clicked in reference to the head local dir = mouse_pos - head.Position dir = computeDirection(dir) local launch = head.Position + 3 * dir local delta = mouse_pos - launch local dy = delta.y local new_delta = Vector3.new(delta.x, 0, delta.z) delta = new_delta local dx = delta.magnitude local unit_delta = delta.unit -- acceleration due to gravity in RBX units local g = (-9.81 * 20) local theta = computeLaunchAngle( dx, dy, g) local vy = math.sin(theta) local xz = math.cos(theta) local vx = unit_delta.x * xz local vz = unit_delta.z * xz local missile = Pellet:clone() missile.CanCollide = true missile.RotVelocity = Vector3.new(math.random(), math.random(), math.random()) * 10 missile.Position = launch missile.Velocity = Vector3.new(vx,vy,vz) * VELOCITY missile.LightScript.Disabled = false local creator_tag = Instance.new("ObjectValue") creator_tag.Value = vPlayer creator_tag.Name = "creator" creator_tag.Parent = missile missile.Parent = game.Workspace end function locateHead() local vCharacter = Tool.Parent local vPlayer = game.Players:playerFromCharacter(vCharacter) return vCharacter:findFirstChild("Head") end function computeLaunchAngle(dx,dy,grav) -- arcane -- http://en.wikipedia.org/wiki/Trajectory_of_a_projectile local g = math.abs(grav) local inRoot = (VELOCITY*VELOCITY*VELOCITY*VELOCITY) - (g * ((g*dx*dx) + (2*dy*VELOCITY*VELOCITY))) if inRoot <= 0 then return .25 * math.pi end local root = math.sqrt(inRoot) local inATan1 = ((VELOCITY*VELOCITY) + root) / (g*dx) local inATan2 = ((VELOCITY*VELOCITY) - root) / (g*dx) local answer1 = math.atan(inATan1) local answer2 = math.atan(inATan2) if answer1 < answer2 then return answer1 end return answer2 end function computeDirection(vec) local lenSquared = vec.magnitude * vec.magnitude local invSqrt = 1 / math.sqrt(lenSquared) return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt) end Tool.Enabled = true 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 local targetPos = humanoid.TargetPoint fire(targetPos) wait(.3) Tool.Enabled = true Tool.Handle.Transparency=0 Tool.Handle.Mesh.VertexColor = colors[math.random(1,#colors)] end script.Parent.Activated:connect(onActivated)
---[[ Fade Out and In Settings ]]
module.ChatWindowBackgroundFadeOutTime = .25 --Chat background will fade out after this many seconds. module.ChatWindowTextFadeOutTime = 6 --Chat text will fade out after this many seconds. module.ChatDefaultFadeDuration = .5 module.ChatShouldFadeInFromNewInformation = true module.ChatAnimationFPS = 60.0
-------------------------
function DoorClose() if Shaft00.MetalDoor.CanCollide == false then Shaft00.MetalDoor.CanCollide = true while Shaft00.MetalDoor.Transparency > 0.0 do Shaft00.MetalDoor.Transparency = Shaft00.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, 20, 0) --Change 10 to change the speed. end if Shaft01.MetalDoor.CanCollide == false then Shaft01.MetalDoor.CanCollide = true while Shaft01.MetalDoor.Transparency > 0.0 do Shaft01.MetalDoor.Transparency = Shaft01.MetalDoor.Transparency - .1 wait(0.000001) end end if Shaft02.MetalDoor.CanCollide == false then Shaft02.MetalDoor.CanCollide = true while Shaft02.MetalDoor.Transparency > 0.0 do Shaft02.MetalDoor.Transparency = Shaft02.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, -20, 0) end if Shaft03.MetalDoor.CanCollide == false then Shaft03.MetalDoor.CanCollide = true while Shaft03.MetalDoor.Transparency > 0.0 do Shaft03.MetalDoor.Transparency = Shaft03.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, -20, 0) end if Shaft04.MetalDoor.CanCollide == false then Shaft04.MetalDoor.CanCollide = true while Shaft04.MetalDoor.Transparency > 0.0 do Shaft04.MetalDoor.Transparency = Shaft04.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, -20, 0) end if Shaft05.MetalDoor.CanCollide == false then Shaft05.MetalDoor.CanCollide = true while Shaft05.MetalDoor.Transparency > 0.0 do Shaft05.MetalDoor.Transparency = Shaft05.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, -20, 0) end if Shaft06.MetalDoor.CanCollide == false then Shaft06.MetalDoor.CanCollide = true while Shaft06.MetalDoor.Transparency > 0.0 do Shaft06.MetalDoor.Transparency = Shaft06.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, -20, 0) end if Shaft07.MetalDoor.CanCollide == false then Shaft07.MetalDoor.CanCollide = true while Shaft07.MetalDoor.Transparency > 0.0 do Shaft07.MetalDoor.Transparency = Shaft07.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, -20, 0) end if Shaft08.MetalDoor.CanCollide == false then Shaft08.MetalDoor.CanCollide = true while Shaft08.MetalDoor.Transparency > 0.0 do Shaft08.MetalDoor.Transparency = Shaft08.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, -20, 0) end if Shaft09.MetalDoor.CanCollide == false then Shaft09.MetalDoor.CanCollide = true while Shaft09.MetalDoor.Transparency > 0.0 do Shaft09.MetalDoor.Transparency = Shaft09.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, -20, 0) end if Shaft10.MetalDoor.CanCollide == false then Shaft10.MetalDoor.CanCollide = true while Shaft10.MetalDoor.Transparency > 0.0 do Shaft10.MetalDoor.Transparency = Shaft10.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, -20, 0) end if Shaft11.MetalDoor.CanCollide == false then Shaft11.MetalDoor.CanCollide = true while Shaft11.MetalDoor.Transparency > 0.0 do Shaft11.MetalDoor.Transparency = Shaft11.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, -20, 0) end if Shaft12.MetalDoor.CanCollide == false then Shaft12.MetalDoor.CanCollide = true while Shaft12.MetalDoor.Transparency > 0.0 do Shaft12.MetalDoor.Transparency = Shaft12.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, -20, 0) end if Shaft13.MetalDoor.CanCollide == false then Shaft13.MetalDoor.CanCollide = true while Shaft13.MetalDoor.Transparency > 0.0 do Shaft13.MetalDoor.Transparency = Shaft13.MetalDoor.Transparency - .1 wait(0.000001) end Car.BodyVelocity.velocity = Vector3.new(0, -20, 0) end end function onClicked() DoorClose() end script.Parent.MouseButton1Click:connect(onClicked) script.Parent.MouseButton1Click:connect(function() if clicker == true then clicker = false else return end end) script.Parent.MouseButton1Click:connect(function() Car.Touched:connect(function(otherPart) if otherPart == Elevator.Floors.F02 then StopE() DoorOpen() end end)end) function StopE() Car.BodyVelocity.velocity = Vector3.new(0, 0, 0) Car.BodyPosition.position = Elevator.Floors.F02.Position clicker = true end function DoorOpen() while Shaft01.MetalDoor.Transparency < 1.0 do Shaft01.MetalDoor.Transparency = Shaft01.MetalDoor.Transparency + .1 wait(0.000001) end Shaft01.MetalDoor.CanCollide = false end
-- Wait for the LocalPlayer
repeat wait() until Players.LocalPlayer local Logger = require(ReplicatedStorage.Dependencies.GameUtils.Logger) local CameraController = require(ReplicatedStorage.Source.Controllers.CameraController) local UIController = require(ReplicatedStorage.Source.Controllers.UIController) local ClientVehicleManager = require(ReplicatedStorage.Source.Managers.ClientVehicleManager) local ClientPlayerStatusHandler = require(ReplicatedStorage.Source.Player.ClientPlayerStatusHandler) local Preloader = require(ReplicatedStorage.Source.Preloader) local UserInput = require(ReplicatedStorage.Source.UserInput) local translateDataModel = require(ReplicatedStorage.Source.Common.translateDataModel)
--This is just some simple server script that moves the object around every frame --The kinematics module handles the rest
game["Run Service"].Heartbeat:Connect(function(deltaTime) part:PivotTo( CFrame.new(startPos + Vector3.new(math.sin(tick()) * orbit, math.cos(tick()) * orbit, 0))) end)
-- Client exposed properties:
PointsService.Client.MostPoints = RemoteProperty.new(0)
-- Server for Client, this is so it works in FE
local update = script:WaitForChild('Update') local Neck_Original = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0) function Tween(t,g) game.TweenService:Create(t,TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out),g):Play() end local SBMode = false local sine = 0 update.OnServerEvent:connect(function(player, request, mouseposition) pcall(function() local Torso = player.Character:FindFirstChild('Torso') local Arm = Torso:FindFirstChild('Right Shoulder') local Arm2 = Torso:FindFirstChild('Left Shoulder') if (request == 'Turn') then local Offset_O = (Torso.Position.y - mouseposition.y)/100--100 (mouse offset to direction) local Mag = (Torso.Position-mouseposition).magnitude/80 --80 (cone of y looking) local Offset = Offset_O/Mag local NeckWeld = Torso.Neck --NeckWeld.C0 = Neck_Original * CFrame.fromEulerAnglesXYZ(Offset-math.rad(90), 0, 0) sine = sine + .01 if Arm ~= nil then Arm.C0 = Arm.C0:lerp(CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0) * CFrame.fromEulerAnglesXYZ(0, 0, -Offset),0.3) end if Arm2 ~= nil then if SBMode == false then Arm2.C0 = Arm2.C0:lerp(CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0) * CFrame.fromEulerAnglesXYZ(0, 0, Offset),0.3) else end end elseif (request == 'Unequip') then sine = 0 Arm.C0 = CFrame.new(1, 0.5, 0) * CFrame.Angles(0, math.pi/2, 0) -- reset right arm Arm2.C0 = CFrame.new(-1, 0.5, 0) * CFrame.Angles(0, -math.pi/2, 0) -- reset left arm Torso.Neck.C0 = Neck_Original end end) end)
------------------------------------------------------------------------ -- the following priority table consists of pairs of left/right values -- for binary operators (was a static const struct); grep for ORDER OPR -- * the following struct is replaced: -- static const struct { -- lu_byte left; /* left priority for each binary operator */ -- lu_byte right; /* right priority */ -- } priority[] = { /* ORDER OPR */ ------------------------------------------------------------------------
luaY.priority = { {6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7}, -- `+' `-' `/' `%' {10, 9}, {5, 4}, -- power and concat (right associative) {3, 3}, {3, 3}, -- equality {3, 3}, {3, 3}, {3, 3}, {3, 3}, -- order {2, 2}, {1, 1} -- logical (and/or) } luaY.UNARY_PRIORITY = 8 -- priority for unary operators
--[=[ Determines if the passed object is a Janitor. This checks the metatable directly. @param Object any -- The object you are checking. @return boolean -- `true` if `Object` is a Janitor. ]=]
function Janitor.Is(Object: any): boolean return type(Object) == "table" and getmetatable(Object) == Janitor end type StringOrTrue = string | boolean
--============== READ ME ================-- -- PLACE THIS SCRIPT INTO StarterPlayerScripts -- it will not work otherwise
--Services
local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService")
--- Active
script.Parent.OnServerEvent:Connect(function(Player) local Projectile = game.ReplicatedStorage.Dragon.SkillZ.LightFX:Clone() local BV = Instance.new("BodyVelocity",Projectile) BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge) BV.Velocity = Player.Character.HumanoidRootPart.CFrame.LookVector * 0 Projectile.Parent = workspace Projectile.CanCollide = false Projectile.Anchored = false Projectile.CFrame = Player.Character.HumanoidRootPart.CFrame * CFrame.new(0,2,0) * CFrame.fromEulerAnglesXYZ(0,0,0) Projectile.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= Player.Name and hit.Parent:WaitForChild("Humanoid") ~= nil and hit.Parent:WaitForChild("Humanoid").Health ~= 0 and not hit.Parent:FindFirstChild("AlreadyHit") then local Check = Instance.new("IntValue", hit.Parent) Check.Name = "AlreadyHit" game.Debris:AddItem(Check ,1) local VCharacter = game.Workspace:FindFirstChild(Player.Name) local vPlayer = game.Players:GetPlayerFromCharacter(VCharacter) local Humanoid = hit.Parent:WaitForChild("Humanoid") Humanoid:TakeDamage(10) tagHumanoid(hit.Parent:FindFirstChild("Humanoid"),vPlayer) wait(0.05) untagHumanoid(hit.Parent:FindFirstChild("Humanoid")) end end) wait(3) BV:Destroy() Projectile.Anchored = false wait(2) Projectile.CanCollide = false wait(1) for i = 1,5 do wait(0.025) Projectile.Transparency = Projectile.Transparency + 0.1 Projectile.Texture1.Transparency = Projectile.Texture1.Transparency + 0.1 Projectile.Texture2.Transparency = Projectile.Texture2.Transparency + 0.1 end Projectile:Destroy() end)
-------- OMG HAX
r = game:service("RunService") local damage = 0 local slash_damage = 0 sword = script.Parent.Handle Tool = script.Parent local SlashSound = Instance.new("Sound") SlashSound.SoundId = "http://www.roblox.com/Asset/?ID=12135982" SlashSound.Parent = sword SlashSound.Volume = 0 function isTurbo(character) return character:FindFirstChild("PaperHat") ~= nil end 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 local d = damage if (isTurbo(vCharacter) == true) then d = d * 2.5 end tagHumanoid(humanoid, vPlayer) humanoid:TakeDamage(d) 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() damage = slash_damage SlashSound:play() local anim = Instance.new("StringValue") anim.Name = "toolanim" anim.Value = "Slash" anim.Parent = Tool end function swordUp() Tool.GripForward = Vector3.new(-1,0,0) Tool.GripRight = Vector3.new(0,1,0) Tool.GripUp = Vector3.new(0,0,1) end function swordOut() Tool.GripForward = Vector3.new(0,0,1) Tool.GripRight = Vector3.new(0,-1,0) Tool.GripUp = Vector3.new(-1,0,0) end Tool.Enabled = true 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 attack() wait(.4) Tool.Enabled = true end function onEquipped() SlashSound:play() end script.Parent.Activated:connect(onActivated) script.Parent.Equipped:connect(onEquipped) connection = sword.Touched:connect(blow)
--Rear Suspension
Tune.RSusDamping = 500 -- Spring Dampening Tune.RSusStiffness = 9000 -- Spring Force Tune.RSusLength = 2 -- Suspension length (in studs) Tune.RSusMaxExt = .3 -- Max Extension Travel (in studs) Tune.RSusMaxComp = .1 -- Max Compression Travel (in studs) Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal) Tune.RWsBoneLen = 5 -- Wishbone Length Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal) Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward
--script.Parent.Parent.Parent.MusicName.Text = Asset.Name
end while wait(1) do if script.Parent.Playing == false then Music() end end
----- MAGIC NUMBERS ABOUT THE TOOL ----- -- How much damage a bullet does
local Damage = 0.5
-- When you are done editing this, save this place then go to it then say the word to regenerate the model.
------------------------------------------------------------------------ -- -- * used in multiple locations ------------------------------------------------------------------------
function luaK:exp2RK(fs, e) self:exp2val(fs, e) local k = e.k if k == "VKNUM" or k == "VTRUE" or k == "VFALSE" or k == "VNIL" then if fs.nk <= luaP.MAXINDEXRK then -- constant fit in RK operand? -- converted from a 2-deep ternary operator expression if e.k == "VNIL" then e.info = self:nilK(fs) else e.info = (e.k == "VKNUM") and self:numberK(fs, e.nval) or self:boolK(fs, e.k == "VTRUE") end e.k = "VK" return luaP:RKASK(e.info) end elseif k == "VK" then if e.info <= luaP.MAXINDEXRK then -- constant fit in argC? return luaP:RKASK(e.info) end else -- default end -- not a constant in the right range: put it in a register return self:exp2anyreg(fs, e) end
--strategy that you walk around the opponent while running away
--Tune--
local StockHP = 500 --Power output desmos: https://www.desmos.com/calculator/wezfve8j90 (does not come with torque curve) local TurboCount = 2 --(1 = SingleTurbo),(2 = TwinTurbo),(if bigger then it will default to 2 turbos) local TurboSize = 65 --bigger the turbo, the more lag it has local WasteGatePressure = 12 --Max PSI for each turbo (if twin and running 10 PSI, thats 10PSI for each turbo) local CompressionRatio = 9/1 --Compression of your car (look up the compression of the engine you are running) local AntiLag = true --if true basically keeps the turbo spooled up so less lag local BOV_Loudness = 1 --volume of the BOV (not exact volume so you kinda have to experiment with it) local TurboLoudness = 1 --volume of the Turbo (not exact volume so you kinda have to experiment with it also)
--Made by Luckymaxer
Tool = script.Parent Handle = Tool:WaitForChild("Handle") Players = game:GetService("Players") Debris = game:GetService("Debris") RunService = game:GetService("RunService") ContentProvider = game:GetService("ContentProvider") UserInputService = game:GetService("UserInputService") InputCheck = Instance.new("ScreenGui") InputCheck.Name = "InputCheck" InputFrame = Instance.new("Frame") InputFrame.BackgroundTransparency = 1 InputFrame.Size = UDim2.new(1, 0, 1, 0) InputFrame.Parent = InputCheck RbxUtility = LoadLibrary("RbxUtility") Create = RbxUtility.Create Animations = {} ServerControl = Tool:WaitForChild("ServerControl") ClientControl = Tool:WaitForChild("ClientControl") Rate = (1 / 60) ToolEquipped = false function SetAnimation(mode, value) if not ToolEquipped or not CheckIfAlive() then return end local function StopAnimation(Animation) for i, v in pairs(Animations) do if v.Animation == Animation then v.AnimationTrack:Stop(value.EndFadeTime) if v.TrackStopped then v.TrackStopped:disconnect() end table.remove(Animations, i) end end end if mode == "PlayAnimation" then for i, v in pairs(Animations) do if v.Animation == value.Animation then if value.Speed then v.AnimationTrack:AdjustSpeed(value.Speed) return elseif value.Weight or value.FadeTime then v.AnimationTrack:AdjustWeight(value.Weight, value.FadeTime) return else StopAnimation(value.Animation, false) end end end local AnimationMonitor = Create("Model"){} local TrackEnded = Create("StringValue"){Name = "Ended"} local AnimationTrack = Humanoid:LoadAnimation(value.Animation) local TrackStopped if not value.Manual then TrackStopped = AnimationTrack.Stopped:connect(function() if TrackStopped then TrackStopped:disconnect() end StopAnimation(value.Animation, true) TrackEnded.Parent = AnimationMonitor end) end table.insert(Animations, {Animation = value.Animation, AnimationTrack = AnimationTrack, TrackStopped = TrackStopped}) AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed) if TrackStopped then AnimationMonitor:WaitForChild(TrackEnded.Name) end return TrackEnded.Name elseif mode == "StopAnimation" and value then StopAnimation(value.Animation) end end function CheckIfAlive() return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false) end function Equipped(Mouse) Character = Tool.Parent Player = Players:GetPlayerFromCharacter(Character) Humanoid = Character:FindFirstChild("Humanoid") ToolEquipped = true if not CheckIfAlive() then return end Spawn(function() PlayerMouse = Player:GetMouse() Mouse.Button1Down:connect(function() InvokeServer("Button1Click", {Down = true}) end) Mouse.Button1Up:connect(function() InvokeServer("Button1Click", {Down = false}) end) Mouse.KeyDown:connect(function(Key) InvokeServer("KeyPress", {Key = Key, Down = true}) end) Mouse.KeyUp:connect(function(Key) InvokeServer("KeyPress", {Key = Key, Down = false}) end) local PlayerGui = Player:FindFirstChild("PlayerGui") if PlayerGui then InputCheckClone = InputCheck:Clone() if UserInputService.TouchEnabled then InputCheckClone = InputCheck:Clone() InputCheckClone.InputButton.InputBegan:connect(function() InvokeServer("Button1Click", {Down = true}) end) InputCheckClone.InputButton.InputEnded:connect(function() InvokeServer("Button1Click", {Down = false}) end) InputCheckClone.Parent = PlayerGui end end for i, v in pairs(Tool:GetChildren()) do if v:IsA("Animation") then ContentProvider:Preload(v.AnimationId) end end end) end function Unequipped() if InputCheckClone then Debris:AddItem(InputCheckClone, 0) end for i, v in pairs(Animations) do if v and v.AnimationTrack then v.AnimationTrack:Stop() end end Animations = {} ToolEquipped = false end function InvokeServer(mode, value) local ServerReturn = nil pcall(function() ServerReturn = ServerControl:InvokeServer(mode, value) end) return ServerReturn end function OnClientInvoke(mode, value) if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then SetAnimation("PlayAnimation", value) elseif mode == "StopAnimation" and value then SetAnimation("StopAnimation", value) elseif mode == "PlaySound" and value then value:Play() elseif mode == "StopSound" and value then value:Stop() elseif mode == "MousePosition" then return ((PlayerMouse and {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}) or nil) end end ClientControl.OnClientInvoke = OnClientInvoke Tool.Equipped:connect(Equipped) Tool.Unequipped:connect(Unequipped)
--edit the function below to return true when you want this response/prompt to be valid --player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder) local ClassInformationTable = require(game.ReplicatedStorage.Source.Modules.CharacterScripts.Classes.ClassInformation) return ClassInformationTable:GetClassFolder(player,"Warlock").FastCasting.Value and ClassInformationTable:GetClassFolder(player,"Warlock").PocketStep.Value ~= true end
-- Create class
local ArcHandles = {} ArcHandles.__index = ArcHandles
--Main
return require(ReplicatedStorage.Systems.EntitySystem.EntityClient.Render.EntityRenderController)
--mesh.Scale = Vector3.new(0.1,1,0.1)
local RetractionSpeed = 80 local StartDistance = 100 local PlayerBodyVelocity = Instance.new("BodyVelocity") PlayerBodyVelocity.maxForce = Vector3.new(1e+0010, 1e+0010, 1e+0010) local ObjectBodyVelocity = Instance.new("BodyVelocity") ObjectBodyVelocity.maxForce = Vector3.new(14000,14000,14000) --force necessary to forcefully grab a player local bodyPos = Instance.new("BodyPosition") bodyPos.D = 1e+003 bodyPos.P = 3e+003 bodyPos.maxForce = Vector3.new(1e+006, 1e+006, 1e+006) local bodyGyro = Instance.new("BodyGyro") bodyGyro.maxTorque = Vector3.new(math.huge,math.huge,math.huge) function BreakRope() if human then human.Sit = false end rope.Parent = nil if PlayerBodyVelocity then PlayerBodyVelocity.Parent = nil end if ObjectBodyVelocity then ObjectBodyVelocity.Parent = nil end bodyGyro.Parent = nil if bolt ~= nil then bolt.Parent = nil end if holdweld ~= nil then holdweld.Parent = nil end holdweld = nil bolt = nil --Tool.Handle.Mesh.MeshId = "http://www.roblox.com/asset/?id=89987774" --Tool.GripPos = defaultPos wait(.45) if bolt == nil then bodyGyro.Parent = nil --keep the gyro a little longer so retracted object doesnt ragdoll player end script.Parent.Bolt.Transparency = 0 end function adjustRope() if bolt and torso then if (torso.Position - bolt.Position).magnitude > maxDistance then BreakRope() end end if rope.Parent == nil or bolt == nil then return end local pos1 = Tool.Bolt.Position + Tool.Bolt.CFrame.lookVector*.3 local pos2 = bolt.Position rope.Size = Vector3.new(0, 1, 0) rope.Mesh.Scale = Vector3.new(0.1, (pos1-pos2).magnitude, 0.1) rope.CFrame = CFrame.new((pos1 + pos2)/2, pos2) * CFrame.fromEulerAnglesXYZ(-math.pi/2,0,0) end function updateVelocities() if bolt and torso and ObjectBodyVelocity then local grappleVector = (torso.Position - bolt.Position) if grappleVector.magnitude > maxDistance then BreakRope() return end if bolt.Velocity.magnitude < 3 and -1* torso.Velocity:Dot(grappleVector.unit) < 5 and grappleVector.magnitude < .75 * StartDistance then print("hop up") PlayerBodyVelocity.velocity = PlayerBodyVelocity.velocity + Vector3.new(0,20,0) wait(.25) BreakRope() return end if grappleVector.magnitude < 3.5 then print("grapple end") wait(.20) BreakRope() return else ObjectBodyVelocity.velocity = grappleVector.unit * RetractionSpeed local boltRetraction = math.max(grappleVector.unit:Dot(bolt.Velocity),0) --no negative speed local playerSpeed = math.max(0, RetractionSpeed - 5 - boltRetraction) if playerSpeed == 0 then PlayerBodyVelocity.Parent = nil else PlayerBodyVelocity.Parent = torso PlayerBodyVelocity.velocity = grappleVector.unit * playerSpeed * -1 end end else BreakRope() end end function onBoltHit(hit) if bolt == nil or hit == nil or hit.Parent == nil or hit == rope or bolt.Name ~= "Bolt" or hit.Parent == Tool or hit.Parent == Tool.Parent or hit.Parent.Parent == Tool.Parent or hit.Parent.Name == "Attached Bolt" then return end local grappleVector = (torso.Position - bolt.Position) StartDistance = grappleVector.magnitude if StartDistance > maxDistance then bolt.Parent = nil bolt = nil return end bolt.Name = "Attached Bolt" local boltFrame = CFrame.new(hit.Position) local C0 = hit.CFrame:inverse() * boltFrame local C1 = bolt.CFrame:inverse() * boltFrame local weld = Instance.new("Weld") weld.Part0 = hit weld.Part1 = bolt weld.C0 = C0 weld.C1 = C1 weld.Parent = bolt local hum = hit.Parent:FindFirstChild("Humanoid") if hum then hum.Sit = true end if bolt:FindFirstChild("HitSound") then bolt.HitSound:play() end local backupbolt = bolt ObjectBodyVelocity = Instance.new("BodyVelocity") ObjectBodyVelocity.maxForce = Vector3.new(5000,5000,5000) ObjectBodyVelocity.velocity = grappleVector.unit * RetractionSpeed ObjectBodyVelocity.Parent = bolt wait(0.4) if bolt == nil or bolt ~= backupbolt then return end bolt.ConnectSound:play() Tool.Handle.ConnectSound:play() script.Parent.Bolt.Transparency = 1 targetPos = bolt.Position backupPos = bolt.Position --bodyPos.position = targetPos --bodyPos.Parent = torso PlayerBodyVelocity.Parent = torso PlayerBodyVelocity.velocity = Vector3.new(0,0,0) bodyGyro.cframe = torso.CFrame bodyGyro.Parent = torso while bolt ~= nil do --bodyPos.position = bolt.Position updateVelocities() wait(1/30) end end enabled = true local canReset = true function onButton1Down(mouse) if bolt and canReset then BreakRope() end if not enabled then return end if bolt ~= nil and not canFireWhileGrappling then return end if bolt ~= nil then if boltconnect ~= nil then print("Disconnecting") boltconnect:disconnect() end bolt:remove() targetPos = Vector3.new(0,0,0) end Tool.Handle.FireSound:play() enabled = false mouse.Icon = "rbxasset://textures\\GunWaitCursor.png" --bolt = game:GetService("InsertService"):LoadAsset(33393977) script.Parent.Bolt.Transparency = 1 bolt = Tool.Bolt:Clone() bolt.Name = "Bolt" bolt.Size = Vector3.new(1,.4,1) bolt.Locked = false --bolt.Mesh.MeshId = "http://www.roblox.com/asset/?id=89989174" --local instances = bolt:GetChildren() --if #instances == 0 then -- bolt:Remove() -- return --end --bolt = bolt:FindFirstChild("Bolt") --local boltMesh = bolt:FindFirstChild("Mesh") bolt.CFrame = CFrame.new(Tool.Bolt.Position + (mouse.Hit.p - Tool.Bolt.Position).unit * 5,mouse.Hit.p) --* CFrame.fromEulerAnglesXYZ(0,math.pi,0) bolt.Transparency = 0 bolt.CanCollide = false bolt.Velocity = bolt.CFrame.lookVector * 80 if bolt:findFirstChild("BodyPosition") ~= nil then bolt.BodyPosition:remove() end local force = Instance.new("BodyForce") force.force = Vector3.new(0,bolt:GetMass() * 196.1,0) force.Parent = bolt bolt.Parent = workspace boltconnect = bolt.AncestryChanged:connect(function() onKeyDown("q") end) bolt.Touched:connect(onBoltHit) rope.Parent = Tool bolt.Parent = game.Workspace --Tool.Handle.Mesh.MeshId = "http://www.roblox.com/asset/?id=89988787" --Tool.GripPos = adjustedPos canReset = false wait(.5) canReset = true wait(1) mouse.Icon = "rbxasset://textures\\GunCursor.png" enabled = true end function onKeyDown(key) key = key:lower() if key == "q" then BreakRope() end end function getHumanoid(obj) for i,child in pairs(obj:getChildren()) do if child.className == "Humanoid" then return child end end end function onEquippedLocal(mouse) if mouse == nil then print("Mouse not found") return end torso = Tool.Parent:findFirstChild("Torso") human = Tool.Parent:FindFirstChild("Humanoid")--getHumanoid(Tool.Parent) if torso == nil or human == nil then return end human.Jumping:connect(function() onKeyDown("q") end) mouse.Icon = "rbxasset://textures\\GunCursor.png" mouse.Button1Down:connect(function() onButton1Down(mouse) end) mouse.KeyDown:connect(onKeyDown) end Tool.Equipped:connect(onEquippedLocal) Tool.Unequipped:connect(function() onKeyDown("q") end) while true do adjustRope() wait(1/60) end
--[[ GameGUI.Settings.Queue.MouseButton1Click:connect(function() BonusRoundFrame.Visible = not BonusRoundFrame.Visible; end)]]
local BuyingIndex; for _,Frame in pairs(BonusRoundFrame.BuyMode:GetChildren()) do Frame.Buy.MouseButton1Click:connect(function() game.ReplicatedStorage.BuyMode:FireServer(Frame.Name,BuyingIndex); end) end game.ReplicatedStorage.BuyMode.OnClientEvent:connect(function(Index,GameMode) local ModeFrame = BonusRoundFrame.Title.Container.ModeContainer["Mode"..Index]; ModeFrame.Icon.Image = Icons[GameMode] or ""; ModeFrame.ModeName.Text = ""; ModeFrame.QMark.Visible = false; local Overhead = BonusRoundFrame.Title.Container.OverheadContainer["Mode"..Index]; Overhead.Buy.Visible = false; Overhead.Purchased.Visible = true; end) local function UpdateQueue(BonusRoundQueue,CurrentMode,RandomM,StartVoting) BonusRoundFrame.Title.Container.ModeContainer:ClearAllChildren(); BonusRoundFrame.Title.Container.OverheadContainer:ClearAllChildren(); for Index,GameModeName in pairs(BonusRoundQueue) do local ModeFrame = script.GameMode:Clone(); ModeFrame.QMark.Visible = (GameModeName=="Locked"or GameModeName=="Random"); ModeFrame.ModeName.Text = (GameModeName=="Locked"or GameModeName=="Random") and "Random" or ""; ModeFrame.Locked.Visible = (GameModeName=="Locked"); ModeFrame.Icon.Image = Icons[GameModeName] or ""; if Index==1 then ModeFrame.BackgroundColor3 = Color3.new(40/255,40/255,40/255); ModeFrame.BorderColor3 = Color3.new(25/255,25/255,25/255); ModeFrame.ModeName.TextColor3 = Color3.new(59/255,59/255,59/255); ModeFrame.QMark.TextColor3 = Color3.new(59/255,59/255,59/255); ModeFrame.Icon.Image = BWIcons[GameModeName]or""; end ModeFrame.Position = UDim2.new(0,(Index-1)*(76+7),0,4); ModeFrame.Name = "Mode"..Index; ModeFrame.Parent = BonusRoundFrame.Title.Container.ModeContainer; local OverheadFrame = script.Overhead:Clone(); local NextUp = (Index==2); local Buy = (GameModeName=="Random"); local Purchased = (GameModeName~="Random"and GameModeName~="Locked"); local Buyable = (Buy and not NextUp); OverheadFrame.Name = "Mode"..Index; OverheadFrame.Buy.Visible = Buyable; if Buyable then OverheadFrame.Buy.MouseButton1Click:connect(function() if BuyingIndex ~= Index then BonusRoundFrame.BuyMode.Visible = true; BonusRoundFrame.Loading.Visible = false; BonusRoundFrame.Voting.Visible = false; BonusRoundFrame.Nothing.Visible = false; BuyingIndex = Index; for _,OV in pairs(BonusRoundFrame.Title.Container.OverheadContainer:GetChildren()) do OV.Buy.Style = (OV==OverheadFrame and Enum.ButtonStyle.RobloxRoundButton) or Enum.ButtonStyle.RobloxRoundDefaultButton; end else BuyingIndex = nil; OverheadFrame.Buy.Style = Enum.ButtonStyle.RobloxRoundDefaultButton; BonusRoundFrame.BuyMode.Visible = false; BonusRoundFrame.Loading.Visible = Stage=="Loading"; BonusRoundFrame.Voting.Visible = Stage=="Voting"; BonusRoundFrame.Nothing.Visible = Stage=="Nothing"; end; -- game.ReplicatedStorage.BuyMode:FireServer(Index); end) end OverheadFrame.Locked.Visible = (GameModeName=="Locked" and not NextUp); OverheadFrame.Next.Visible = NextUp; OverheadFrame.Purchased.Visible = Purchased and not NextUp; OverheadFrame.Position = UDim2.new(0,(Index-1)*(76+7),0,-2); OverheadFrame.Parent = BonusRoundFrame.Title.Container.OverheadContainer; end if StartVoting then BonusRoundFrame.Nothing.Visible = false; if RandomM then RandomModes = RandomM; BonusRoundFrame.Voting.Visible = true; Stage = "Voting"; else RandomModes = {}; BonusRoundFrame.Voting.Visible = false; BonusRoundFrame.Loading.Visible = true; Stage = "Loading"; BonusRoundFrame.Loading[CurrentMode].Visible = true; end; UpdateVotes(); end; end game.ReplicatedStorage.VoteBonusRound.OnClientEvent:connect(function(BonusRoundQueue,CurrentMode,RandomM) UpdateQueue(BonusRoundQueue,CurrentMode,RandomM,true); BonusRoundFrame.Visible = true; end) local BonusRoundQueue = game.ReplicatedStorage.GetQueue:InvokeServer(); UpdateQueue(BonusRoundQueue);
-- Position --
local openState = UDim2.new(0.005, 0,0, 0) local closeState = UDim2.new(0.005, 0,0.996, 0)
-- Returns whether the inputted status passes the TextFilter, otherwise also returns an error
function UpdateProfileRemoteFunction.OnServerInvoke(playerFiring, playerSelected, statusText) local filteredStatus = filterText(statusText, playerSelected.UserId, playerFiring.UserId) if filteredStatus == statusText then playerFiring:SetAttribute("status", filteredStatus) end return { success = filteredStatus == statusText } end
--[[ local frame = game.StarterGui.HDAdminGUIs.MainFrame for a,b in pairs(frame:GetDescendants()) do if b:IsA("GuiObject") then b.ZIndex = b.ZIndex + 10 end end game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false) game:GetService("StarterGui"):SetCore("TopbarEnabled", false) --]]
return module
--- All the (>level 2) services, all at EOS to same memory and typing strokes :D
Services.AssetService = game:GetService("AssetService") Services.BadgeService = game:GetService("BadgeService") Services.CollectionService = game:GetService("CollectionService") Services.ContextActionService = game:GetService("ContextActionService") Services.ControllerService = game:GetService("ControllerService") Services.DataStoreService = require(game:GetService("ReplicatedStorage").DataStoreService) Services.FriendService = game:GetService("FriendService") Services.GamepadService = game:GetService("GamepadService") Services.GamePassService = game:GetService("GamePassService") Services.GroupService = game:GetService("GroupService") Services.GuiService = game:GetService("GuiService") Services.HapticService = game:GetService("HapticService") Services.HttpService = game:GetService("HttpService") Services.InsertService = game:GetService("InsertService") Services.JointsService = game:GetService("JointsService") Services.KeyboardService = game:GetService("KeyboardService") Services.LocalizationService = game:GetService("LocalizationService") Services.LoginService = game:GetService("LoginService") Services.LogService = game:GetService("LogService") Services.MarketplaceService = game:GetService("MarketplaceService") Services.MouseService = game:GetService("MouseService") Services.MessagingService = game:GetService("MessagingService") Services.NotificationService = game:GetService("NotificationService") Services.PathfindingService = game:GetService("PathfindingService") Services.PhysicsService = game:GetService("PhysicsService") Services.PointsService = game:GetService("PointsService") Services.RunService = game:GetService("RunService") Services.SoundService = game:GetService("SoundService") Services.TeleportService = game:GetService("TeleportService") Services.TextService = game:GetService("TextService") Services.TweenService = game:GetService("TweenService") Services.TouchInputService = game:GetService("TouchInputService") Services.UserInputService = game:GetService("UserInputService") Services.VRService = game:GetService("VRService")
--// SS3 controls for AC6 by Itzt, originally for 2014 Infiniti QX80. i don't know how to tune ac lol
wait(0.1) local player = game.Players.LocalPlayer local HUB = script.Parent.HUB local HUB2 = script.Parent.HUB2 local limitButton = HUB.Name local FE = game.Workspace.FilteringEnabled local lightOn = false local Camera = game.Workspace.CurrentCamera local cam = script.Parent.nxtcam.Value local carSeat = script.Parent.CarSeat.Value local mouse = game.Players.LocalPlayer:GetMouse() local windows = false local handler = carSeat:WaitForChild('Filter') local winfob = HUB.Parent.Music local pal = false local palpal = HUB.Parent.Palette local red = 0 local green = 0 local blue = 1 local debounce = false script.Parent.Infotainment.Main.User.Text = "Hello, "..(player.Name) local scr = false
--(FL.RotVelocity.Magnitude+FR.RotVelocity.Magnitude+RL.RotVelocity.Magnitude+RR.RotVelocity.Magnitude+(speed/1.33034))/5
while wait() do speed = carSeat.Velocity.Magnitude power = 0 average = 10*(1-(carSeat.Storage.BrakeBias.Value/100)) track = carSeat.Velocity.Unit*carSeat.CFrame.lookVector slipDetection = track.X+track.Z Right = (carSeat.Parent.Parent.Wheels.RR.Wheel.Velocity.Magnitude+carSeat.Parent.Parent.Wheels.FR.Wheel.Velocity.Magnitude)/2 Left = (carSeat.Parent.Parent.Wheels.RL.Wheel.Velocity.Magnitude+carSeat.Parent.Parent.Wheels.FL.Wheel.Velocity.Magnitude)/2 if Right > Left then left = true else left = false end if script.OVERRIDE.Value == false then if carSeat.Storage.ASC.Value == true then if speed > 45 then if carSeat.Steer ~= 0 then if slipDetection < 0.995 and left == false then script.Toggle.Value = true carSeat.Storage.TC.Value = true else script.Toggle.Value = false carSeat.Storage.TC.Value = false end elseif carSeat.Steer == 0 then if slipDetection < 0.99984 and left == false then --carSeat.Storage.TC.Value = true --script.Toggle.Value = true else script.Toggle.Value = false carSeat.Storage.TC.Value = false end else script.Toggle.Value = false end else script.Toggle.Value = false end
-------------------------------------------------------------------------
local function IsInBottomLeft(pt) local joystickHeight = math_min(Utility.ViewSizeY() * 0.33, 250) local joystickWidth = joystickHeight return pt.X <= joystickWidth and pt.Y > Utility.ViewSizeY() - joystickHeight end local function IsInBottomRight(pt) local joystickHeight = math_min(Utility.ViewSizeY() * 0.33, 250) local joystickWidth = joystickHeight return pt.X >= Utility.ViewSizeX() - joystickWidth and pt.Y > Utility.ViewSizeY() - joystickHeight end local function CheckAlive(character) local humanoid = findPlayerHumanoid(Player) return humanoid ~= nil and humanoid.Health > 0 end local function GetEquippedTool(character) if character ~= nil then for _, child in pairs(character:GetChildren()) do if child:IsA('Tool') then return child end end end end local ExistingPather = nil local ExistingIndicator = nil local PathCompleteListener = nil local PathFailedListener = nil local function CleanupPath() DrivingTo = nil if ExistingPather then ExistingPather:Cancel() end if PathCompleteListener then PathCompleteListener:disconnect() PathCompleteListener = nil end if PathFailedListener then PathFailedListener:disconnect() PathFailedListener = nil end if ExistingIndicator then local obj = ExistingIndicator local tween = obj:TweenOut() local tweenCompleteEvent = nil tweenCompleteEvent = tween.Completed:connect(function() tweenCompleteEvent:disconnect() obj.Model:Destroy() end) ExistingIndicator = nil end end local function getExtentsSize(Parts) local maxX,maxY,maxZ = -math.huge,-math.huge,-math.huge local minX,minY,minZ = math.huge,math.huge,math.huge for i = 1, #Parts do maxX,maxY,maxZ = math_max(maxX, Parts[i].Position.X), math_max(maxY, Parts[i].Position.Y), math_max(maxZ, Parts[i].Position.Z) minX,minY,minZ = math_min(minX, Parts[i].Position.X), math_min(minY, Parts[i].Position.Y), math_min(minZ, Parts[i].Position.Z) end return Region3.new(Vector3_new(minX, minY, minZ), Vector3_new(maxX, maxY, maxZ)) end local function inExtents(Extents, Position) if Position.X < (Extents.CFrame.p.X - Extents.Size.X/2) or Position.X > (Extents.CFrame.p.X + Extents.Size.X/2) then return false end if Position.Z < (Extents.CFrame.p.Z - Extents.Size.Z/2) or Position.Z > (Extents.CFrame.p.Z + Extents.Size.Z/2) then return false end --ignoring Y for now return true end local FailCount = 0 local function OnTap(tapPositions, goToPoint) -- Good to remember if this is the latest tap event local camera = workspace.CurrentCamera local character = Player.Character if not CheckAlive(character) 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) -- inivisicam stuff local initIgnore = getIgnoreList() local invisicamParts = InvisicamModule and InvisicamModule:GetObscuredParts() or {} local ignoreTab = {} -- add to the ignore list for i, v in pairs(invisicamParts) do ignoreTab[#ignoreTab+1] = i end for i = 1, #initIgnore do ignoreTab[#ignoreTab+1] = initIgnore[i] end -- local myHumanoid = findPlayerHumanoid(Player) local hitPart, hitPt, hitNormal, hitMat = Utility.Raycast(ray, true, ignoreTab) local hitChar, hitHumanoid = Utility.FindChacterAncestor(hitPart) local torso = GetTorso() local startPos = torso.CFrame.p if goToPoint then hitPt = goToPoint hitChar = nil end if hitChar and hitHumanoid and hitHumanoid.Torso and (hitHumanoid.Torso.CFrame.p - torso.CFrame.p).magnitude < 7 then CleanupPath() if myHumanoid then myHumanoid:MoveTo(hitPt) end -- Do shoot local currentWeapon = GetEquippedTool(character) if currentWeapon then currentWeapon:Activate() LastFired = tick() end elseif hitPt and character and not CurrentSeatPart then local thisPather = Pather(character, hitPt, hitNormal) if thisPather:IsValidPath() then FailCount = 0 thisPather:Start() if BindableEvent_OnFailStateChanged then BindableEvent_OnFailStateChanged:Fire(false) end CleanupPath() local destinationPopup = createNewPopup("DestinationPopup") destinationPopup:Place(hitPt, Vector3_new(0,hitPt.y,0)) local failurePopup = createNewPopup("FailurePopup") local currentTween = destinationPopup:TweenIn() ExistingPather = thisPather ExistingIndicator = destinationPopup PathCompleteListener = thisPather.Finished:connect(function() if destinationPopup then if ExistingIndicator == destinationPopup then ExistingIndicator = nil end local tween = destinationPopup:TweenOut() local tweenCompleteEvent = nil tweenCompleteEvent = tween.Completed:connect(function() tweenCompleteEvent:disconnect() destinationPopup.Model:Destroy() destinationPopup = nil end) end if hitChar then local humanoid = findPlayerHumanoid(Player) local currentWeapon = GetEquippedTool(character) if currentWeapon then currentWeapon:Activate() LastFired = tick() end if humanoid then humanoid:MoveTo(hitPt) end end end) PathFailedListener = thisPather.PathFailed:connect(function() if failurePopup then failurePopup:Place(hitPt, Vector3_new(0,hitPt.y,0)) local failTweenIn = failurePopup:TweenIn() failTweenIn.Completed:wait() local failTweenOut = failurePopup:TweenOut() failTweenOut.Completed:wait() failurePopup.Model:Destroy() failurePopup = nil end end) else if hitPt then -- Feedback here for when we don't have a good path local foundDirectPath = false if (hitPt-startPos).Magnitude < 25 and (startPos.y-hitPt.y > -3) then -- move directly here if myHumanoid then if myHumanoid.Sit then myHumanoid.Jump = true end local currentPosition myHumanoid:MoveTo(hitPt) foundDirectPath = true end end spawn(function() local directPopup = createNewPopup(foundDirectPath and "DirectWalkPopup" or "FailurePopup") directPopup:Place(hitPt, Vector3_new(0,hitPt.y,0)) local directTweenIn = directPopup:TweenIn() directTweenIn.Completed:wait() local directTweenOut = directPopup:TweenOut() directTweenOut.Completed:wait() directPopup.Model:Destroy() directPopup = nil end) end end elseif hitPt and character and CurrentSeatPart then local destinationPopup = createNewPopup("DestinationPopup") ExistingIndicator = destinationPopup destinationPopup:Place(hitPt, Vector3_new(0,hitPt.y,0)) destinationPopup:TweenIn() DrivingTo = hitPt local ConnectedParts = CurrentSeatPart:GetConnectedParts(true) while wait() do if CurrentSeatPart and ExistingIndicator == destinationPopup then local ExtentsSize = getExtentsSize(ConnectedParts) if inExtents(ExtentsSize, hitPt) then local popup = destinationPopup spawn(function() local tweenOut = popup:TweenOut() tweenOut.Completed:wait() popup.Model:Destroy() end) destinationPopup = nil DrivingTo = nil break end else if CurrentSeatPart == nil and destinationPopup == ExistingIndicator then DrivingTo = nil OnTap(tapPositions, hitPt) end local popup = destinationPopup spawn(function() local tweenOut = popup:TweenOut() tweenOut.Completed:wait() popup.Model:Destroy() end) destinationPopup = nil break end end end end elseif #tapPositions >= 2 then if camera then -- Do shoot local avgPoint = Utility.AveragePoints(tapPositions) local unitRay = camera:ScreenPointToRay(avgPoint.x, avgPoint.y) local currentWeapon = GetEquippedTool(character) if currentWeapon then currentWeapon:Activate() LastFired = tick() end end end end local function CreateClickToMoveModule() local this = {} local LastStateChange = 0 local LastState = Enum.HumanoidStateType.Running local FingerTouches = {} local NumUnsunkTouches = 0 -- PC simulation local mouse1Down = tick() local mouse1DownPos = Vector2_new() local mouse2Down = tick() local mouse2DownPos = Vector2_new() local mouse2Up = tick() local movementKeys = { [Enum.KeyCode.W] = true; [Enum.KeyCode.A] = true; [Enum.KeyCode.S] = true; [Enum.KeyCode.D] = true; [Enum.KeyCode.Up] = true; [Enum.KeyCode.Down] = true; } local TapConn = nil local InputBeganConn = nil local InputChangedConn = nil local InputEndedConn = nil local HumanoidDiedConn = nil local CharacterChildAddedConn = nil local OnCharacterAddedConn = nil local CharacterChildRemovedConn = nil local RenderSteppedConn = nil local HumanoidSeatedConn = nil local function disconnectEvent(event) if event then event:disconnect() end end local function DisconnectEvents() disconnectEvent(TapConn) disconnectEvent(InputBeganConn) disconnectEvent(InputChangedConn) disconnectEvent(InputEndedConn) disconnectEvent(HumanoidDiedConn) disconnectEvent(CharacterChildAddedConn) disconnectEvent(OnCharacterAddedConn) disconnectEvent(RenderSteppedConn) disconnectEvent(CharacterChildRemovedConn) pcall(function() RunService:UnbindFromRenderStep("ClickToMoveRenderUpdate") end) disconnectEvent(HumanoidSeatedConn) end local function IsFinite(num) return num == num and num ~= 1/0 and num ~= -1/0 end local function findAngleBetweenXZVectors(vec2, vec1) return math_atan2(vec1.X*vec2.Z-vec1.Z*vec2.X, vec1.X*vec2.X + vec1.Z*vec2.Z) end local function OnTouchBegan(input, processed) if FingerTouches[input] == nil and not processed then NumUnsunkTouches = NumUnsunkTouches + 1 end FingerTouches[input] = processed end local function OnTouchChanged(input, processed) if FingerTouches[input] == nil then FingerTouches[input] = processed if not processed then NumUnsunkTouches = NumUnsunkTouches + 1 end end end local function OnTouchEnded(input, processed) if FingerTouches[input] ~= nil and FingerTouches[input] == false then NumUnsunkTouches = NumUnsunkTouches - 1 end FingerTouches[input] = nil end local function OnCharacterAdded(character) DisconnectEvents() InputBeganConn = UIS.InputBegan:connect(function(input, processed) if input.UserInputType == Enum.UserInputType.Touch then OnTouchBegan(input, processed) -- Give back controls when they tap both sticks local wasInBottomLeft = IsInBottomLeft(input.Position) local wasInBottomRight = IsInBottomRight(input.Position) if wasInBottomRight or wasInBottomLeft then for otherInput, _ in pairs(FingerTouches) do if otherInput ~= input then local otherInputInLeft = IsInBottomLeft(otherInput.Position) local otherInputInRight = IsInBottomRight(otherInput.Position) if otherInput.UserInputState ~= Enum.UserInputState.End and ((wasInBottomLeft and otherInputInRight) or (wasInBottomRight and otherInputInLeft)) then if BindableEvent_OnFailStateChanged then BindableEvent_OnFailStateChanged:Fire(true) end return end end end end end -- Cancel path when you use the keyboard controls. if processed == false and input.UserInputType == Enum.UserInputType.Keyboard and movementKeys[input.KeyCode] then CleanupPath() end if input.UserInputType == Enum.UserInputType.MouseButton1 then mouse1Down = tick() mouse1DownPos = input.Position end if input.UserInputType == Enum.UserInputType.MouseButton2 then mouse2Down = tick() mouse2DownPos = input.Position end end) InputChangedConn = UIS.InputChanged:connect(function(input, processed) if input.UserInputType == Enum.UserInputType.Touch then OnTouchChanged(input, processed) end end) InputEndedConn = UIS.InputEnded:connect(function(input, processed) if input.UserInputType == Enum.UserInputType.Touch then OnTouchEnded(input, processed) end if input.UserInputType == Enum.UserInputType.MouseButton2 then mouse2Up = tick() local currPos = input.Position if mouse2Up - mouse2Down < 0.25 and (currPos - mouse2DownPos).magnitude < 5 then local positions = {currPos} OnTap(positions) end end end) TapConn = UIS.TouchTap:connect(function(touchPositions, processed) if not processed then OnTap(touchPositions) end end) local function computeThrottle(dist) if dist > .2 then return 0.5+(dist^2)/2 else return 0 end end local lastSteer = 0 --kP = how much the steering corrects for the current error in driving angle --kD = how much the steering corrects for how quickly the error in driving angle is changing local kP = 1 local kD = 0.5 local function getThrottleAndSteer(object, point) local throttle, steer = 0, 0 local oCF = object.CFrame local relativePosition = oCF:pointToObjectSpace(point) local relativeZDirection = -relativePosition.z local relativeDistance = relativePosition.magnitude -- throttle quadratically increases from 0-1 as distance from the selected point goes from 0-50, after 50, throttle is 1. -- this allows shorter distance travel to have more fine-tuned control. throttle = computeThrottle(math_min(1,relativeDistance/50))*math.sign(relativeZDirection) local steerAngle = -math_atan2(-relativePosition.x, -relativePosition.z) steer = steerAngle/(math_pi/4) local steerDelta = steer - lastSteer lastSteer = steer local pdSteer = kP * steer + kD * steer return throttle, pdSteer end local function Update() if CurrentSeatPart then if DrivingTo then local throttle, steer = getThrottleAndSteer(CurrentSeatPart, DrivingTo) CurrentSeatPart.ThrottleFloat = throttle CurrentSeatPart.SteerFloat = steer else CurrentSeatPart.ThrottleFloat = 0 CurrentSeatPart.SteerFloat = 0 end end end RunService:BindToRenderStep("ClickToMoveRenderUpdate",Enum.RenderPriority.Camera.Value - 1,Update) local function onSeated(child, active, currentSeatPart) if active then if TouchJump and UIS.TouchEnabled then TouchJump:Enable() end if currentSeatPart and currentSeatPart.ClassName == "VehicleSeat" then CurrentSeatPart = currentSeatPart end else CurrentSeatPart = nil if TouchJump and UIS.TouchEnabled then TouchJump:Disable() end end end local function OnCharacterChildAdded(child) if UIS.TouchEnabled then if child:IsA('Tool') then child.ManualActivationOnly = true end end if child:IsA('Humanoid') then disconnectEvent(HumanoidDiedConn) HumanoidDiedConn = child.Died:connect(function() if ExistingIndicator then DebrisService:AddItem(ExistingIndicator.Model, 1) end end) HumanoidSeatedConn = child.Seated:connect(function(active, seat) onSeated(child, active, seat) end) if child.SeatPart then onSeated(child, true, child.SeatPart) end end end CharacterChildAddedConn = character.ChildAdded:connect(function(child) OnCharacterChildAdded(child) end) CharacterChildRemovedConn = character.ChildRemoved:connect(function(child) if UIS.TouchEnabled then if child:IsA('Tool') then child.ManualActivationOnly = false end end end) for _, child in pairs(character:GetChildren()) do OnCharacterChildAdded(child) end end local Running = false function this:Stop() if Running then DisconnectEvents() CleanupPath() -- Restore tool activation on shutdown if UIS.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 DrivingTo = nil Running = false end end function this:Start() if not Running then if Player.Character then -- retro-listen OnCharacterAdded(Player.Character) end OnCharacterAddedConn = Player.CharacterAdded:connect(OnCharacterAdded) Running = true end end function this:Enable() self:Start() end function this:Disable() self:Stop() end function this:GetName() return DEBUG_NAME end return this end return CreateClickToMoveModule()
-- Maid class
local destructors = { ['function'] = function(item) item() end; ['RBXScriptConnection'] = function(item) item:Disconnect() end; ['Instance'] = function(item) item:Destroy() end; } local Maid = {} Maid.__index = Maid function Maid:Mark(item) if destructors[typeof(item)] then self.trash[#self.trash + 1] = item else error(('Maid does not support type "%s"'):format(typeof(item)), 2) end end function Maid:Unmark(item) if item then local trash = self.trash for i = 1, #trash do if trash[i] == item then table.remove(trash, i) break end end else self.trash = {} end end function Maid:Sweep() local trash = self.trash for i = 1, #trash do local item = trash[i] destructors[typeof(item)](item) end self.trash = {} end function Maid.new() local self = setmetatable({}, Maid) self.trash = {} return self end return Maid.new()