Roblox/luau_corpus huggingface dataset:
--[=[
	@within TableUtil
	@function Flat
	@param tbl table
	@param depth number?
	@return table

	Returns a new table where all sub-arrays have been
	bubbled up to the top. The depth at which the scan
	is performed is dictated by the `depth` parameter,
	which is set to `1` by default.

	```lua
	local t = {{10, 20}, {90, 100}, {30, 15}}
	local flat = TableUtil.Flat(t)
	print(flat) --> {10, 20, 90, 100, 30, 15}
	```

	:::note Arrays only
	This function works on arrays, but not dictionaries.
]=]
local function Flat<T>(tbl: { T }, depth: number?): { T }
	local maxDepth: number = if type(depth) == "number" then depth else 1
	local flatTbl = table.create(#tbl)
	local function Scan(t: { any }, d: number)
		for _, v in t do
			if type(v) == "table" and d < maxDepth then
				Scan(v, d + 1)
			else
				table.insert(flatTbl, v)
			end
		end
	end
	Scan(tbl, 0)
	return flatTbl
end
---------Main Events--------------
local Events = Tool:WaitForChild("Events")
local ShootRE = Events:WaitForChild("ShootRE")
local bulletRE = Events:WaitForChild("CreateBullet")

local LeftButtonDown
local Reloading = false
local IsShooting = false
local Pitch = script.Parent.Handle.FireSound
-- goro7

local plr = game.Players.LocalPlayer

function update()
	
	-- Calculate scale
	local scale = (plr.PlayerGui.MainGui.AbsoluteSize.Y + 30) / script.Parent.Parent.Size.Y.Offset
	if scale > 1.5 then
		scale = 1.5
	end
	if scale > 0 then
		script.Parent.Scale = scale
	end
	
end

plr.PlayerGui:WaitForChild("MainGui"):GetPropertyChangedSignal("AbsoluteSize"):connect(update)
update()
-- 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 sounds volume of 0
		knife.KnifeScript.KnifeProjectileScript.Thud.Volume = 0
		knife.KnifeScript.KnifeProjectileScript.Woosh.Volume = 0
		knife.Handle.Draw.Volume = 0
		knife.Handle.Hit.Volume = 0
		knife.Handle.Swing.Volume = 0
		
	end
	
end
-- Basic settings
local ROTATION_SPEED = 0.025

local tweenService = game:GetService("TweenService")
local debounce = false
local breakLoop = false

script.Parent.Touched:connect(function(hit)
	
	-- Check if player
	if hit.Parent:FindFirstChild("Humanoid") and not debounce then
		debounce = true
		
		-- Give if player isn't null and hasn't reached maximum coins
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		if plr ~= nil then
			local maxCoins = 10
			if plr.Stats.IsHunter.Value then
				maxCoins = maxCoins + 100
			end
			if plr.Stats.CoinsPickedUpInRound.Value < maxCoins then
				
				-- Set the loop to break
				breakLoop = true
				
				-- Give coin
				plr.Stats.CoinsPickedUpInRound.Value = plr.Stats.CoinsPickedUpInRound.Value + 1
				plr.Stats.Coins.Value = plr.Stats.Coins.Value + 1000
				
				-- Play effect
				game.ReplicatedStorage.Interactions.Client.GotCoinEffect:FireClient(plr, script.Parent.Position)
				
				-- Continously spin and make less visible
				local originalCFrame = script.Parent.CFrame
				for i=1, 20 do
					script.Parent.CFrame = originalCFrame * CFrame.new(-5 * math.sin(i * math.pi / 20), 0, 0) * CFrame.fromEulerAnglesXYZ(0.75 * i, 0, 0)
					script.Parent.Transparency = math.sin(i * math.pi / 40)
					wait()
				end
				
				-- Destroy
				script.Parent:destroy()
				
			end
		end
			
		debounce = false
	end
	
end)

while true do
	
	-- Wait
	local waitTime = wait()
	
	-- See if should break loop
	if breakLoop then
		break
	end
	
	-- Tween to rotate
	local goal
	if script.Parent.Transparency > 0 then
		goal = {
			CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(ROTATION_SPEED, 0, 0),
			Transparency = script.Parent.Transparency - 0.033
		}
	else
		goal = {
			CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(ROTATION_SPEED, 0, 0)
		}
	end
	tweenService:Create(script.Parent, TweenInfo.new(waitTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), goal):Play()
	
end
------------------------------------

function onTouched(part)
	if part.Parent ~= nil then
	local h = part.Parent:findFirstChild("Humanoid")
		if h~=nil then
			local teleportfrom=script.Parent.Enabled.Value
			if teleportfrom~=0 then
				if h==humanoid then
				return
				end
				local teleportto=script.Parent.Parent:findFirstChild(modelname)
				if teleportto~=nil then
					local torso = h.Parent.UpperTorso
					local torso = h.Parent.LowerTorso
					local location = {teleportto.Position}
					local i = 1

					local x = location[i].x
					local y = location[i].y
					local z = location[i].z
				
					x = x + math.random(-1, 1)
					z = z + math.random(-1, 1)
					y = y + math.random(2, 3)

					local cf = torso.CFrame
					local lx = 0
					local ly = y
					local lz = 0
					
					script.Parent.Enabled.Value=0
					teleportto.Enabled.Value=0
					torso.CFrame = CFrame.new(Vector3.new(x,y,z), Vector3.new(lx,ly,lz))
					wait(3)
					script.Parent.Enabled.Value=1
					teleportto.Enabled.Value=1
				else
					print("Could not find teleporter!")
				end
			end
		end
	end
end

script.Parent.Touched:connect(onTouched)
--[[---------------- FUNCTIONS -----------------]]--

local function isAValidNearbyInteractable(targetObj)
	if not targetObj then return end
	if not targetObj:IsA("BasePart") then return end
	local interactable = targetObj:GetAttribute("Interactable")
	if not interactable then return end
	local module = interactables:FindFirstChild(targetObj.Name)
	if not module then return end
	local dist = (targetObj.Position - hrp.Position).magnitude	
	if dist > MAX_INTERACTION_DIST + math.max(targetObj.Size.X, targetObj.Size.Y, targetObj.Size.Z) / 2 then return end

	return module
end

local function samePlayer(rPly)
	if rPly ~= ply then rPly:Kick(_G.EXPLOITER_KICK_MESSAGE) return false end
	return true
end

local function interact()
	if downedVal.Value then return end 
	
	if holdingInputVal.Value and mouseHoverObjectVal.Value then		
		local interactableModule = isAValidNearbyInteractable(mouseHoverObjectVal.Value)	
		local success = false
		local serverChecksFunc = nil
		if interactableModule then
			local mod = require(interactableModule)	
			if mod and mod.serverChecks and typeof(mod.serverChecks) == "function" then
				success = mod.serverChecks(mouseHoverObjectVal.Value)
				serverChecksFunc = mod.serverChecks
			else
				success = true
			end
		end
		
		if success then
				
			local interactionSuccessful = CIH.determineInteraction(ply, mouseHoverObjectVal.Value)	
			local shouldKeepHolding = true
			local interacted = nil

			while interactionSuccessful and shouldKeepHolding do
				interacted, shouldKeepHolding = CIH.interact(ply, mouseHoverObjectVal.Value)
				if shouldKeepHolding then
					interactionSuccessful = CIH.determineInteraction(ply, mouseHoverObjectVal.Value)	
				end
			end
			
			if serverChecksFunc and not serverChecksFunc(mouseHoverObjectVal.Value) then
				deleteInteractionUIEvent:FireClient(ply, mouseHoverObjectVal.Value)
			end
		end
	end
end

local function onUpdateInputHoldEvent(rPly, inputState)
	if not samePlayer(rPly) then return end
	if downedVal.Value then return end
	
	if inputState ~= nil and typeof(inputState) == "boolean" then
		holdingInputVal.Value = inputState
	else
		holdingInputVal.Value = false
	end	
	
	interact()
end

local globalObjChangedConn = nil

local function onUpdateHoverObjectEvent(rPly, newObj)
	if not samePlayer(rPly) then return end
	if downedVal.Value then return end
	
	if globalObjChangedConn then globalObjChangedConn:Disconnect() end
	mouseHoverObjectVal.Value = nil
	
	local interactableModule = isAValidNearbyInteractable(newObj)	
	
	if interactableModule then
		mouseHoverObjectVal.Value = newObj
		
		if globalObjChangedConn then globalObjChangedConn:Disconnect() end
		globalObjChangedConn = newObj.Changed:Connect(function()
			if globalObjChangedConn then globalObjChangedConn:Disconnect() end
			mouseHoverObjectVal.Value = nil
			onUpdateHoverObjectEvent(rPly, newObj)
		end)
	end
	
	interact()
end

local function onDown(val)
	if val then
		onUpdateHoverObjectEvent(ply, nil)
		mouseHoverObjectVal.Value = nil
		holdingInputVal.Value = false
	end
end
--[=[
	Destroys the TaskQueue. Just an alias for `Clear()`.
]=]
function TaskQueue:Destroy()
	self:Clear()
end


return TaskQueue
--nonpolice
game.Players.PlayerAdded:Connect(function(Player)  
	Player.CharacterAdded:Connect(function(Character)
		print(Player.TeamColor)
		if Player.TeamColor == BrickColor.new("Medium stone grey") then
			Character.Humanoid.MaxHealth = 115
			Character.Humanoid.Health = 115
		end
	end)
end)
game.Players.PlayerAdded:Connect(function(Player)  
	Player.CharacterAdded:Connect(function(Character)
		print(Player.TeamColor)
		if Player.TeamColor == BrickColor.new("Persimmon") then
			Character.Humanoid.MaxHealth = 115
			Character.Humanoid.Health = 115
		end
	end)
end)
game.Players.PlayerAdded:Connect(function(Player)  
	Player.CharacterAdded:Connect(function(Character)
		print(Player.TeamColor)
		if Player.TeamColor == BrickColor.new("Deep orange") then
			Character.Humanoid.MaxHealth = 115
			Character.Humanoid.Health = 115
		end
	end)
end)
--// Firemode Settings
	CanSelectFire = false;
	BurstEnabled = false;
	SemiEnabled = true;
	AutoEnabled = false;
	BoltAction = false;
--// Touch Connections
L_3_:WaitForChild('Humanoid').Touched:connect(function(L_312_arg1)
	local L_313_, L_314_ = SearchResupply(L_312_arg1)
	if L_313_ and L_17_ then
		L_17_ = false
		L_106_ = L_24_.Ammo
		L_107_ = L_24_.StoredAmmo * L_24_.MagCount
		L_108_ = L_24_.ExplosiveAmmo
		if L_58_:FindFirstChild('Resupply') then
			L_58_.Resupply:Play()
		end
		wait(15)
		L_17_ = true
	end;
end)
--Version 1.43 Made my PistonsofDoom--
local carSeat=script.Parent.Parent.Parent.Parent
local numbers={180354176,180354121,180354128,180354131,180354134,180354138,180354146,180354158,180354160,180354168,180355596,180354115}


while true do
	wait(0.01)
	local value=(carSeat.Velocity.magnitude)*(10/12) * (60/88) --This is the velocity so if it was 1.6 it should work. If not PM me! or comment!--
	if value<10000 then
		local nnnn=math.floor(value/1000)
		local nnn=(math.floor(value/100))-(nnnn*10)
		local nn=(math.floor(value/10)-(nnn*10))-(nnnn*100)
		local n=(math.floor(value)-(nn*10)-(nnn*100))-(nnnn*1000)
		    script.Parent.A.Image="http://www.roblox.com/asset/?id="..numbers[n+1]
		if value>=10 then
			script.Parent.B.Image="http://www.roblox.com/asset/?id="..numbers[nn+1]
		else
			script.Parent.B.Image="http://www.roblox.com/asset/?id="..numbers[12]
		end
		if value>=100 then
			script.Parent.C.Image="http://www.roblox.com/asset/?id="..numbers[nnn+1]
		else
			script.Parent.C.Image="http://www.roblox.com/asset/?id="..numbers[12]
		end
	else
		script.Parent.A.Image="http://www.roblox.com/asset/?id="..numbers[10]
		script.Parent.B.Image="http://www.roblox.com/asset/?id="..numbers[10]	
		script.Parent.C.Image="http://www.roblox.com/asset/?id="..numbers[10]
	end

end
--[[
	Credit to einsteinK.
	Credit to Stravant for LBI.
	
	Credit to the creators of all the other modules used in this.
	
	Sceleratis was here and decided modify some things.
	
	einsteinK was here again to fix a bug in LBI for if-statements
--]]

local waitDeps = {
	'Rerubi';
	'LuaK';
	'LuaP';
	'LuaU';
	'LuaX';
	'LuaY';
	'LuaZ';
}

for i,v in pairs(waitDeps) do script:WaitForChild(v) end

local luaX = require(script.LuaX)
local luaY = require(script.LuaY)
local luaZ = require(script.LuaZ)
local luaU = require(script.LuaU)
local rerubi = require(script.Rerubi)

luaX:init()
local LuaState = {}

getfenv().script = nil

return function(str,env)
	local f,writer,buff,name
	local env = env or getfenv(2)
	local name = (env.script and env.script:GetFullName())
	local ran,error = pcall(function()
		local zio = luaZ:init(luaZ:make_getS(str), nil)
		if not zio then return error() end
		local func = luaY:parser(LuaState, zio, nil, name or "::Adonis::Loadstring::")
		writer, buff = luaU:make_setS()
		luaU:dump(LuaState, func, writer, buff)
		f = rerubi(buff.data, env)
	end)
	
	if ran then
		return f,buff.data
	else
		return nil,error
	end
end
--Weld stuff here

MakeWeld(car.Misc.Wheel.A,car.DriveSeat,"Motor",.5).Name="W"
ModelWeld(car.Misc.Wheel.Parts,car.Misc.Wheel.A)
--Zoom function--

mouse.WheelBackward:connect(function()
	if CamV ~= "third" then
		if cam.FieldOfView <= 100 then
			cam.FieldOfView = cam.FieldOfView + 5
		end
	end
end)
			
mouse.WheelForward:connect(function()
	if CamV ~= "third" then
		if cam.FieldOfView >= 20 then
			cam.FieldOfView = cam.FieldOfView - 5
		end
	end
end)
--Collision
character.LowerTorso.CollisionGroupId = 0
character.RightLowerArm.CollisionGroupId = 0
character.LeftLowerArm.CollisionGroupId = 0
character.RightLowerLeg.CollisionGroupId = 0
character.LeftLowerLeg.CollisionGroupId = 0
end
end)
mouse5.KeyUp:connect(function(key)
if string.byte(key) == 	114 then
	    humanoid:ChangeState(stateType.GettingUp)
	    local UTJoint = character:FindFirstChild("UpperTorso")
		local LTJoint = character:FindFirstChild("LowerTorso")
		local RUA = character:FindFirstChild("RightUpperArm")
		local LUA = character:FindFirstChild("LeftUpperArm")
		local RUL = character:FindFirstChild("RightUpperLeg")
		local LUL = character:FindFirstChild("LeftUpperLeg")
		local RLA = character:FindFirstChild("RightLowerArm")
		local LLA = character:FindFirstChild("LeftLowerArm")
		local RLL = character:FindFirstChild("RightLowerLeg")
		local LLL = character:FindFirstChild("LeftLowerLeg")
		local RH = character:FindFirstChild("RightHand")
		local LH = character:FindFirstChild("LeftHand")
		local RF = character:FindFirstChild("RightFoot")
		local LF = character:FindFirstChild("LeftFoot")
		local HRP = character:FindFirstChild("HumanoidRootPart")
	    local Torso character.UpperTorso.Waist.Part0 = LTJoint
        local Torso2 character.UpperTorso.Waist.Part1 = UTJoint
        local LUAJoint character.RightUpperArm.RightShoulder.Part0 = UTJoint
        local LUAJoint2 character.RightUpperArm.RightShoulder.Part1 = RUA
        local LUAJoint character.LeftUpperArm.LeftShoulder.Part0 = UTJoint
        local LUAJoint2 character.LeftUpperArm.LeftShoulder.Part1 = LUA
        local RULJoint character.RightUpperLeg.RightHip.Part0 = LTJoint
        local RULJoint2 character.RightUpperLeg.RightHip.Part1 = RUL
        local LULJoint character.LeftUpperLeg.LeftHip.Part0 = LTJoint
        local LULJoint2 character.LeftUpperLeg.LeftHip.Part1 = LUL
        local RLAJoint character.RightLowerArm.RightElbow.Part0 = RUA
        local RLAJoint2 character.RightLowerArm.RightElbow.Part1 = RLA
        local LLAJoint character.LeftLowerArm.LeftElbow.Part0 = LUA
        local LLAJoint2 character.LeftLowerArm.LeftElbow.Part1 = LLA
        local RLLJoint character.RightLowerLeg.RightKnee.Part0 = RUL
        local RLLJoint2 character.RightLowerLeg.RightKnee.Part1 = RLL
        local LLLJoint character.LeftLowerLeg.LeftKnee.Part0 = LUL
        local LLLJoint2 character.LeftLowerLeg.LeftKnee.Part1 = LLL
        local RHJoint character.RightHand.RightWrist.Part0 = RLA
        local RHJoint2 character.RightHand.RightWrist.Part1 = RH
        local LHJoint character.LeftHand.LeftWrist.Part0 = LLA
        local LHJoint2 character.LeftHand.LeftWrist.Part1 = LH
        local RFJoint character.RightFoot.RightAnkle.Part0 = RLL
        local RFJoint2 character.RightFoot.RightAnkle.Part1 = RF
        local LFJoint character.LeftFoot.LeftAnkle.Part0 = LLL
        local LFJoint2 character.LeftFoot.LeftAnkle.Part1 = LF
        character.RagdollFallingMoreFromAlexRagdoll.Disabled = true
end
end)
-- The maximum distance the can can shoot, this value should never go above 1000
local Range = 350
-- I hate to use this over a mathematical spring, but this means we don't need an entire extra module

local springPart = script:WaitForChild("Spring");
local BP = springPart:WaitForChild("BodyPosition");

BP.Position = Vector3.new();
springPart.CFrame = CFrame.new();
springPart.Anchored = false;
--------LEFT DOOR --------

game.Workspace.doorleft.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)

game.Workspace.doorleft.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorleft.l31.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)

game.Workspace.doorleft.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)

game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)

game.Workspace.Lighting.flashcurrent.Value = "11"
--[[Engine]]

	--		[TORQUE CURVE VISUAL]
	--		https://www.desmos.com/calculator/nap6stpjqf
	--		Use sliders to manipulate values
	--		Edit everything as if your car is NATURALLY aspirated, or as if it lacks a turbo.
	
	Tune.Horsepower		= 51
	Tune.IdleRPM		= 200
	Tune.PeakRPM		= 1850
	Tune.Redline		= 2000
	Tune.EqPoint		= 75000
	Tune.PeakSharpness	= 20
	Tune.CurveMult		= 0.2
	
	Tune.InclineComp	= 1.2		-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Turbo Settings
	Tune.Aspiration		= "Natural"												--[[
	[Aspiration]
		"Natural"		: N/A, Naturally aspirated engine
		"Single"		: Single turbocharger
		"Double"		: Twin turbocharger
		"Super"			: Supercharger												]]
	
	Tune.Boost			= 5			--Max PSI (If you have two turbos and this is 15, the PSI will be 30)
	Tune.TurboSize		= 80		--Turbo size; the bigger it is, the more lag it has.
	Tune.CompressRatio	= 9			--The compression ratio (look it up)
	Tune.Sensitivity	= 0.05		--How quickly the Supercharger (if appllied) will bring boost when throttle is applied. (Increment applied per tick, suggested values from 0.05 to 0.1)
	
	--Misc
	Tune.RevAccel		= 100		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 155		-- RPM decay when clutch is off
	Tune.RevBounce		= 10		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 250		-- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
--------LIGHTED RECTANGLES--------

game.Workspace.rightpalette.l11.BrickColor = BrickColor.new(1002)
game.Workspace.rightpalette.l12.BrickColor = BrickColor.new(1002)
game.Workspace.rightpalette.l13.BrickColor = BrickColor.new(1002)
game.Workspace.rightpalette.l14.BrickColor = BrickColor.new(1002)
game.Workspace.rightpalette.l15.BrickColor = BrickColor.new(1002)
game.Workspace.rightpalette.l16.BrickColor = BrickColor.new(1002)
game.Workspace.rightpalette.l21.BrickColor = BrickColor.new(1002)
game.Workspace.rightpalette.l22.BrickColor = BrickColor.new(1002)
game.Workspace.rightpalette.l23.BrickColor = BrickColor.new(1002)
game.Workspace.rightpalette.l24.BrickColor = BrickColor.new(1002)
game.Workspace.rightpalette.l25.BrickColor = BrickColor.new(1002)
game.Workspace.rightpalette.l26.BrickColor = BrickColor.new(1002)
-- << CONFIGURATION >>
local rank = "Owner"
local rankType = "Perm" -- "Temp", "Server" or "Perm". For more info, visit: https://devforum.roblox.com/t/HD/266932
local successColor = Color3.fromRGB(0,255,0)
local errorColor = Color3.fromRGB(255,0,0)
--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.KittyJump-- 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)
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------
	,VRecoil = {12,16}				--- Vertical Recoil
	,HRecoil = {5,7}				--- Horizontal Recoil
	,AimRecover = .7				---- Between 0 & 1
	
	,RecoilPunch = .15
	,VPunchBase = 2.5				--- Vertical Punch
	,HPunchBase = 1.7				--- Horizontal Punch
	,DPunchBase = 1 				--- Tilt Punch | useless
	
	,AimRecoilReduction = 5 		--- Recoil Reduction Factor While Aiming (Do not set to 0)
	,PunchRecover = 0.2
	,MinRecoilPower = .5
	,MaxRecoilPower = 3.5
	,RecoilPowerStepAmount = .25
	
	,MinSpread = 0.56				--- Min bullet spread value | Studs
	,MaxSpread = 35					--- Max bullet spread value | Studs
	,AimInaccuracyStepAmount = 0.5
	,WalkMultiplier = 0				--- Bullet spread based on player speed

	,SwayBase = 0.25				--- Weapon Base Sway | Studs
	,MaxSway =	1.5					--- Max sway value based on player stamina | Studs
--[=[
	Observes the current value of the ValueObject
	@param valueObject ValueObject<T>
	@return Observable<T>
]=]
function ValueObjectUtils.observeValue(valueObject)
	assert(ValueObject.isValueObject(valueObject), "Bad valueObject")

	return Observable.new(function(sub)
		if not valueObject.Destroy then
			warn("[ValueObjectUtils.observeValue] - Connecting to dead ValueObject")
			-- No firing, we're dead
			sub:Complete()
			return
		end

		local maid = Maid.new()

		maid:GiveTask(valueObject.Changed:Connect(function()
			sub:Fire(valueObject.Value)
		end))

		sub:Fire(valueObject.Value)

		return maid
	end)
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

	fire(lookAt)

	--wait(2)

	--Tool.Enabled = true
end

while true do
script.Parent.Activated:wait()
connection = game:service("RunService").Stepped:connect(onActivated)
wait(2)
end
--- VARIABLES/CONSTANTS ---

Character = script.Parent
Humanoid = Character.Humanoid
HumanoidRootPart = Character.HumanoidRootPart

Debounce = false