Roblox/luau_corpus huggingface dataset:
-----------------------------------------------



function findAllFlagStands(root)
	local c = root:children()
	for i=1,#c do
		if (c[i].className == "Model" or c[i].className == "Part") then
			findAllFlagStands(c[i])
		end
		if (c[i].className == "FlagStand") then
			table.insert(stands, c[i])
		end
	end
end

function hookUpListeners()
	for i=1,#stands do
		stands[i].FlagCaptured:connect(onCaptureScored)
	end
end

function onPlayerEntered(newPlayer)

	if CTF_mode == true then

		local stats = Instance.new("IntValue")
		stats.Name = "leaderstats"

		local captures = Instance.new("IntValue")
		captures.Name = "Captures"
		captures.Value = 0


		captures.Parent = stats

		-- VERY UGLY HACK
		-- Will this leak threads?
		-- Is the problem even what I think it is (player arrived before character)?
		while true do
			if newPlayer.Character ~= nil then break end
			wait(5)
		end

		stats.Parent = newPlayer

	else

		local stats = Instance.new("IntValue")
		stats.Name = "leaderstats"
		local kills = false
		if Settings.LeaderboardSettings.KOs then
			kills = Instance.new("IntValue")
			kills.Name = Settings.LeaderboardSettings.KillsName
			kills.Value = 0
		end
		local deaths = false
		if Settings.LeaderboardSettings.WOs then
			deaths = Instance.new("IntValue")
			deaths.Name = Settings.LeaderboardSettings.DeathsName
			deaths.Value = 0
		end
		
		local cash = false
		if Settings.LeaderboardSettings.ShowCurrency then
			cash = Instance.new("StringValue")
			cash.Name = Settings.CurrencyName
			cash.Value = 0
		end
		
		local PlayerStats = game.ServerStorage.PlayerMoney:FindFirstChild(newPlayer.Name)
		if PlayerStats ~= nil then
			if cash then
				local Short = Settings.LeaderboardSettings.ShowShortCurrency
				PlayerStats.Changed:connect(function()
					if (Short) then
						cash.Value = Settings:ConvertShort(PlayerStats.Value)
					else
						cash.Value = Settings:ConvertComma(PlayerStats.Value)
					end
				end)
			end
		end
		if kills then
		kills.Parent = stats
		end
		if deaths then
		deaths.Parent = stats
		end
		if cash then
		cash.Parent = stats
		end

		-- VERY UGLY HACK
		-- Will this leak threads?
		-- Is the problem even what I think it is (player arrived before character)?
		while true do
			if newPlayer.Character ~= nil then break end
			wait(5)
		end

		local humanoid = newPlayer.Character.Humanoid

		humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )

		-- start to listen for new humanoid
		newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )


		stats.Parent = newPlayer

	end

end


function onCaptureScored(player)

		local ls = player:findFirstChild("leaderstats")
		if ls == nil then return end
		local caps = ls:findFirstChild("Captures")
		if caps == nil then return end
		caps.Value = caps.Value + 1

end


findAllFlagStands(game.Workspace)
hookUpListeners()
if (#stands > 0) then CTF_mode = true end
game.Players.ChildAdded:connect(onPlayerEntered)
----------------------------------
------------FUNCTIONS-------------
----------------------------------

function UnDigify(digit)
	if digit < 1 or digit > 61 then
		return ""
	elseif digit == 1 then
		return "1"
	elseif digit == 2 then
		return "!"
	elseif digit == 3 then
		return "2"
	elseif digit == 4 then
		return "@"
	elseif digit == 5 then
		return "3"
	elseif digit == 6 then
		return "4"
	elseif digit == 7 then
		return "$"
	elseif digit == 8 then
		return "5"
	elseif digit == 9 then
		return "%"
	elseif digit == 10 then
		return "6"
	elseif digit == 11 then
		return "^"
	elseif digit == 12 then
		return "7"
	elseif digit == 13 then
		return "8"
	elseif digit == 14 then
		return "*"
	elseif digit == 15 then
		return "9"
	elseif digit == 16 then
		return "("
	elseif digit == 17 then
		return "0"
	elseif digit == 18 then
		return "q"
	elseif digit == 19 then
		return "Q"
	elseif digit == 20 then
		return "w"
	elseif digit == 21 then
		return "W"
	elseif digit == 22 then
		return "e"
	elseif digit == 23 then
		return "E"
	elseif digit == 24 then
		return "r"
	elseif digit == 25 then
		return "t"
	elseif digit == 26 then
		return "T"
	elseif digit == 27 then
		return "y"
	elseif digit == 28 then
		return "Y"
	elseif digit == 29 then
		return "u"
	elseif digit == 30 then
		return "i"
	elseif digit == 31 then
		return "I"
	elseif digit == 32 then
		return "o"
	elseif digit == 33 then
		return "O"
	elseif digit == 34 then
		return "p"
	elseif digit == 35 then
		return "P"
	elseif digit == 36 then
		return "a"
	elseif digit == 37 then
		return "s"
	elseif digit == 38 then
		return "S"
	elseif digit == 39 then
		return "d"
	elseif digit == 40 then
		return "D"
	elseif digit == 41 then
		return "f"
	elseif digit == 42 then
		return "g"
	elseif digit == 43 then
		return "G"
	elseif digit == 44 then
		return "h"
	elseif digit == 45 then
		return "H"
	elseif digit == 46 then
		return "j"
	elseif digit == 47 then
		return "J"
	elseif digit == 48 then
		return "k"
	elseif digit == 49 then
		return "l"
	elseif digit == 50 then
		return "L"
	elseif digit == 51 then
		return "z"
	elseif digit == 52 then
		return "Z"
	elseif digit == 53 then
		return "x"
	elseif digit == 54 then
		return "c"
	elseif digit == 55 then
		return "C"
	elseif digit == 56 then
		return "v"
	elseif digit == 57 then
		return "V"
	elseif digit == 58 then
		return "b"
	elseif digit == 59 then
		return "B"
	elseif digit == 60 then
		return "n"
	elseif digit == 61 then
		return "m"
  	else
    	return "?"
	end
end
function IsBlack(note)
	if note%12 == 2 or note%12 == 4 or note%12 == 7 or note%12 == 9 or note%12 == 11 then
		return true
	end
end

local TweenService = game:GetService("TweenService")
function Tween(obj,Goal,Time,Wait,...)
    local TwInfo = TweenInfo.new(Time,...)
    local twn = TweenService:Create(obj, TwInfo, Goal)
    twn:Play()
    if Wait then
        twn.Completed:wait()
    end
	return
end
-- Shapes --
local shapes = {}
for _, v in pairs(script:GetChildren()) do
	table.insert(shapes, v)
end

local colors = {
	[1] = Color3.fromRGB(255,255,255),
	[2] = Color3.fromRGB(255,0,0),
	[3] = Color3.fromRGB(0,255,0),
	[4] = Color3.fromRGB(0,0,255),
	[5] = Color3.fromRGB(255,255,0),
	[6] = Color3.fromRGB(255,0,191),
	[7] = Color3.fromRGB(0, 255, 255),
	[8] = Color3.fromRGB(213, 115, 61),
	[9] = Color3.fromRGB(98, 37, 209),
	[10] = Color3.fromRGB(91, 93, 105),
}

local function getColor()
	local num = math.random(1,10)
	if colors[num] then
		return colors[num]
	end
	return Color3.fromRGB(255,255,255)
end
--- DEPRECATED METHODS:
function methods:RegisterGuiRoot()
	-- This is left here for compatibility with ChatScript versions lower than 0.5
end
--------LEFT DOOR --------

game.Workspace.doorleft.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
--// Aim|Zoom|Sensitivity Customization
	ZoomSpeed = 0.05; -- The lower the number the slower and smoother the tween
	AimZoom = 60; -- Default zoom
	AimSpeed = 0.70;
	UnaimSpeed = 0.70;
	CycleAimZoom = 30; -- Cycled zoom
	MouseSensitivity = 0.5; -- Number between 0.1 and 1
	SensitivityIncrement = 0.05; -- No touchy
-- probably not a good idea but whatever
local function updateSelected()
	for _, button in next, activeButtons._tasks do
		button:SetSelected(isWearing(button.AssetId))
	end
end
--bp.Position = shelly.PrimaryPart.Position
bp.Parent = nil
wait(math.random(3,8))
end


local soundBank = game.ServerStorage.Sounds.NPC.Peeper:GetChildren()
shelly.Health.Changed:connect(function()
local hitSound = soundBank[math.random(1,#soundBank)]:Clone()
hitSound.PlayOnRemove = true
hitSound.Parent = shelly.PrimaryPart
wait()
hitSound:Destroy()
end)


while true do
if tick()-lastEgg >= 60 then
lastEgg = tick()
local newEgg = game.ServerStorage.Items:FindFirstChild("Egg"):Clone()
newEgg.Color = shelly.Torso.Color
newEgg.CFrame = shelly.PrimaryPart.CFrame*CFrame.new(0,3,3)
newEgg.Parent = workspace
local newSound = game.ServerStorage.Sounds.Quicks.Pop:Clone()
newSound.PlayOnRemove = true
newSound.Parent = newEgg
wait()
newSound:Destroy()

game:GetService("Debris"):AddItem(newEgg,55)
end

MoveShelly()
end
--[[Sword Part Class]]--
	
local SwordPart =
{
	Damage = 50,
	AttackTime = 0.5,
	CoolDown = 0,
	
	LastSwing = 0,
	LastHit = 0,

	Part= nil,
	Owner = nil,--player object that owns this sword
	
	OnHit = nil,
	OnHitHumanoid = nil,
	OnAttackReady = nil,
	OnAttack = nil,
	
	
	SwingSound = nil,
	HitSound = nil,
	SwingAnimation = nil, --animation track!
	
	ActiveConnections = {},
	
}
do
	UTIL.MakeClass(SwordPart)
	function SwordPart.New(npart,nowner)
		local init= UTIL.DeepCopy(SwordPart)
		init.Part= npart
		init.Owner = nowner
		table.insert(init.ActiveConnections,init.Part.Touched:connect(function(hit) init:SwordTouch(hit) end))
		
		init.OnHit = InternalEvent.New()
		init.OnHitHumanoid = InternalEvent.New()
		init.OnAttackReady = InternalEvent.New()
		init.OnAttack = InternalEvent.New()
		
		return init
	end
	
	function SwordPart:SwordTouch(hit)
		if tick()-self.LastSwing >self.AttackTime or tick()-self.LastHit<self.AttackTime then return end
		self.OnHit:Fire(hit)
		local character,humanoid = UTIL.FindCharacterAncestor(hit)
		if character and character ~= self.Owner.Character then
			humanoid:TakeDamage(self.Damage)
			self.OnHitHumanoid:Fire(humanoid,hit)
			self.LastHit = tick()
			if self.HitSound then
				self.HitSound:Play()
			end
		end
		
	end
	
	function SwordPart:DoSwing()
		if tick()-self.LastSwing<self.AttackTime+self.CoolDown then
			return
		end
		
		if self.SwingAnimation then
			self.SwingAnimation:Play()
		end
		if self.SwingSound then
			self.SwingSound:Play()
		end
		self.LastSwing = tick()
		self.OnAttack:Fire()
	end
	
	function SwordPart:Destroy()
		for _,i in pairs(self.ActiveConnections) do
			i:disconnect()
		end
	end
end
do
	local Handle = script.Parent
	local Tool = Handle.Parent
	
	local Player = game.Players.LocalPlayer
	local Character = UTIL.WaitForValidCharacter(Player)
	local SwingAni = UTIL.Instantiate"Animation"
	{AnimationId = "http://www.roblox.com/Asset?ID=89289879"}
	
	local HitSound = Handle:WaitForChild('Hit')
	local SwingSound = Handle:WaitForChild('Swing')
	
	local SwingAniTrack
	
	local Sword
	
	
	Tool.Equipped:connect(function(mouse)
		Sword = SwordPart.New(Handle,Player)
		Sword.Damage = 40
		Sword.HitSound = HitSound
		Sword.SwingSound = SwingSound
		Character = UTIL.WaitForValidCharacter(Player)
		local Humanoid = Character:FindFirstChild('Humanoid')

		SwingAniTrack = Humanoid:LoadAnimation(SwingAni)
		Sword.SwingAnimation = SwingAniTrack
		
		Sword.OnHitHumanoid:Connect(function(humanoid,hit)
			local myTorso = Character:FindFirstChild('Torso')
			local torso = humanoid.Parent:FindFirstChild('Torso')
			if not torso or not myTorso then return end
			
			if hit.Name=='Right Arm' or hit.Name=='Left Arm' or hit.Name=='Right Leg' or hit.Name=='Left Leg' then
				hit:BreakJoints()
				WeldUtil.WeldBetween(hit, Handle)
				Delay(1,function() hit:BreakJoints() end )
			end
		end)
		
		mouse.Button1Down:connect(function()
			Sword:DoSwing()
		end)
	end)
	Tool.Unequipped:connect(function()
		Sword:Destroy()
	end)

end
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder)
	local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
	return plrData.Classes.Super.PureKnight.Obtained.Value ~= true
end
--[[
	Issues a warning like `Logging.warn`, but only outputs once per call site.

	This is useful for marking deprecated functions that might be called a lot;
	using `warnOnce` instead of `warn` will reduce output noise while still
	correctly marking all call sites.
]]
function Logging.warnOnce(messageTemplate, ...)
	local trace = debug.traceback()

	if onceUsedLocations[trace] then
		return
	end

	onceUsedLocations[trace] = true
	Logging.warn(messageTemplate, ...)
end

return Logging
--// Bullet Physics
	BulletPhysics = Vector3.new(-10,55,0); -- Drop fixation: Lower number = more drop
	BulletSpeed = 2725; -- Bullet Speed
	BulletSpread = 2.5; -- How much spread the bullet has
	
	ExploPhysics = Vector3.new(0,20,0); -- Drop for explosive rounds
	ExploSpeed = 600; -- Speed for explosive rounds
	
	BulletDecay = 10000; -- How far the bullet travels before slowing down and being deleted (BUGGY)
--Unmute players across different servers
local unmuteConnection = ms:SubscribeAsync(unmuteTopic, function(message)
	local targetId = message.Data[1]
	for i, plr in pairs(game.Players:GetPlayers()) do
		if plr.UserId == targetId then

			channel:UnmuteSpeaker(plr.Name)
		end
	end
end)
--// Aim|Zoom|Sensitivity Customization
	ZoomSpeed = 0.25; -- The lower the number the slower and smoother the tween
	AimZoom = 50; -- Default zoom
	AimSpeed = 0.45;
	UnaimSpeed = 0.35;
	CycleAimZoom = 50; -- Cycled zoom
	MouseSensitivity = 0.5; -- Number between 0.1 and 1
	SensitivityIncrement = 0.05; -- No touchy
-- Preload animations
function playAnimation(animName, transitionTime, humanoid) 

    local roll = math.random(1, animTable[animName].totalWeight) 
    local origRoll = roll
    local idx = 1
    while (roll > animTable[animName][idx].weight) do
        roll = roll - animTable[animName][idx].weight
        idx = idx + 1
    end
    --print(animName .. " " .. idx .. " [" .. origRoll .. "]")
    local anim = animTable[animName][idx].anim
    -- switch animation
    if (anim ~= currentAnimInstance) then
        if (currentAnimTrack ~= nil) then
            currentAnimTrack:Stop(transitionTime)
            currentAnimTrack:Destroy()
        end
        currentAnimSpeed = 1.0
        -- load it to the humanoid; get AnimationTrack
        currentAnimTrack = humanoid:LoadAnimation(anim)
        -- play the animation
        currentAnimTrack:Play(transitionTime)
        currentAnim = animName
        currentAnimInstance = anim
        -- set up keyframe name triggers
        if (currentAnimKeyframeHandler ~= nil) then
            currentAnimKeyframeHandler:disconnect()
        end
        currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
    end
end
---
local  Paint = false
	
script.Parent.MouseButton1Click:connect(function()
	Paint = not Paint
	handler:FireServer("Gold",Paint)
end)
-- Decompiled with the Synapse X Luau decompiler.

local l__ReplicatedStorage__1 = game.ReplicatedStorage;
function getLevel(p1)
	local v1 = 0;
	local l__Value__2 = l__ReplicatedStorage__1.Pets.Settings.MaxPetLevel.Value;
	local v3 = 0 - 1;
	while true do
		if 100 * v3 + v1 <= p1 then
			if v3 ~= l__ReplicatedStorage__1.Pets.Settings.MaxPetLevel.Value then

			else
				return v3;
			end;
			if p1 < 100 * v3 + v1 + (100 + 25 * v3) then
				return v3;
			end;
		end;
		v1 = v1 + v3 * 25;
		if 0 <= 1 then
			if v3 < l__Value__2 then

			else
				break;
			end;
		elseif l__Value__2 < v3 then

		else
			break;
		end;
		v3 = v3 + 1;	
	end;
end;
local l__LocalPlayer__2 = game.Players.LocalPlayer;
function GetFolderFromPetID(p2)
	for v7, v8 in pairs(l__LocalPlayer__2.Pets:GetChildren()) do
		if v8.PetID.Value == p2 then
			return v8;
		end;	
	end;
	return nil;
end;
function getLayoutOrder(p3)
	local v9 = GetFolderFromPetID(p3);
	local l__Value__10 = l__ReplicatedStorage__1.Pets.Rarities:FindFirstChild(l__ReplicatedStorage__1.Pets.Models:FindFirstChild(v9.Name).Settings.Rarity.Value).Order.Value;
	local l__Value__11 = l__ReplicatedStorage__1.Pets.Settings.MaxPetLevel.Value;
	local v12 = getLevel(v9.TotalXP.Value);
	local v13 = {};
	local v14 = 0;
	for v18, v19 in pairs(l__ReplicatedStorage__1.Pets.Models:GetChildren()) do
		v13[#v13 + 1] = v19;	
	end;
	table.sort(v13, function(p4, p5)
		return p4:GetFullName() < p5:GetFullName();
	end);
	for v24, v23 in pairs(v13) do
		if v9.Equipped.Value == true then
			if v9.Name == v23.Name then
				return l__Value__11 * #v13 * (#l__ReplicatedStorage__1.Pets.Rarities:GetChildren() - l__Value__10) + v14 * l__Value__11 + (l__Value__11 - v12);
			end;
		elseif v9.Name == v23.Name then
			return #v13 * #l__ReplicatedStorage__1.Pets.Rarities:GetChildren() * l__Value__11 + l__Value__11 * #v13 * (#l__ReplicatedStorage__1.Pets.Rarities:GetChildren() - l__Value__10) + v14 * l__Value__11 + (l__Value__11 - v12);
		end;
		v14 = v14 + 1;	
	end;
end;
local l__Inventory__3 = script.Parent.Parent.Parent.Parent.MainFrame.Inventory;
script.Parent.MouseButton1Click:Connect(function()
	local v25, v26 = l__ReplicatedStorage__1.RemoteEvents.PetActionRequest:InvokeServer("Delete", {
		PetID = script.Parent.Parent.Parent.PetID.Value
	});
	if v25 ~= "Success" then
		if v25 == "Error" then
			print(v26);
		end;
		return;
	end;
	script.Parent.Parent.Visible = false;
	for v27, v28 in pairs(l__Inventory__3:GetChildren()) do
		if not v28:IsA("UIGridLayout") then
			v28.LayoutOrder = getLayoutOrder(v28.PetID.Value);
		end;
	end;
end);
--Rear
rWheel.CustomPhysicalProperties = PhysicalProperties.new(_Tune.RWheelDensity,rWheel.CustomPhysicalProperties.Friction,rWheel.CustomPhysicalProperties.Elasticity,rWheel.CustomPhysicalProperties.FrictionWeight,rWheel.CustomPhysicalProperties.ElasticityWeight)
-- Called once when the realism client is starting.
-- This is intended for compatibility with AeroGameFramework modules,
-- but the function will automatically be called if executed from a LocalScript.

function CharacterRealism:Start()
	assert(not _G.DefineRealismClient, "Realism can only be started once on the client!")
	_G.DefineRealismClient = true
	
	for key, value in pairs(Config) do
		self[key] = value
	end
	
	for _,humanoid in pairs(CollectionService:GetTagged(self.BindTag)) do
		self:OnHumanoidAdded(humanoid)
	end
	
	self:Connect("UpdateLookAngles", RunService.Heartbeat)
	self:Connect("OnLookReceive", self.SetLookAngles.OnClientEvent)
	self:Connect("OnHumanoidAdded", CollectionService:GetInstanceAddedSignal(self.BindTag))
	
	FpsCamera:Start()
end

if script:IsA("ModuleScript") then
	-- Return the system as a module table.
	return CharacterRealism
else
	-- Sanity check
	assert(script:FindFirstAncestorOfClass("PlayerScripts"), "RealismClient must be a descendant of the PlayerScripts!")
	assert(Players.LocalPlayer, "RealismClient expects a Player on the client to automatically start execution!")	
	
	-- Start automatically.
	CharacterRealism:Start()
end
------//High Ready Animations
self.RightHighReady = CFrame.new(-1, -.5, -1.25) * CFrame.Angles(math.rad(-160), math.rad(0), math.rad(0));
self.LeftHighReady 	= CFrame.new(.85,-0.35,-1.15) * CFrame.Angles(math.rad(-170),math.rad(60),math.rad(15));
-- If at 0, audio player will start right away because audio starts at 0 time position
-- Open to alternatives
local startingTimePositionValue = 0

function Clock.new(timeId)
	local timePosition = Instance.new("NumberValue") -- Could this be slow, does that matter
	timePosition.Name = timeId
	timePosition.Parent = ReplicatedStorage

	local self = {
		initialTimePosition = startingTimePositionValue,
		initialClockTime = nil,
		timePosition = timePosition,
		timeKeepingConnection = nil,
		pauseTime = nil,
	}
	setmetatable(self, Clock)

	return self
end

function Clock:getCurrentTime()
	return os.clock()
end

function Clock:_keepTrackOfTime()
	self:_stopTrackingTime()
	self.initialClockTime = self:getCurrentTime()

	self.timeKeepingConnection = self.RunService.Heartbeat:Connect(function()
		if self.pauseTime then
			self.timePosition.Value = self.pauseTime
		else
			local differenceSinceCall = self:getCurrentTime() - self.initialClockTime
			self.timePosition.Value = differenceSinceCall + self.initialTimePosition
		end
	end)

	return
end

function Clock:Pause()
	self.pauseTime = self.timePosition.Value
	self.pausedAtTime = self:getCurrentTime()
end

function Clock:Unpause()
	self.pauseTime = nil
	self.pausedAtTime = self.pausedAtTime or 0
	self.initialClockTime = self.initialClockTime + (self:getCurrentTime() - self.pausedAtTime)
end

function Clock:_stopTrackingTime()
	if self.timeKeepingConnection then
		self.timeKeepingConnection:Disconnect()
		self.timeKeepingConnection = nil
	end
end

function Clock:StartTime()
	-- TODO: use luke's coroutine wrap because of silencable errors
	coroutine.wrap(function()
		self:_keepTrackOfTime()
	end)()
end

function Clock:ResetTime()
	self:_stopTrackingTime()

	self.timePosition.Value = startingTimePositionValue
	self.initialTimePosition = startingTimePositionValue
end

function Clock:SetTime(timePositionValue)
	self:_stopTrackingTime()

	self.timePosition.Value = timePositionValue
	self.initialTimePosition = timePositionValue
end

return Clock
--// Modules
local L_9_ = require(L_5_:WaitForChild('Config'))
-- Get remote
local updateWalkspeedRemote = replicatedStorage:WaitForChild("UpdateWalkspeed")
--[[ Constants ]]--
local SHIFT_LOCK_OFF = 'rbxasset://textures/ui/mouseLock_off.png'
local SHIFT_LOCK_ON = 'rbxasset://textures/ui/mouseLock_on.png'
local SHIFT_LOCK_CURSOR = 'rbxasset://textures/MouseLockedCursor.png'
--------------------) Settings
Damage = 0 -- the ammout of health the player or mob will take

Cooldown = 5 -- cooldown for use of the tool again

ZoneModelName = "hate soul" -- name the zone model

MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
-------------------------------------------------------------------------------------------------------------------------
upgradeStuff = model:clone()
wait(1)
model:remove()
owner = script.Parent.Parent.Parent.OwnerName 
local ting = 0
function onTouched(hit)
	if ting == 0 then
	ting = 1
	check = hit.Parent:FindFirstChild("Humanoid")
	if check ~= nil then
	if hit.Parent.Name == owner.Value then
		local user = game.Players:GetPlayerFromCharacter(hit.Parent)
		local stats = user:findFirstChild("leaderstats")
		if stats ~= nil then
			local cash = stats:findFirstChild("Cash")
			if cash.Value > (Upgradecost-1) then
				cash.Value = cash.Value - Upgradecost
				upgradeStuff.Parent = script.Parent.Parent.Parent
				script.Parent.Parent:remove()
			end
		end
	end
	end
	ting = 0
	end
end
script.Parent.Touched:connect(onTouched)
-- Codes used to redeem for in-game badges
GameSettings.codes = {
	"testcode"
}