Pinkstack/roblox-luau-corpus-text huggingface dataset:
--Rocket.Touched:connect(OnTouched)



while script.Parent == Rocket do
	ExplodeClone = Explode:clone()
	ExplodeClone.Name = "Effect"
	ExplodeClone.BrickColor = BrickColor.new("White")
	ExplodeClone.Position = Rocket.Position
	ExplodeClone.Mesh.Scale = Vector3.new(1,1,1)*5
	ExplodeClone.CFrame = ExplodeClone.CFrame * CFrame.fromEulerAnglesXYZ(math.random(-10000,10000)/100,math.random(-10000,10000)/100,math.random(-10000,10000)/100)
	ExplodeClone.Parent = game.Players.LocalPlayer.Character.Torso
	NewScript = Rocket.Trail:clone()
	NewScript.Disabled = false
	NewScript.Parent = ExplodeClone
	local hit,pos = raycast(Rocket.Position,((Rocket.CFrame * CFrame.new(0,0,-10)).p-Rocket.Position).unit,10)
	if hit then
		OnTouched(hit,pos)
	end
	Rocket.CFrame = Rocket.CFrame * CFrame.new(0,0,-5) * CFrame.Angles(0, 0, math.rad(18))
	game:GetService("RunService").Stepped:wait()
end
-- NOTE: Make sure the ZIndex of the button used is higher than other GUI parts behind
--       it, or this will not work correctly!






local RippleColor        = Color3.fromRGB(255, 255, 255) -- RGB Color of the ripple effect, you can change it.
local RippleTransparency = 0.8 ---------------------------- Max is 1, Min is 0
local PixelSize          = 2000 --------------------------- The Max size of the ripple in pixels
local TimeLength         = 0.9 ---------------------------- How long the ripple animation is
local FadeLength         = 0.6 ---------------------------- How long it takes for the ripple to fade out
-- declarations


local Figure = script.Parent
local Head = Figure:WaitForChild("HumanoidRootPart")
local Humanoid = Figure:WaitForChild("Humanoid")
local regening = 4
local radius=game.Workspace.Village.Radius.Value

while true do
	wait(1)
	-- print( Head.Position.Magnitude)
	if Head.Position.Magnitude < radius/2 and Humanoid.Health > 0 then
		-- print("Пришёл")
		Humanoid.Health = Humanoid.Health - math.floor( regening/100*Humanoid.MaxHealth + 1 )
		-- добавляем эффект огня
		tmp = Instance.new("Fire")
		tmp.Color=Color3.fromRGB(236,139,70)
		tmp.Heat=1
		tmp.Size=10
		tmp.Parent=Head
		wait(2) -- самоуничтожение через 2 секунды
		tmp:Destroy()
	end	
end
--[[Susupension]]


	Tune.SusEnabled		= true		-- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
	
	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 9000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 2			-- Suspension length (in studs)
	Tune.FPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Rear Suspension
	Tune.RSusDamping	= 500		-- Spring Dampening
	Tune.RSusStiffness	= 12000		-- Spring Force
	Tune.FAntiRoll 		= 30		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 2			-- Suspension length (in studs)
	Tune.RPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics	
	Tune.SusVisible		= true			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Bright red"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--Made by Luckymaxer



Tool = script.Parent
Handle = Tool:WaitForChild("Handle")

Players = game:GetService("Players")

Animations = {}

ServerControl = Tool:WaitForChild("ServerControl")
ClientControl = Tool:WaitForChild("ClientControl")

ToolEquipped = false

function SetAnimation(mode, value)
	if mode == "PlayAnimation" and value and ToolEquipped 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
	end
end

function CheckIfAlive()
	return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
end

function Equipped(Mouse)
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChild("Humanoid")
	ToolEquipped = true
	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)
	Mouse.Move:connect(function()
		InvokeServer("MouseMove", {Position = Mouse.Hit.p, Target = Mouse.Target})
	end)
end

function Unequipped()
	Animations = {}
	ToolEquipped = false
end

function InvokeServer(mode, value)
	pcall(function()
		local ServerReturn = ServerControl:InvokeServer(mode, value)
		return ServerReturn
	end)
end

function OnClientInvoke(mode, value)
	if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
		SetAnimation("PlayAnimation", value)
	elseif mode == "StopAnimation" and value then
		SetAnimation("StopAnimation", value)
	elseif mode == "PlaySound" and value then
		value:Play()
	elseif mode == "StopSound" and value then
		value:Stop()
	elseif mode == "MousePosition" then
		return {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}
	end
end

ClientControl.OnClientInvoke = OnClientInvoke
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
-- functions



function onDied()
	stopLoopedSounds()
	sDied:Play()
end

local fallCount = 0
local fallSpeed = 0
function onStateFall(state, sound)
	fallCount = fallCount + 1
	if state then
		sound.Volume = 0
		sound:Play()
		task.spawn(function()
			local t = 0
			local thisFall = fallCount
			while t < 1.5 and fallCount == thisFall do
				local vol = math.max(t - 0.3 , 0)
				sound.Volume = vol
				task.wait(0.1)
				t = t + 0.1
			end
		end)
	else
		sound:Stop()
	end
	fallSpeed = math.max(fallSpeed, math.abs(Head.Velocity.Y))
end


function onStateNoStop(state, sound)
	if state then
		sound:Play()
	end
end


function onRunning(speed)
	sClimbing:Stop()
	sSwimming:Stop()
	if (prevState == "FreeFall" and fallSpeed > 0.1) then
		local vol = math.min(1.0, math.max(0.0, (fallSpeed - 50) / 110))
		sLanding.Volume = vol
		sLanding:Play()
		fallSpeed = 0
	end
	if speed>0.5 then
		sRunning:Play()
		sRunning.Pitch = speed / 8.0
	else
		sRunning:Stop()
	end
	prevState = "Run"
end

function onSwimming(speed)
	if (prevState ~= "Swim" and speed > 0.1) then
		local volume = math.min(1.0, speed / 350)
		sSplash.Volume = volume
		sSplash:Play()
		prevState = "Swim"
	end
	sClimbing:Stop()
	sRunning:Stop()
	sSwimming.Pitch = 1.6
	sSwimming:Play()
end

function onClimbing(speed)
	sRunning:Stop()
	sSwimming:Stop()	
	if speed>0.01 then
		sClimbing:Play()
		sClimbing.Pitch = speed / 5.5
	else
		sClimbing:Stop()
	end
	prevState = "Climb"
end
--// KeyBindings


	FireSelectKey = Enum.KeyCode.V;
	CycleSightKey = Enum.KeyCode.T;
	LaserKey = Enum.KeyCode.G;
	LightKey = Enum.KeyCode.B;
	InteractKey = Enum.KeyCode.E;
	AlternateAimKey = Enum.KeyCode.Z;
	InspectionKey = Enum.KeyCode.H;
--[[Transmission]]


	Tune.TransModes		= {"Auto", "Semi", "Manual"}												--[[
	[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	= "RPM"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
	Tune.AutoUpThresh	= 1000		-- Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1500		-- Automatic downshift point (relative to peak RPM, positive = Under-rev)
	Tune.ShiftTime = .3				-- The time delay in which you initiate a shift and the car changes gear
	
	--Gear Ratios
	
	Tune.FinalDrive		= 2.65		 --		[TRANSMISSION CALCULATIONS FOR NERDS]
	Tune.Ratios			= {			 --		SPEED [SPS]	 = (Wheel diameter(studs) * math.pi * RPM) / (60 * Gear Ratio * Final Drive * Multiplier)
		--[[ R ]]		2.85		,--		WHEEL TORQUE = Engine Torque * Gear Ratio * Final Drive * Multiplier
		--[[ N ]]		0			,
		--[[ 1 ]]		2.85		,
		--[[ 2 ]]		1.68		,
		--[[ 3 ]]		1					
	}
	Tune.FDMult			= 1.8			-- Ratio multiplier (keep this at 1 if car is not struggling with torque)
--[[ moved to StarterPlayerScripts to fix rockets not exploding if it hits a surface after you respawn -- edit: it didnt work
workspace.ChildAdded:connect(function(Obj)
	if game:GetService("CollectionService"):HasTag(Obj,Obj.Name) and game:GetService("CollectionService"):HasTag(Obj,Player.Name) then
		local x
		x=Obj.Touched:connect(function(Part) -- detect for touches only on the local player's client
			if not Tool then game:GetService("Debris"):AddItem(Obj,0) return end
			local RDE=Tool:FindFirstChild("RocketDestroyEvent")
			if not RDE then game:GetService("Debris"):AddItem(Obj,0) return end
			RDE:FireServer(Obj,Obj.Position) -- Explosion happens on the server
			Tool.YieldBeyondTouch:Fire() -- Delete the rocket just after disconnecting the function (wait = 4 lines down)
			x:Disconnect() -- No need for debounce if you got this!
		end)
		Tool.YieldBeyondTouch.Event:wait()
		game:GetService("Debris"):AddItem(Obj,(1/30))
	end
end)
]]
-- check if camera is zoomed into first person


local function checkfirstperson()
	--if isfirstperson == false then -- not in first person
	--	if ((camera.focus.p - camera.CFrame.p).magnitude <= 1) then
	--		enableviewmodel()
	--	end
	--elseif ((camera.focus.p - camera.CFrame.p).magnitude > 1.1) then
	--	disableviewmodel()
	--end
	enableviewmodel()
end
--[[
	Updates the status values depending on the amount of breached or non breached rooms.
]]


function RoomManager._updateStatusValues()
	local breachedRooms = 0
	local secureRooms = 0

	for _, room in pairs(rooms:getAll()) do
		if room:isBreached() then
			breachedRooms = breachedRooms + 1
		else
			secureRooms = secureRooms + 1
		end
	end

	roomsBreached.Value = breachedRooms
	roomsSecure.Value = secureRooms
end
--[=[
	@within TableUtil
	@function Some
	@param tbl table
	@param callback (value: any, index: any, tbl: table) -> boolean
	@return boolean

	Returns `true` if the `callback` also returns `true` for _at least
	one_ of the items in the table.

	```lua
	local t = {10, 20, 40, 50, 60}

	local someBelowTwenty = TableUtil.Some(t, function(value)
		return value < 20
	end)

	print("Some below twenty:", someBelowTwenty) --> Some below twenty: true
	```
]=]


local function Some(tbl: Table, callback: FindCallback): boolean
	for k,v in pairs(tbl) do
		if callback(v, k, tbl) then
			return true
		end
	end
	return false
end
-----------------
--| Functions |--
-----------------



local function MakeReloadRocket()
	local reloadRocket = Instance.new('Part')
	reloadRocket.Name = "Ammo"
	reloadRocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
	reloadRocket.Size = Vector3.new() -- As small as possible

	local mesh = Instance.new('SpecialMesh', reloadRocket)
	mesh.MeshId = ROCKET_MESH_ID
	mesh.Scale = ROCKET_MESH_SCALE
	mesh.TextureId = ToolHandle.Mesh.TextureId

	return reloadRocket
end

local function OnEquipped()
	MyModel = Tool.Parent
	ReloadRocket = MakeReloadRocket()
end

local function OnChanged(property)
	if property == 'Enabled' and Tool.Enabled == false then
		-- Show the next rocket going into the launcher
		StillEquipped = true
		wait(ROCKET_SHOW_TIME)
		if StillEquipped then
			local torso = MyModel:FindFirstChild('Torso')
			if torso and torso:FindFirstChild('Left Shoulder') then
				local leftArm = MyModel:FindFirstChild('Left Arm')
				if leftArm then
					local weld = ReloadRocket:FindFirstChild('Weld')
					if not weld then
						weld = Instance.new('Weld')
						weld.Part0 = leftArm
						weld.Part1 = ReloadRocket
						weld.C1 = CFrame.new(Vector3.new(0, 1, 0))
						weld.Parent = ReloadRocket
					end
					ReloadRocket.Parent = MyModel
				end
				wait(ROCKET_HIDE_TIME - ROCKET_SHOW_TIME)
				if StillEquipped and ReloadRocket.Parent == MyModel then
					ReloadRocket.Parent = nil
				end
			end
		end
	end
end

local function OnUnequipped()
	StillEquipped = false
	ReloadRocket:Destroy()
	ReloadRocket = nil
end
-- Connect events for player interaction


Tool.Equipped:connect(function()
	local Character, Player = GetCharacter(Tool)

	if Character then
		-- Connect events to recalculate gravity when hats are added or removed. Of course, this is not a perfect solution,
		-- as connected parts are not necessarily part of the character, but ROBLOX has no API to handle the changing of joints, and
		-- scanning the whole game for potential joints is really not worth the efficiency cost. 
		GravityMaid.DescendantAddedConnection = Character.DescendantAdded:connect(function()
			UpdateGravityEffect(Character)
		end)

		GravityMaid.DecendantRemovingConnection = Character.DescendantRemoving:connect(function()
			UpdateGravityEffect(Character)
		end)

		UpdateGravityEffect(Character)
		-- Add in the force
		AntiGravityForce.Parent = Handle
	else
		warn("[GravityCoil] - Somehow inexplicity failed to retrieve character")
	end
end)

Tool.Unequipped:connect(function()
	-- Remove force and clean up events
	AntiGravityForce.Parent = nil
	GravityMaid:DoCleaning()
end)
--[[[Default Controls]]


	--Peripheral Deadzones
	Tune.Peripherals = {
		MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
		MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)
		
		ControlLDZone			= 5			,	-- Controller steering L-deadzone (0 - 100%)
		ControlRDZone			= 5			,	-- Controller steering R-deadzone (0 - 100%)
	}
	
	--Control Mapping
	Tune.Controls = {
		
	--Keyboard Controls
		--Mode Toggles
		ToggleTCS				= Enum.KeyCode.T					,
	    ToggleABS				= Enum.KeyCode.Y					,
		--ToggleTransMode		= Enum.KeyCode.M					,
		ToggleMouseDrive		= Enum.KeyCode.R					,
		
		--Primary Controls
		Throttle				= Enum.KeyCode.Up					,
		Brake					= Enum.KeyCode.Down					,
		SteerLeft				= Enum.KeyCode.Left					,
		SteerRight				= Enum.KeyCode.Right				,
		
		--Secondary Controls
		Throttle2				= Enum.KeyCode.W					,
		Brake2					= Enum.KeyCode.S					,
		SteerLeft2				= Enum.KeyCode.A					,
		SteerRight2				= Enum.KeyCode.D					,
		
		--Manual Transmission
		ShiftUp					= Enum.KeyCode.E					,
		ShiftDown				= Enum.KeyCode.Q					,
		Clutch					= Enum.KeyCode.P			,
		
		--Handbrake
		PBrake					= Enum.KeyCode.LeftShift					,
		
	--Mouse Controls
		MouseThrottle			= Enum.UserInputType.MouseButton1	,
		MouseBrake				= Enum.UserInputType.MouseButton2	,
		MouseClutch				= Enum.KeyCode.W					,
		MouseShiftUp			= Enum.KeyCode.E					,
		MouseShiftDown			= Enum.KeyCode.Q					,
		MousePBrake				= Enum.KeyCode.LeftShift			,
		
	--Controller Mapping
		ContlrThrottle			= Enum.KeyCode.ButtonR2				,
		ContlrBrake				= Enum.KeyCode.ButtonL2				,
		ContlrSteer				= Enum.KeyCode.Thumbstick1			,
		ContlrShiftUp			= Enum.KeyCode.ButtonY				,
		ContlrShiftDown			= Enum.KeyCode.ButtonX				,
		ContlrClutch			= Enum.KeyCode.ButtonR1				,
		ContlrPBrake			= Enum.KeyCode.ButtonL1				,
		ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
		ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
		ContlrToggleABS			= Enum.KeyCode.DPadRight			,
	}
--[[ Local Functions ]]

--
function MouseLockController:OnMouseLockToggled()
	self.isMouseLocked = not self.isMouseLocked

	if self.isMouseLocked then
		local cursorImageValueObj = script:FindFirstChild("CursorImage")
		if cursorImageValueObj and cursorImageValueObj:IsA("StringValue") and cursorImageValueObj.Value then
			self.savedMouseCursor = Mouse.Icon
			--Mouse.Icon = cursorImageValueObj.Value
		else
			if cursorImageValueObj then
				cursorImageValueObj:Destroy()
			end
			cursorImageValueObj = Instance.new("StringValue")
			cursorImageValueObj.Name = "CursorImage"
			cursorImageValueObj.Value = DEFAULT_MOUSE_LOCK_CURSOR
			cursorImageValueObj.Parent = script
			self.savedMouseCursor = Mouse.Icon
			--Mouse.Icon = DEFAULT_MOUSE_LOCK_CURSOR
		end
	else
		if self.savedMouseCursor then
			--Mouse.Icon = self.savedMouseCursor
			self.savedMouseCursor = nil
		end
	end

	self.mouseLockToggledEvent:Fire()
end

function MouseLockController:DoMouseLockSwitch(name, state, input)
	if state == Enum.UserInputState.Begin then
		self:OnMouseLockToggled()
		return Enum.ContextActionResult.Sink
	end
	return Enum.ContextActionResult.Pass
end

function MouseLockController:BindContextActions()
	ContextActionService:BindActionAtPriority(CONTEXT_ACTION_NAME, function(name, state, input)
		return self:DoMouseLockSwitch(name, state, input)
	end, false, MOUSELOCK_ACTION_PRIORITY, unpack(self.boundKeys))
end

function MouseLockController:UnbindContextActions()
	ContextActionService:UnbindAction(CONTEXT_ACTION_NAME)
end

function MouseLockController:IsMouseLocked()
	return self.enabled and self.isMouseLocked
end

function MouseLockController:EnableMouseLock(enable)
	if enable ~= self.enabled then

		self.enabled = enable

		if self.enabled then
			-- Enabling the mode
			self:BindContextActions()
		else
			-- Disabling
			-- Restore mouse cursor
			if Mouse.Icon~="" then
				Mouse.Icon = ""
			end

			self:UnbindContextActions()

			-- If the mode is disabled while being used, fire the event to toggle it off
			if self.isMouseLocked then
				self.mouseLockToggledEvent:Fire()
			end

			self.isMouseLocked = false
		end

	end
end

return MouseLockController
--use this to determine if you want this human to be harmed or not, returns boolean


function checkTeams(otherHuman)
	return not (sameTeam(otherHuman) and not FriendlyFire)
end

function getKnife()
	local knife = Handle:clone()
	knife.Transparency = 0
	knife.Hit.Pitch = math.random(90, 110)/100
	
	local lift = Instance.new("BodyForce")
	lift.force = Vector3.new(0, 196.2, 0) * knife:GetMass() * 0.8
	lift.Parent = knife
	
	local proj = Tool.Projectile:Clone()
	proj.Disabled = false
	proj.Parent = knife
	
	return knife
end

function equippedLoop()
	while Equipped do
		local dt = Heartbeat:wait()
		
		if AttackPower < 1 then
			AttackPower = AttackPower + dt * AttackRecharge
			if AttackPower > 1 then
				AttackPower = 1
			end
		end
		
		Handle.Transparency = 1 - AttackPower
	end
end

function onLeftDown(mousePos)
	local knife = getKnife()
	knife.CFrame = CFrame.new(Handle.Position, mousePos)
	knife.Velocity = knife.CFrame.lookVector * AttackSpeed * AttackPower
	local damage = AttackDamage * AttackPower
	local touched
	touched = knife.Touched:connect(function(part)
		if part:IsDescendantOf(Tool.Parent) then return end
		if contains(Knives, part) then return end
		
		if part.Parent and part.Parent:FindFirstChild("Humanoid") then
			local human = part.Parent.Humanoid
			if checkTeams(human) then
				tagHuman(human)
				human:TakeDamage(damage)
				knife.Hit:Play()
			end
		end
		
		knife.Projectile:Destroy()
		
		local w = Instance.new("Weld")
		w.Part0 = part
		w.Part1 = knife
		w.C0 = part.CFrame:toObjectSpace(knife.CFrame)
		w.Parent = w.Part0
		
		touched:disconnect()
	end)
	table.insert(Knives, knife)
	knife.Parent = workspace
	
	game:GetService("Debris"):AddItem(knife, 35.5)
	delay(25, function()
		knife.Transparency = 1
	end)
	
	Remote:FireClient(getPlayer(), "PlayAnimation", "Throw")	
	
	Handle.Throw.Pitch = 0.8 + 0.4 * AttackPower
	Handle.Throw:Play()
	
	AttackPower = 0
end

function onRemote(player, func, ...)
	if player ~= getPlayer() then return end
	
	if func == "LeftDown" then
		onLeftDown(...)
	end
end

function onEquip()
	Equipped = true
	equippedLoop()
end

function onUnequip()
	Equipped = false
end

Remote.OnServerEvent:connect(onRemote)
Tool.Equipped:connect(onEquip)
Tool.Unequipped:connect(onUnequip)
-- on touch part


part.Touched:Connect(function(hit)
	-- buscamos si el que lo toco es un player
	local player = players:GetPlayerFromCharacter(hit.Parent)
	if player and aux then
		aux = false
		-- si lo toco un player le sumaremos uno a nuestro score
		sound:Play()
		player.leaderstats.Score.Value += SCORE
		wait()
		part:Destroy()
	end
end)
--[[Susupension]]


	Tune.SusEnabled		= true		-- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
	
	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 6200		-- Spring Force
	Tune.FSusLength		= 2			-- Suspension length (in studs)
	Tune.FSusMaxExt		= .3		-- Max Extension Travel (in studs)
	Tune.FSusMaxComp	= .1		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Rear Suspension
	Tune.RSusDamping	= 500		-- Spring Dampening
	Tune.RSusStiffness	= 6500		-- Spring Force
	Tune.RSusLength		= 2			-- Suspension length (in studs)
	Tune.RSusMaxExt		= .3		-- Max Extension Travel (in studs)
	Tune.RSusMaxComp	= .1		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics	
	Tune.SusVisible		= true			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Really black"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--[=[
	@param motor Enum.VibrationMotor
	@param intensity number
	Sets the gamepad's haptic motor to a certain intensity. The
	intensity value is a number in the range of [0, 1].

	```lua
	gamepad:SetMotor(Enum.VibrationMotor.Large, 0.5)
	```
]=]


function Gamepad:SetMotor(motor: Enum.VibrationMotor, intensity: number): number
	self._setMotorIds[motor] += 1
	local id = self._setMotorIds[motor]
	HapticService:SetMotor(self._gamepad, motor, intensity)
	return id
end