Roblox/luau_corpus huggingface dataset:
-- Requires
local PartUtility = require(ReplicatedStorage.Common.PartUtility)
local APICombat = require(ReplicatedStorage.Common.APICombat)
local DamageInfo = require(ReplicatedStorage.Common.APICombat.DamageInfo)
local WeaponDefinitionLoader = require(ReplicatedStorage.Common.WeaponDefintionLoader)
-----------------------------------------------------------------------------------------------

script.Parent:WaitForChild("Gear")
script.Parent:WaitForChild("Speed")
script.Parent:WaitForChild("Needle")
script.Parent:WaitForChild("Brake")

local player=game.Players.LocalPlayer
local mouse=player:GetMouse()

local car = script.Parent.Parent.Parent.Car.Value
car.DriveSeat.HeadsUpDisplay = false

local _Tune = require(car["A-Chassis Tune"])

local _pRPM = _Tune.PeakRPM
local _lRPM = _Tune.Redline

local currentUnits = 0
local revEnd = math.ceil(_lRPM/1000)

script.Parent.Parent.Parent.Values.Gear.Changed:connect(function()
	local gearText = script.Parent.Parent.Parent.Values.Gear.Value
	if gearText == 0 then gearText = "N"
	elseif gearText == -1 then gearText = "R"
	end
	script.Parent.Gear.Text = gearText
end)

script.Parent.Parent.Parent.Values.RPM.Changed:connect(function()
	script.Parent.Needle.Rotation = 230 * math.min(1,script.Parent.Parent.Parent.Values.RPM.Value / (revEnd*1000))
end)

script.Parent.Parent.Parent.Values.Velocity.Changed:connect(function(property)
	script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Parent.Values.Velocity.Value.Magnitude)
end)

local function nextUnity ()
	if currentUnits==#UNITS then
		currentUnits = 1
	else
		currentUnits = currentUnits+1
	end
	script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Parent.Values.Velocity.Value.Magnitude)
	script.Parent.Unit.Text = UNITS[currentUnits].units
end

script.Parent.Speed.MouseButton1Click:connect(function()
	nextUnity()
end)
nextUnity()

script.Parent.Parent.Parent.Values.PBrake.Changed:connect(function()
	script.Parent.Brake.Visible = script.Parent.Parent.Parent.Values.PBrake.Value
end)

wait(.1)
-- Knit modifies roblox-lua-promise to add PascalCase API
Promise.Defer = Promise.defer
Promise.Async = Promise.defer
Promise.Resolve = Promise.resolve
Promise.Reject = Promise.reject
Promise.Try = Promise.try
Promise.All = Promise.all
Promise.Some = Promise.some
Promise.Any = Promise.any
Promise.AllSettled = Promise.allSettled
Promise.Race = Promise.race
Promise.Each = Promise.each
Promise.Is = Promise.is
Promise.Promisify = Promise.promisify
Promise.Delay = Promise.delay
Promise.prototype.Timeout = Promise.prototype.timeout
Promise.prototype.GetStatus = Promise.prototype.getStatus
Promise.prototype.AndThen = Promise.prototype.andThen
Promise.prototype.Then = Promise.prototype.andThen
Promise.prototype.Catch = Promise.prototype.catch
Promise.prototype.Tap = Promise.prototype.tap
Promise.prototype.AndThenCall = Promise.prototype.andThenCall
Promise.prototype.ThenCall = Promise.prototype.andThenCall
Promise.prototype.AndThenReturn = Promise.prototype.andThenReturn
Promise.prototype.ThenReturn = Promise.prototype.andThenReturn
Promise.prototype.Cancel = Promise.prototype.cancel
Promise.prototype.Finally = Promise.prototype.finally
Promise.prototype.FinallyCall = Promise.prototype.finallyCall
Promise.prototype.FinallyReturn = Promise.prototype.finallyReturn
Promise.prototype.Done = Promise.prototype.done
Promise.prototype.DoneCall = Promise.prototype.doneCall
Promise.prototype.DoneReturn = Promise.prototype.doneReturn
Promise.prototype.AwaitStatus = Promise.prototype.awaitStatus
Promise.prototype.Await = Promise.prototype.await
Promise.prototype.Expect = Promise.prototype.expect
Promise.prototype.AwaitValue = Promise.prototype.expect
Promise.prototype.Now = Promise.prototype.now
Promise.Retry = Promise.retry
Promise.FromEvent = Promise.fromEvent

return Promise
--]]


function getHumanoid(model)
	for _, v in pairs(model:GetChildren()) do
		if v:IsA'Humanoid' then
			return v
		end
	end
end


local zombie = script.Parent
local human = getHumanoid(zombie)
local hroot = zombie.HumanoidRootPart
local zspeed = hroot.Velocity.magnitude


local pfs = game:GetService("PathfindingService")

function GetPlayerNames()
	local players = game:GetService('Players'):GetChildren()
	local name = nil
	for _, v in pairs(players) do
		if v:IsA'Player' then
			name = tostring(v.Name)
		end
	end
	return name
end

function GetPlayersBodyParts(t)
	local torso = t
	if torso then
		local figure = torso.Parent
		for _, v in pairs(figure:GetChildren()) do
			if v:IsA'Part' then
				return v.Name
			end
		end
	else
		return "HumanoidRootPart"
	end
end

function GetTorso(part)
	local chars = game.Workspace:GetChildren()
	local torso = nil
	for _, v in pairs(chars) do
		if v:IsA'Model' and v ~= script.Parent and v.Name == GetPlayerNames() then
			local charRoot = v:FindFirstChild'HumanoidRootPart'
			if (charRoot.Position - part).magnitude < SearchDistance then
				torso = charRoot
			end
		end
	end
	return torso
end

for _, zambieparts in pairs(zombie:GetChildren()) do
	if zambieparts:IsA'Part' then
		zambieparts.Touched:connect(function(p)
			if p.Parent.Name == GetPlayerNames() and p.Parent.Name ~= zombie.Name then -- damage
				local enemy = p.Parent
				local enemyhuman = getHumanoid(enemy)
				enemyhuman:TakeDamage(ZombieDamage)
			end
		end)
	end
end
--[[Engine]]
	--Torque Curve
	Tune.Horsepower		= 150		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6000		--		Use sliders to manipulate values
	Tune.Redline		= 6700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 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)
--Reset--
script.Parent.Configuration.Reset.Changed:connect(function()
if script.Parent.Configuration.Reset.Value == true then
	--ResetScript Starts
--// All global vars will be wiped/replaced except script

return function(data, env)
	if env then
		setfenv(1, env)
	end

	local playergui = service.PlayerGui
	local localplayer = service.Players.LocalPlayer
	local gui = service.New("ScreenGui")
	local toggle = service.New("ImageButton", gui)
	local gTable = client.UI.Register(gui)

	if client.UI.Get("HelpButton", gui, true) then
		gui:Destroy()
		gTable:Destroy()
		return nil
	end

	gTable.Name = "HelpButton"
	gTable.CanKeepAlive = false

	toggle.Name = "Toggle"
	toggle.BackgroundTransparency = 1
	toggle.Position = UDim2.new(1, -45, 1, -45)
	toggle.Size = UDim2.new(0, 40, 0, 40)
	toggle.Image = "http://www.roblox.com/asset/?id=7059706594"
	toggle.ImageTransparency = 0

	--if client.UI.Get("Chat") then
	--	toggle.Position = UDim2.new(1, -(45+40),1, -45)
	--end

	toggle.MouseButton1Down:Connect(function()
		local found = client.UI.Get("UserPanel",nil,true)
		if found then
			found.Object:Destroy()
		else
			client.UI.Make("UserPanel",{})
		end
	end)

	gTable:Ready()
end
--Gauge
MakeWeld(car.Misc.Tach.M,car.DriveSeat,"Motor").Name="M"
ModelWeld(misc.Tach.Parts,misc.Tach.M)
MakeWeld(car.Misc.Speedo.N,car.DriveSeat,"Motor").Name="N"
ModelWeld(misc.Speedo.Parts,misc.Speedo.N)
-- Decompiled with the Synapse X Luau decompiler.

task.wait(1);
local l__Assets__1 = game:GetService("ReplicatedStorage"):WaitForChild("SharedModules", 100);
local l__Events__2 = game:GetService("Players").LocalPlayer.PlayerScripts:WaitForChild("Events", 100);
local v3 = require(l__Assets__1.CameraClass);

local l__CurrentCamera__1 = workspace.CurrentCamera;
local v5 = v3.new(1000, function(p1)
	l__CurrentCamera__1.CFrame = l__CurrentCamera__1.CFrame * p1;
end);
v5:Start();
l__Events__2.shake.Event:Connect(function(p2, ...)
	if p2 == "presets" then
		v5:Shake(v3.Presets[...]);
		return;
	end;
	if p2 == "once" then
		v5:ShakeOnce(...);
	end;
end);
-- ключ значений у игрока в DataStore2
local DS2key = script.Parent.Parent.Name -- "MaxHeight1"

local clickDetector = script.Parent.ClickDetector
function onMouseClick(plr)
	-- для игрока plr, для ключа, изменить на 1
	module.Update(plr, DS2key, 1)
end
clickDetector.MouseClick:Connect(onMouseClick)
--		Open:Play()
		script.Parent.Handle.sound_open:Play()
		script.Parent.EffectsHolder.AttachOn.SparkParticles.Enabled = true
		script.Parent.EffectsHolder.AttachOn.SparkParticles.Enabled = false
		script.Parent.EffectsHolder.AttachOn.MainLight.Enabled = true
		script.Parent.EffectsHolder.AttachOn.SmallLight.Enabled = true
		script.Parent.EffectsHolder.AttachOn.SmallLight2.Enabled = true
		script.Parent.EffectsHolder.AttachOn.SmallLight3.Enabled = true
		script.Parent.EffectsHolder.AttachOn.FireParticles.Enabled = true
--game:GetService'ReplicatedStorage':WaitForChild'Count':FireServer(fold, countNum) causing server issues, will be done later
game:GetService'ReplicatedStorage':WaitForChild'Save':FireServer(fold)
----------------------
game.Players.PlayerAdded:connect(function(plr)
	repeat
		local userData = storage.LoadData(plr.UserId)
		wait(0.5)
		if not userData then  end
	until userData == true
end)
--//GUIs
local PlayButton = script.Parent.Parent.IntroGui.Frame.Play
--[=[
	Uppercases the first letter of the string
	@param str string
	@return string
]=]
function String.uppercaseFirstLetter(str: string): string
	return str:gsub("^%a", string.upper)
end
--[[**
	ensures Lua primitive coroutine type

	@param value The value to check against

	@returns True iff the condition is satisfied, false otherwise
**--]]
t.coroutine = primitive("thread")
-- Decompiled with the Synapse X Luau decompiler.

client = nil;
service = nil;
return function(p1)
	local v1 = client.UI.Make("Window", {
		Name = "Terminal", 
		Title = "Terminal", 
		Size = { 500, 300 }, 
		AllowMultiple = false, 
		OnClose = function()

		end
	});
	local v2 = v1:Add("ScrollingFrame", {
		Size = UDim2.new(1, -10, 1, -40), 
		BackgroundTransparency = 1, 
		List = {}
	});
	local v3 = v1:Add("TextBox", {
		Text = "", 
		Size = UDim2.new(1, 0, 0, 30), 
		Position = UDim2.new(0, 0, 1, -30), 
		PlaceholderText = "Enter command", 
		TextXAlignment = "Left"
	});
	local function u1(p2, p3)
		table.insert(p3, p2);
		if #p3 > 500 then
			table.remove(p3, 1);
		end;
	end;
	local u2 = {};
	v1:BindEvent(service.Events.TerminalLive, function(p4)
		local l__Type__4 = p4.Type;
		u1(p4.Data, u2);
	end);
	v3.FocusLost:connect(function(p5)
		service.Debounce("_TERMINAL_BOX_FOCUSLOST", function()
			if p5 and v3.Text ~= "" and v3.Text ~= "Enter command" then
				local l__Text__5 = v3.Text;
				v3.Text = "";
				u1(">" .. l__Text__5, u2);
				local v6 = client.Remote.Get("Terminal", l__Text__5, {
					Time = tick()
				});
				if v6 and type(v6) == "table" then
					for v7, v8 in ipairs(v6) do
						u1(v8, u2);
					end;
				end;
				v3:CaptureFocus();
			end;
			wait(0.1);
		end);
	end);
	v1:Ready();
	local v9 = 0;
	while v1.gTable.Active and wait(0.5) do
		if v9 < #u2 then
			v9 = #u2;
			v2:GenerateList(u2, nil, true);
		end;	
	end;
end;
--

local Utils = require(utilsModule)

function Utils.GetAngleBetweenXZVectors(v1, v2)
	local upCFrame = lastUpCFrame -- this is kind of lame, but it works
	v1 = upCFrame:VectorToObjectSpace(v1)
	v2 = upCFrame:VectorToObjectSpace(v2)
	return math.atan2(v2.X*v1.Z-v2.Z*v1.X, v2.X*v1.X+v2.Z*v1.Z)
end
--[=[
	Adds the remote function mixin to a class

	```lua
	local BaseObject = require("BaseObject")

	local Bird = setmetatable({}, BaseObject)
	Bird.ClassName = "Bird"
	Bird.__index = Bird

	require("PromiseRemoteFunctionMixin"):Add(Bird, "BirdRemoteFunction")

	function Bird.new(inst)
		local self = setmetatable(BaseObject.new(inst), Bird)

		self:PromiseRemoteFunction():Then(function(remoteFunction)
			task.spawn(function()
				remoteFunction:InvokeServer() -- or whatever
			end)
		end)

		return self
	end
	```

	@param class { _maid: Maid }
	@param remoteFunctionName string
]=]
function PromiseRemoteFunctionMixin:Add(class, remoteFunctionName)
	assert(type(class) == "table", "Bad class")
	assert(type(remoteFunctionName) == "string", "Bad remoteFunctionName")
	assert(not class.PromiseRemoteFunctionMixin, "Class already has PromiseRemoteFunctionMixin defined")
	assert(not class._remoteFunctionName, "Class already has _remoteFunctionName defined")

	class.PromiseRemoteFunction = self.PromiseRemoteFunction
	class._remoteFunctionName = remoteFunctionName
end
-- Initialization

game.StarterGui.ResetPlayerGuiOnSpawn = false
ScreenGui.Parent = Player:WaitForChild("PlayerGui")
-- To make this work, simply group it with the model you want!


local modelbackup = script.Parent.Parent:FindFirstChild(modelname):clone()
local trigger = script.Parent

enabled = true

function onTouched(hit)
	

	if enabled == true then

		enabled = false
		--trigger.BrickColor = BrickColor.new("Really black")

	if script.Parent.Parent:FindFirstChild(modelname) ~= nil then

		script.Parent.Parent:FindFirstChild(modelname):Destroy()


	end
wait(120)
		local modelclone = modelbackup:clone()
		modelclone.Parent = script.Parent.Parent
		modelclone:MakeJoints()

		wait(WaitTime)
		
		enabled = true
		--trigger.BrickColor = BrickColor.new("Bright violet")

	end

end
script.Parent.Touched:connect(onTouched)
--		print("Wha " .. pose)
		stopAllAnimations()
		amplitude = 0.1
		frequency = 1
		setAngles = true
	end

	if (setAngles) then
		local desiredAngle = amplitude * math.sin(time * frequency)

		wait()
	end

	-- Tool Animation handling
	local tool = getTool()
	if tool and tool:FindFirstChild("Handle") then
	
		local animStringValueObject = getToolAnim(tool)

		if animStringValueObject then
			toolAnim = animStringValueObject.Value
			-- message recieved, delete StringValue
			animStringValueObject.Parent = nil
			toolAnimTime = time + .3
		end

		if time > toolAnimTime then
			toolAnimTime = 0
			toolAnim = "None"
		end

		animateTool()		
	else
		stopToolAnimations()
		toolAnim = "None"
		toolAnimInstance = nil
		toolAnimTime = 0
	end
end
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------
	,VRecoil = {20,22}				--- Vertical Recoil
	,HRecoil = {8,10}				--- Horizontal Recoil
	,AimRecover = .3				---- Between 0 & 1
	
	,RecoilPunch = .35
	,VPunchBase = 5.75				--- Vertical Punch
	,HPunchBase = 3.25				--- Horizontal Punch
	,DPunchBase = 1 				--- Tilt Punch | useless
	
	,AimRecoilReduction = .75 		--- Recoil Reduction Factor While Aiming (Do not set to 0)
	,PunchRecover = 0.1
	,MinRecoilPower = 1
	,MaxRecoilPower = 1
	,RecoilPowerStepAmount = 1
	
	,MinSpread = 0.15				--- Min bullet spread value | Studs
	,MaxSpread = 25					--- Max bullet spread value | Studs
	,AimInaccuracyStepAmount = 0
	,WalkMultiplier = 0				--- Bullet spread based on player speed

	,SwayBase = 0.25				--- Weapon Base Sway | Studs
	,MaxSway =	3					--- Max sway value based on player stamina | Studs
-- Controls the glow of a firefly

local Configurations = script.Parent.Parent.Configuration -- Variables for configurations
local Brightness = Configurations.Brightness
local glowTime = Configurations.GlowTime
local notGlowTime = Configurations.NotGlowTime
local glowSpeed = Configurations.GlowSpeed
local glowRange = Configurations.GlowRange
local lightColor = Configurations.Color

local Fly = script.Parent

Fly.PointLight.Color = lightColor.Value -- Initialize light and collor settings
Fly.PointLight.Range = glowRange.Value
Fly.PointLight.Enabled = true

while true do
	Fly.BrickColor = BrickColor.new(lightColor.Value) -- Change color of the fly to make it properly visible when the light will glow
	for i = 1, Brightness.Value*10 do -- Slowly build strength of the light
		Fly.PointLight.Brightness = 0 + i*0.1
		Fly.Transparency = 0.5 - (0.5 * i)/(Brightness.Value*10)
		wait(1/(glowSpeed.Value*Brightness.Value*10))
	end
	wait(glowTime.Value+math.random(-10,10)*0.1) -- Wait for light to glow for some time
	for i = 1, Brightness.Value*10 do -- Slowly drop strength of the light
		Fly.PointLight.Brightness = Brightness.Value - i*0.1
		Fly.Transparency = (0.5 * i)/(Brightness.Value*10)
		wait(1/(glowSpeed.Value*Brightness.Value*10))
	end
	Fly.BrickColor = BrickColor.new("Really black") -- Make the fly dark, as it's dark without a light
	wait(notGlowTime.Value+math.random(-10,10)*0.1) -- Wait for light to be off for some time
end
-- LOCAL
local Janitor = require(script.Parent.Janitor)
local Enum_ = require(script.Parent.Enum)
local Signal = require(script.Parent.Signal)
local Tracker = require(script.Tracker)
local CollectiveWorldModel = require(script.CollectiveWorldModel)
local enum = Enum_.enums
local players = game:GetService("Players")
local activeZones = {}
local activeZonesTotalVolume = 0
local activeTriggers = {}
local registeredZones = {}
local activeParts = {}
local activePartToZone = {}
local allParts = {}
local allPartToZone = {}
local activeConnections = 0
local runService = game:GetService("RunService")
local heartbeat = runService.Heartbeat
local heartbeatConnections = {}
local localPlayer = runService:IsClient() and players.LocalPlayer
-- Small bug fix where the sound would start playing after the player joined
player.CharacterAdded:Connect(function()
	task.wait(1)
	if currentSound.IsPlaying then
		currentSound:Stop()
	end
end)

while wait() do
	if humanoid.WalkSpeed == 20 then
		currentSound.PlaybackSpeed = 1.75
	elseif humanoid.WalkSpeed ~= 20 then
		currentSound.PlaybackSpeed = 1
	end
end
------------------------------------------------------------------------
--
-- * used in luaK:setmultret(), (lparser) luaY:adjust_assign()
------------------------------------------------------------------------
function luaK:setreturns(fs, e, nresults)
  if e.k == "VCALL" then  -- expression is an open function call?
    luaP:SETARG_C(self:getcode(fs, e), nresults + 1)
  elseif e.k == "VVARARG" then
    luaP:SETARG_B(self:getcode(fs, e), nresults + 1);
    luaP:SETARG_A(self:getcode(fs, e), fs.freereg);
    luaK:reserveregs(fs, 1)
  end
end
-- Fade out the sound over FADE_TIME seconds.
local startVolume = sound.Volume
for i = 1, 10 do
	sound.Volume = startVolume * (1 - i/10)
	wait(FADE_TIME/10)
end
sound:Stop()
print("fade out")
--[[
	
	Welds part A to part B using a WeldConstraint (returns weld)
	
	Functions.Weld(
		partA,					<-- |REQ| 	Part instance
		partB,					<-- |REQ|	Part instance
		isManualWeld			<-- 		true = ManualWeld, false = WeldConstraint			[defaults to: false]
	)
	
--]]


return function(a, b, isManualWeld)
	--- Create weld
	local weld = Instance.new((isManualWeld and "ManualWeld" or "WeldConstraint"))
	
	--- Set part adornees
	weld.Part0 = a
	weld.Part1 = b
	
	--- If manual weld, set CFrame
	if isManualWeld then
		weld.C0 = a.CFrame:inverse() * b.CFrame
	end
	
	--- Part to part A
	weld.Parent = a
	
	--
	return weld
end
-- Create sound instance
local currentSound = Instance.new("Sound", soundService)
	  currentSound.Name = "CurrentSound"
-- Make signal strict
setmetatable(Signal, {
	__index = function(_tb, key)
		error(("Attempt to get Signal::%s (not a valid member)"):format(tostring(key)), 2)
	end,
	__newindex = function(_tb, key, _value)
		error(("Attempt to set Signal::%s (not a valid member)"):format(tostring(key)), 2)
	end
})

return Signal
--[[Transmission]]
	Tune.TransModes		= {"Auto"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
		>First mode is default mode													]]
	
	--Automatic Settings
	Tune.AutoShiftMode	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
	Tune.AutoUpThresh	= -200		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)
	
	--Gear Ratios
	Tune.FinalDrive		= 5		-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	3.70		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ D ]]		4
		 		,	-- Reverse, Neutral, and 1st gear are required
	}
	Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
-- ROBLOX deviation END
-- ROBLOX deviation START: Polyfill String.padStart
local function stringPadStart(str: string, targetLength_: number, padString_: string?)
	local targetLength = math.max(#str, targetLength_)

	local padString = padString_ or " "
	return (padString:rep(targetLength) .. str):sub(-targetLength)
end
-- LOCAL
local tweenService = game:GetService("TweenService")
local replicatedStorage = game:GetService("ReplicatedStorage")
local debris = game:GetService("Debris")
local userInputService = game:GetService("UserInputService")
local httpService = game:GetService("HttpService") -- This is to generate GUIDs
local runService = game:GetService("RunService")
local textService = game:GetService("TextService")
local guiService = game:GetService("GuiService")
local starterGui = game:GetService("StarterGui")
local players = game:GetService("Players")
local IconController = require(script.IconController)
local Signal = require(script.Signal)
local Maid = require(script.Maid)
local TopbarPlusGui = require(script.TopbarPlusGui)
local TopbarPlusReference = require(script.TopbarPlusReference)
local referenceObject = TopbarPlusReference.getObject()
local Themes = require(script.Themes)
local activeItems = TopbarPlusGui.ActiveItems
local topbarContainer = TopbarPlusGui.TopbarContainer
local iconTemplate = topbarContainer["IconContainer"]
local DEFAULT_THEME = Themes.Default
local THUMB_OFFSET = 55
local DEFAULT_FORCED_GROUP_VALUES = {}
local Icon = (referenceObject and require(referenceObject.Value)) or {}
Icon.__index = Icon
if not referenceObject then
	TopbarPlusReference.addToReplicatedStorage()
end
--// Aim|Zoom|Sensitivity Customization
	ZoomSpeed = 0.15; -- The lower the number the slower and smoother the tween
	AimZoom = 5; -- Default zoom
	AimSpeed = 0.45;
	UnaimSpeed = 0.35;
	CycleAimZoom = 4; -- Cycled zoom
	MouseSensitivity = 0.05; -- Number between 0.1 and 1
	SensitivityIncrement = 0.05; -- No touchy
--raycast
function heardetect(part)
	local target = nil
	local Beam = Instance.new("Part", script.debris)
	Beam.Anchored = true
	Beam.CanCollide = false
	Beam.Color = Color3.fromRGB(255, 150, 150)
	Beam.Material = Enum.Material.Neon
	Beam.Name = "LaserBeam"
	Beam.Transparency = 1
	
	--script.Parent.Torso.Orientation = Vector3.new(script.Parent.Torso.Orientation.X,FindTarget().Orientation.Y-FindTarget().Orientation.Y*2,script.Parent.Torso.Orientation.Z)
	local Object = script.Parent.Head
	local Raycast = Ray.new(Object.CFrame.p, CFrame.new(Object.CFrame.Position, part.Position).LookVector * distance)
	local Part, Position = game.Workspace:FindPartOnRayWithIgnoreList(Raycast, {Object, Beam, script.debris}, false, true)

	local Distance = (Object.CFrame.p - Position).Magnitude
	if visibleray == true then
		Beam.Size = Vector3.new(0.1, 0.1, Distance)
		Beam.CFrame = CFrame.new(Object.CFrame.Position, part.Position) * CFrame.new(0, 0, -Distance/2)
		Beam.Transparency = 0
	else
		Beam:Destroy()
	end
	if Part ~= nil then
		if game.Players:GetPlayerFromCharacter(Part.Parent) or game.Players:GetPlayerFromCharacter(Part.Parent.Parent) then
			--script.Parent.Humanoid:MoveTo(Part.Position)
			GoTo(part.Position)
			if (part.Position - script.Parent.Head.Position).Magnitude < damagerange then
				attack()
			end
			Beam.BrickColor = BrickColor.new("Bright blue")
		else
			Beam.BrickColor = BrickColor.new("Really red")
		end	
	else
		Beam.BrickColor = BrickColor.new("White")
	end
	wait()
end