Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- Services


local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local Players = game:GetService("Players")
local CollectionService = game:GetService("CollectionService")

local Conf = require(ReplicatedFirst.Configurations.MainConfiguration)
local Util = require(ReplicatedStorage.Libraries.Util)
local MatchmakingDestination = require(ReplicatedStorage.Libraries.MatchmakingDestination)
local WeaponsSystem = require(ReplicatedStorage.WeaponsSystem.WeaponsSystem)
local DamageHandler = require(ReplicatedStorage.Core.DamageHandler)
--and now BLINKERS!!!!


function left()
	FL.Material = "Neon"
	RL.Material = "Neon"
end
function unleft()
	FL.Material = "SmoothPlastic"
	RL.Material = "SmoothPlastic"
end

function right()
	FR.Material = "Neon"
	RR.Material = "Neon"
end
function unright()
	FR.Material = "SmoothPlastic"
	RR.Material = "SmoothPlastic"
end

while true do
	wait(0.2)--no crash m8!!!
	--
	if seat.Lights.Value == true then --lights
		lightson()
	else
		lightsoff()
	end
	--
	if seat.dGear.Value == "R" then --reverse lights
		reverse()
	else
		unreverse()
	end
	--
	if seat.Parent.Throttle == -1 then
		brake()
	else
		unbrake()
	end
	--and now... BLINKERS!!!
	if seat.Blinked.Value == true then
		if seat.BLeft.Value == true then
			left()
		else
			unleft()
		end
		if seat.BRight.Value == true then
			right()
		else
			unright()
		end
	else
		unright()
		unleft()
	end
	
end
------------------------------------------------------------------------------------------------------------------------------------------------


		if script.Parent:FindFirstChild("Arm1") then
			local g = script.Parent.Arm1:Clone()
			g.Parent = File
			for _,i in pairs(g:GetChildren()) do
				if i:IsA("Part") or i:IsA("UnionOperation") or i:IsA("MeshPart") then
					i.CanCollide = false
					i.Anchored = false
					local Y = Instance.new("Weld")
					Y.Part0 = Player.Character["Left Arm"]
					Y.Part1 = g.Middle
					Y.C0 = CFrame.new(0, 0, 0)
					Y.Parent = Player.Character["Left Arm"]
				end
			end
		end
--!strict
-- upstream: https://github.com/facebook/react/blob/a457e02ae3a2d3903fcf8748380b1cc293a2445e/packages/react/src/IsSomeRendererActing.js
--[[*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
]]
--end
--End of Function KeyDown()


function KU(key)
key = key:lower()
if(key == "d")  then
faster = false
wait(.1)
faster = false
end
if(key == "a")  then
slower = false
wait(.1)
slower = false
end
if(key == "w")  then
uper = false
wait(.1)
uper = false
end
if(key == "s")  then
downer = false
wait(.1)
downer = false
end
if(key == "t") then 
minigun_shoot = false
end 
if(key == "z") then 
show_ammo = false
end
if(key == "q") then 
startLock = false
end
--[[
	Returns first value (success), and packs all following values.
]]


local function packResult(success, ...)
	return success, select("#", ...), { ... }
end

local function makeErrorHandler(traceback)
	assert(traceback ~= nil, "traceback is nil")

	return function(err)
		-- If the error object is already a table, forward it directly.
		-- Should we extend the error here and add our own trace?

		if type(err) == "table" then
			return err
		end

		return Error.new({
			error = err,
			kind = Error.Kind.ExecutionError,
			trace = debug.traceback(tostring(err), 2),
			context = "Promise created at:\n\n" .. traceback,
		})
	end
end
-- / Player / --


local PlayerGui = MainGui.Parent

local Player = PlayerGui.Parent
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")

local PlayerStats = Player:WaitForChild("PlayerStats")
local Oxygen = PlayerStats:WaitForChild("Oxygen")

 -- / Game Assets / --
local GameAssets = game.ServerStorage.GameAssets
-- Convenience function so that calling code does not have to first get the activeController
-- and then call GetMoveVector on it. When there is no active controller, this function returns the 
-- zero vector


function ControlModule:GetMoveVector(): Vector3
	if self.activeController then
		return self.activeController:GetMoveVector()
	end
	return Vector3.new(0,0,0)
end

function ControlModule:GetActiveController()
	return self.activeController
end
--Runtime Loop


while wait() do
	for i,v in pairs(Wheels) do
		--Vars
		local speed = car.DriveSeat.Velocity.Magnitude
		local wheel = v.wheel.RotVelocity.Magnitude
		local z = 0		
		local deg = 0.000126
		
		--Tire Wear
		local cspeed = (speed/1.298)*(2.6/v.wheel.Size.Y) 
		local wdif = math.abs(wheel-cspeed)
		if _WHEELTUNE.TireWearOn then
			if speed < 4 then
				--Wear Regen
				v.Heat = math.min(v.Heat + _WHEELTUNE.RegenSpeed/10000,v.BaseHeat)
			else
				--Tire Wear
				if wdif > 1 then
					v.Heat = v.Heat - wdif*deg*v.WearSpeed/28
				elseif v.Heat >= v.BaseHeat then
					v.Heat = v.BaseHeat
				end
			end
		end
		
		--Apply Friction
		if v.wheel.Name == "FL" or v.wheel.Name == "FR" or v.wheel.Name == "F" then
			z = _WHEELTUNE.FMinFriction+v.Heat
			deg = ((deg - 0.0001188*cValues.Brake.Value)*(1-math.abs(cValues.SteerC.Value))) + 0.00000126*math.abs(cValues.SteerC.Value)
		else
			z = _WHEELTUNE.RMinFriction+v.Heat
		end
		
		--Tire Slip
		if math.ceil((wheel/0.774/speed)*100) < 8 then
			--Lock Slip
			v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z*_WHEELTUNE.WheelLockRatio,v.elast,v.fWeight,v.eWeight)
			v.Heat = math.max(v.Heat,0)
		elseif (_Tune.TCSEnabled and cValues.TCS.Value == false and math.ceil((wheel/0.774/speed)*100) > 80) then
			--TCS Off
			v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z*_WHEELTUNE.TCSOffRatio,v.elast,v.fWeight,v.eWeight)
			v.Heat = math.max(v.Heat,0)
		elseif math.ceil((wheel/0.774/speed)*100) > 130 then
			--Wheelspin
			v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z*_WHEELTUNE.WheelspinRatio,v.elast,v.fWeight,v.eWeight)		
			v.Heat = math.max(v.Heat,0)
		else
			--No Slip
			v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z,v.elast,v.fWeight,v.eWeight)
			v.Heat = math.min(v.Heat,v.BaseHeat)
		end 
		
		--Update UI
		local vstress = math.abs(((((wdif+cspeed)/0.774)*0.774)-cspeed)/15)
		if vstress > 0.05 and vstress > v.stress then 
			v.stress = math.min(v.stress + 0.03,1)
		else
			v.stress = math.max(v.stress - 0.03,vstress)	
		end
		local UI = script.Parent.Tires[v.wheel.Name]
		UI.First.Second.Image.ImageColor3 = Color3.new(math.min((v.stress*2),1), 1-v.stress, 0)
		UI.First.Position = UDim2.new(0,0,1-v.Heat/v.BaseHeat,0)
		UI.First.Second.Position = UDim2.new(0,0,v.Heat/v.BaseHeat,0)
	end
end
--TABS



function activedeactive(thing, val)
	for _,i in pairs (thing:GetChildren()) do
		if i:IsA("ImageButton") or i:IsA("TextButton") then
			if i.Name ~= "header" then
				i.Active = val
			end
		end
	end
end

lights.header.MouseButton1Click:connect(function()
	if curtab ~= 3 then
		curtab = 3
		lights:TweenPosition(UDim2.new(0, -8, 0, 150), "Out", "Quad", 0.5, true)
		siren:TweenPosition(UDim2.new(0, 180, 0, 150), "Out", "Quad", 0.5, true)
		seats:TweenPosition(UDim2.new(0, 196, 0, 150), "Out", "Quad", 0.5, true)
		activedeactive(lights,true)
		activedeactive(siren,false)
		activedeactive(seats,false)
	else
		curtab = 0
		lights:TweenPosition(UDim2.new(0, 164, 0, 150), "Out", "Quad", 0.5, true)
		siren:TweenPosition(UDim2.new(0, 180, 0, 150), "Out", "Quad", 0.5, true)
		seats:TweenPosition(UDim2.new(0, 196, 0, 150), "Out", "Quad", 0.5, true)
	end
end)
siren.header.MouseButton1Click:connect(function()
	if curtab ~= 2 then
		curtab = 2
		lights:TweenPosition(UDim2.new(0, -8, 0, 150), "Out", "Quad", 0.5, true)
		siren:TweenPosition(UDim2.new(0, 8, 0, 150), "Out", "Quad", 0.5, true)
		seats:TweenPosition(UDim2.new(0, 196, 0, 150), "Out", "Quad", 0.5, true)
		activedeactive(lights,false)
		activedeactive(siren,true)
		activedeactive(seats,false)
	else
		curtab = 0
		lights:TweenPosition(UDim2.new(0, 164, 0, 150), "Out", "Quad", 0.5, true)
		siren:TweenPosition(UDim2.new(0, 180, 0, 150), "Out", "Quad", 0.5, true)
		seats:TweenPosition(UDim2.new(0, 196, 0, 150), "Out", "Quad", 0.5, true)
	end
end)
seats.header.MouseButton1Click:connect(function()
	if curtab ~= 1 then
		curtab = 1
		lights:TweenPosition(UDim2.new(0, -8, 0, 150), "Out", "Quad", 0.5, true)
		siren:TweenPosition(UDim2.new(0, 8, 0, 150), "Out", "Quad", 0.5, true)
		seats:TweenPosition(UDim2.new(0, 24, 0, 150), "Out", "Quad", 0.5, true)
		activedeactive(lights,false)
		activedeactive(siren,false)
		activedeactive(seats,true)
	else
		curtab = 0
		lights:TweenPosition(UDim2.new(0, 164, 0, 150), "Out", "Quad", 0.5, true)
		siren:TweenPosition(UDim2.new(0, 180, 0, 150), "Out", "Quad", 0.5, true)
		seats:TweenPosition(UDim2.new(0, 196, 0, 150), "Out", "Quad", 0.5, true)
	end
end)
-- DynDS 1.1.1
--------------------------------------------------------------------------------------------------


local P = script.Parent
local body = P.Parent
local car = body.Parent

for i,v in pairs(script:GetChildren()) do
	if (v:FindFirstChild("Car")) and (v.Car:IsA("ObjectValue")) then
		v.Car.Value = car
	end
end

P.ChildAdded:connect(function(child)
	if child:IsA("Weld") and (child.Part1) and (child.Part1.Name == "HumanoidRootPart") then
		local player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
		if (player) then
			for i,v in pairs(script:GetChildren()) do
				v:Clone().Parent = player.PlayerGui
			end
		end
	end	
end)
--fakehead:Destroy()
--tilt:Destroy()


if arms ~= nil and chr.Torso ~= nil then
if not chr.Torso:FindFirstChild("Left Shoulder") then
	local Motor = Instance.new("Motor6D", torso)
	Motor.Name = "Left Shoulder"
	Motor.Part0, Motor.Part1 = torso, torso.Parent["Left Arm"]
	Motor.MaxVelocity = 0.1
	Motor.C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
	Motor.C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
end
if not chr.Torso:FindFirstChild("Right Shoulder") then
	local Motor = Instance.new("Motor6D", torso)
	Motor.Name = "Right Shoulder"
	Motor.Part0, Motor.Part1 = torso, torso.Parent["Right Arm"]
	Motor.MaxVelocity = 0.1
	Motor.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
	Motor.C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
end

local sh = {chr.Torso:FindFirstChild("Left Shoulder"), chr.Torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = arms[1]
sh[2].Part1 = arms[2]
if chr.HumanoidRootPart:FindFirstChild("Mtweld") then chr.HumanoidRootPart:FindFirstChild("Mtweld"):Destroy() end
for _,Child in pairs(arms[2]:GetChildren()) do
	if Child:IsA("Texture") or Child:IsA("Decal") then
		Child.Transparency = 0
	end
end
if hrp:FindFirstChild("RootJoint") then
	hrp.RootJoint.Part1 = torso
else
	local RootJoint = Instance.new("Motor6D",hrp)
	RootJoint.MaxVelocity, RootJoint.Name = 0.1, "RootJoint"
	RootJoint.Part0, RootJoint.Part1 = hrp,torso
end
neck.C0=OriginalC0
end
else
print("sh")
end
else
print("arms")
end
Tool.Hig.Value = 0
TweenService:Create(torso.Parent.Humanoid,TweenInfo.new(0.1),
{CameraOffset = torso.Parent.Humanoid.CameraOffset + (Vector3.new(0,0,0) - torso.Parent.Humanoid.CameraOffset)}):Play()
script.Disabled = true
script.Disabled = false
wait()
script.Speed.Value = 16
chr.Humanoid.WalkSpeed = 16 
end
Tool.Equipped:connect(Equip)
Tool.Unequipped:connect(Unequip)
--[[
	Creates a new promise that receives the result of this promise.

	The given callbacks are invoked depending on that result.
]]


function Promise.prototype:_andThen(traceback, successHandler, failureHandler)
	self._unhandledRejection = false

	-- Create a new promise to follow this part of the chain
	return Promise._new(traceback, function(resolve, reject)
		-- Our default callbacks just pass values onto the next promise.
		-- This lets success and failure cascade correctly!

		local successCallback = resolve
		if successHandler then
			successCallback = createAdvancer(
				traceback,
				successHandler,
				resolve,
				reject
			)
		end

		local failureCallback = reject
		if failureHandler then
			failureCallback = createAdvancer(
				traceback,
				failureHandler,
				resolve,
				reject
			)
		end

		if self._status == Promise.Status.Started then
			-- If we haven't resolved yet, put ourselves into the queue
			table.insert(self._queuedResolve, successCallback)
			table.insert(self._queuedReject, failureCallback)
		elseif self._status == Promise.Status.Resolved then
			-- This promise has already resolved! Trigger success immediately.
			successCallback(unpack(self._values, 1, self._valuesLength))
		elseif self._status == Promise.Status.Rejected then
			-- This promise died a terrible death! Trigger failure immediately.
			failureCallback(unpack(self._values, 1, self._valuesLength))
		elseif self._status == Promise.Status.Cancelled then
			-- We don't want to call the success handler or the failure handler,
			-- we just reject this promise outright.
			reject(Error.new({
				error = "Promise is cancelled",
				kind = Error.Kind.AlreadyCancelled,
				context = "Promise created at\n\n" .. traceback,
			}))
		end
	end, self)
end

function Promise.prototype:andThen(successHandler, failureHandler)
	assert(
		successHandler == nil or type(successHandler) == "function",
		string.format(ERROR_NON_FUNCTION, "Promise:andThen")
	)
	assert(
		failureHandler == nil or type(failureHandler) == "function",
		string.format(ERROR_NON_FUNCTION, "Promise:andThen")
	)

	return self:_andThen(debug.traceback(nil, 2), successHandler, failureHandler)
end
--[[--------------------------------------------------------------------
-- nodes for block list (list of active blocks)
-- struct BlockCnt:
--   previous  -- chain (table: BlockCnt)
--   breaklist  -- list of jumps out of this loop
--   nactvar  -- # active local variables outside the breakable structure
--   upval  -- true if some variable in the block is an upvalue (boolean)
--   isbreakable  -- true if 'block' is a loop (boolean)
----------------------------------------------------------------------]]
-- declarations



local sDied = newSound("rbxasset://sounds/uuhhh.wav")
local sFallingDown = newSound("rbxasset://sounds/splat.wav")
local sFreeFalling = newSound("rbxasset://sounds/swoosh.wav")
local sGettingUp = newSound("rbxasset://sounds/hit.wav")
local sJumping = newSound("rbxasset://sounds/button.wav")
local sRunning = newSound("rbxasset://sounds/bfsl-minifigfoots1.mp3")
sRunning.Looped = true

local Figure = script.Parent
local Head = waitForChild(Figure, "Head")
local Humanoid = waitForChild(Figure, "Humanoid")
--Loop For Making Rays For The Bullet's Trajectory


for i = 1, 30 do
	local thisOffset = offset + Vector3.new(0, yOffset*(i-1), 0)
	local travelRay = Ray.new(point1,thisOffset)
	local hit, position = workspace:FindPartOnRay(travelRay, parts.Parent)

	local distance 		= (position - point1).magnitude
	round.Size				= Vector3.new(0.6, distance, 0.6)
	round.CFrame			= CFrame.new(position, point1)
								* CFrame.new(0, 0, -distance/2)
								* CFrame.Angles(math.rad(90),0,0)
	round.Parent			= workspace
	point1					= point1 + thisOffset
	
	if hit then
  round:remove()
  local e = Instance.new("Explosion")
  e.BlastRadius = 6
  e.BlastPressure = 1600
  e.Position = position
  e.Parent = workspace
  e.ExplosionType = Enum.ExplosionType.NoCraters
  e.DestroyJointRadiusPercent = 1
  
  local players = game.Players:getChildren()
  for i = 1, #players do
   
   if players[i].TeamColor ~= script.Parent.Parent.Tank.Value then --if he's not an ally
    character = players[i].Character
    if character then
     torso = character:findFirstChild'Torso'
     if torso then
      
      torsoPos = torso.Position
      origPos = round.Position
      
      local ray = Ray.new(origPos, torsoPos-origPos)
      local hit, position = game.Workspace:FindPartOnRayWithIgnoreList(ray,ignoreList)
      if hit then
       if hit.Parent == character then
        human = hit.Parent:findFirstChild("Humanoid")
        if human then
         distance = (position-origPos).magnitude
-- Activation]:


if TurnCharacterToMouse == true then
	MseGuide = true
	HeadHorFactor = 0
	BodyHorFactor = 0
end

game:GetService("RunService").RenderStepped:Connect(function()
	local CamCF = Cam.CoordinateFrame
	if ((IsR6 and Body["Torso"]) or Body["UpperTorso"])~=nil and Body["Head"]~=nil then	--[Check for the Torso and Head...]
		local TrsoLV = Trso.CFrame.lookVector
		local HdPos = Head.CFrame.p
		if IsR6 and Neck or Neck and Waist then	--[Make sure the Neck still exists.]
			if Cam.CameraSubject:IsDescendantOf(Body) or Cam.CameraSubject:IsDescendantOf(Plr) then
				local Dist = nil;
				local Diff = nil;
				if not MseGuide then	--[If not tracking the Mouse then get the Camera.]
					Dist = (Head.CFrame.p-CamCF.p).magnitude
					Diff = Head.CFrame.Y-CamCF.Y
					if not IsR6 then	--[R6 and R15 Neck rotation C0s are different; R15: X axis inverted and Z is now the Y.]
						Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aSin(Diff/Dist)*HeadVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2)
						Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang((aSin(Diff/Dist)*BodyVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2)
					else	--[R15s actually have the properly oriented Neck CFrame.]
						Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aSin(Diff/Dist)*HeadVertFactor), 0, -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor),UpdateSpeed/2)
					end
				else
					local Point = Mouse.Hit.p
					Dist = (Head.CFrame.p-Point).magnitude
					Diff = Head.CFrame.Y-Point.Y
					if not IsR6 then
						Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aTan(Diff/Dist)*HeadVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2)
						Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang(-(aTan(Diff/Dist)*BodyVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2)
					else
						Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aTan(Diff/Dist)*HeadVertFactor), 0, (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor), UpdateSpeed/2)
					end
				end
			end
		end
	end
	if TurnCharacterToMouse == true then
		Hum.AutoRotate = false
		Core.CFrame = Core.CFrame:lerp(CFrame.new(Core.Position, Vector3.new(Mouse.Hit.p.x, Core.Position.Y, Mouse.Hit.p.z)), UpdateSpeed / 2)
	else
		Hum.AutoRotate = true
	end
end)
-- скрипт отслеживания построек



local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")	-- подключение серверных скриптов
local DataStore2 = require(ServerScriptService.DataStore2)			-- подключение модуля DataStore2

BaseName = game.Workspace.BaseName.Value	-- чтение имени базы данных 
local GWP = game.Workspace.WorldPlayers			--
local player = Players:FindFirstChild(script.Parent.Parent.Name)

me = script.Parent
---------------------------------------------------------------------



local CFrameUtility = {}


function CFrameUtility.Encode( cframe: CFrame ): string?
    return HttpService:JSONEncode( cframe:GetComponents() )
end


function CFrameUtility.Decode( jsonTable: string ): CFrame?
    return CFrame.new( unpack(HttpService:JSONDecode(jsonTable)) )
end


return CFrameUtility
--		print("Loading anims " .. name)


		table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
		table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
		local idx = 1
		for _, childPart in pairs(config:GetChildren()) do
			if (childPart:IsA("Animation")) then
				table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
				animTable[name][idx] = {}
				animTable[name][idx].anim = childPart
				local weightObject = childPart:FindFirstChild("Weight")
				if (weightObject == nil) then
					animTable[name][idx].weight = 1
				else
					animTable[name][idx].weight = weightObject.Value
				end
				animTable[name].count = animTable[name].count + 1
				animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
-- Get references to the DockShelf and its children


local fldr = script.Parent.Parent
local Pop = script.Parent.Parent.Parent.Popular
local Trcks = script.Parent.Parent.Parent.Tracks
local Serch = script.Parent.Parent.Parent.SearchTracks
local SerchVal = script.Parent.Parent.Parent.SearchActive
local btn = script.Parent

local function toggleWindow()
	if SerchVal.Value == true then
		-- Close the window by tweening back to the button position and size
		fldr:TweenSizeAndPosition(
			UDim2.new(1, 0, 0.022, 0),
			UDim2.new(0.0,0,0.978,0),
			'Out',
			'Quad',
			0.4,
			false,
			function()
			fldr.Visible = false
			Pop.Visible = false
			Trcks.Visible = false
			Serch.Visible = true
			end
		)
	elseif SerchVal.Value == false then
		fldr:TweenSizeAndPosition(
			UDim2.new(1, 0, 0.022, 0),
			UDim2.new(0.0,0,0.978,0),
			'Out',
			'Quad',
			0.4,
			false,
			function()
				fldr.Visible = false
				Pop.Visible = true
				Trcks.Visible = true
				Serch.Visible = false
			end
		)
	end
end
-- DO NOT MESS WITH THE SCRIPT UNLESS YOU KNOW WHAT YOU'RE DOING!
-- DO NOT CHANGE FOOTSTEPS SCRIPT NAME OR IT WONT WORK.


game.Players.ChildAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		if plr.ClassName == "Player" then
			if plr.Character:FindFirstChild("Sound") then
				plr.Character:FindFirstChild("Sound"):remove()
			else
				return
			end
			local footsteps = script.FootSteps:clone()
			footsteps.Parent = plr.Character
			footsteps.Disabled = false
		else
			return
		end
	end)
end)
--returns the wielding player of this tool


function getPlayer()
	local char = Tool.Parent
	return game:GetService("Players"):GetPlayerFromCharacter(Character)
end

function Toss(direction)
	local handlePos = Vector3.new(Tool.Handle.Position.X, 0, Tool.Handle.Position.Z)
	local spawnPos = Character.Head.Position
	
	spawnPos  = spawnPos + (direction * 5)
	Tool.Handle.Part.Transparency = 1
	
	local Object = Tool.Handle:Clone()
	Object.Parent = workspace
	Object.Part.Transparency = 0
	
	Object.Swing.Pitch = Random.new():NextInteger(90, 110)/100
	Object.Swing:Play()
	
	Object.CanCollide = true
	Object.CFrame = Tool.Handle.CFrame
	Object.Velocity = (direction*AttackVelocity) + Vector3.new(0,AttackVelocity/7.5,0)
	Object.Trail.Enabled = true
	
	local rand = 11.25
	Object.RotVelocity = Vector3.new(Random.new():NextNumber(-rand,rand),Random.new():NextNumber(-rand,rand),Random.new():NextNumber(-rand,rand))
	Object:SetNetworkOwner(getPlayer())
	
	local ScriptClone = DamageScript:Clone()
	ScriptClone.Parent = Object
	ScriptClone.Disabled = false
	
	local tag = Instance.new("ObjectValue")
	tag.Value = getPlayer()
	tag.Name = "creator"
	tag.Parent = Object
end

PowerRemote.OnServerEvent:Connect(function(player, Power)
	local holder = getPlayer()
	if holder ~= player then return end
	
	AttackVelocity = Power
end)

TossRemote.OnServerEvent:Connect(function(player, mousePosition)
	local holder = getPlayer()
	if holder ~= player then return end
	
	if Cooldown.Value == true then return end
	Cooldown.Value = true
	
	local holder = getPlayer()
	
	if Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15 then
		TossRemote:FireClient(getPlayer(), "PlayAnimation", "Animation")
	end
	local targetPos = mousePosition.p
	local lookAt = (targetPos - Character.Head.Position).unit
	
	Toss(lookAt)
	
	task.wait(CooldownTime)
	Cooldown.Value = false
end)

Tool.Equipped:Connect(function()
	Character = Tool.Parent
	Humanoid = Character:FindFirstChildOfClass("Humanoid")
end)

Tool.Unequipped:Connect(function()
	Character = nil
	Humanoid = nil
end)