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



local PlayerStatManager = require(script.Parent:WaitForChild("PlayerStatManager"))

local serverStorage = game:GetService("ServerStorage")
local replicatedStorage = game:GetService("ReplicatedStorage")
local playerMoney = serverStorage:WaitForChild("PlayerMoney")
local purchaseHandlerNew = content.PurchaseHandlerNew
local players = game:GetService("Players")
local runService = game:GetService("RunService")
local staterGui = game:GetService("StarterGui")

local allObjects = {}

local TycoonSettings = require(script.Parent.Settings)

local Settings = require(script.Settings)
local RebirthSettings = Settings.Rebirth
local TestSettings = Settings.Test

local rebirthEvent = content:WaitForChild("RebirthEvent (Don't Move)")
local touchAllTycoonButtons = content:WaitForChild("TouchAllTycoonButtons")
local giveCashEvent = content:WaitForChild("GiveCash")
local rebirthGui = content:WaitForChild("RebirthGui (Don't Move)")
local touchTycoonButtonsGui = content:FindFirstChild("TouchTycoonButtons")

rebirthEvent.Parent = replicatedStorage
if touchTycoonButtonsGui then
	if runService:IsStudio() or TestSettings.showTouchTycoonButtonsGuiOutsideStudio then
		touchAllTycoonButtons.Parent = replicatedStorage
		giveCashEvent.Parent = replicatedStorage
		touchTycoonButtonsGui.Parent = staterGui 
	else
		touchAllTycoonButtons:Destroy()
		giveCashEvent:Destroy()
		touchTycoonButtonsGui:Destroy()
	end
end
local AllTycoons = {}
for i,v in pairs(script.Parent:WaitForChild('Tycoons'):GetChildren()) do
	AllTycoons[v.Name] = v:Clone()
end
--[[**
	This function allows the developer to schedule the removal of the object without yielding any code. It is the suggested alternative to Debris:AddItem, as this doesn't use the legacy scheduler and also supports tables with a Destroy / destroy method.

	@param [t:union<t:Instance, t:table, t:RBXScriptConnection, t:userdata>] Object The object to be added to destroy scheduler.
	@param [t:optional<t:numberMin<0>>] Lifetime The number of seconds before the object should be destroyed. Defaults to 10.
	@returns [void]
**--]]


function Scheduler.AddItem(Object, Lifetime)
	assert(AddItemTuple(Object, Lifetime))
	local ExecuteTime = tick() + (Lifetime or 10)
	local Connection

	Connection = Heartbeat:Connect(function()
		if tick() >= ExecuteTime then
			Connection:Disconnect()
			if Object then
				if Object.Destroy then
					pcall(Object.Destroy, Object)
				elseif Object.destroy then
					pcall(Object.destroy, Object)
				elseif Object.Disconnect then
					pcall(Object.Disconnect, Object)
				elseif Object.disconnect then
					pcall(Object.disconnect, Object)
				end
			end
		end
	end)

	return Connection
end

return Scheduler
--[[
	Calls a callback on `finally` with specific arguments.
]]


function Promise.prototype:finallyCall(callback, ...)
	assert(type(callback) == "function", string.format(ERROR_NON_FUNCTION, "Promise:finallyCall"))
	local length, values = pack(...)
	return self:_finally(debug.traceback(nil, 2), function()
		return callback(unpack(values, 1, length))
	end)
end
-- Initialize


function PointsService:KnitInit()

    local rng = Random.new()

    -- Give player random amount of points:
    self.Client.GiveMePoints:Connect(function(player)
        local points = rng:NextInteger(0, 10)
        self:AddPoints(player, points)
        print("Gave " .. player.Name .. " " .. points .. " points")
    end)

    -- Clean up data when player leaves:
    game:GetService("Players").PlayerRemoving:Connect(function(player)
        self.PointsPerPlayer[player] = nil
		print("Cleaned up "..player.Name.."'s data because they left!")
    end)

end

return PointsService
-------------------Speed Controls ( Up/down/Forward/Backward)-------------------


				if(key == "d")  and (faster == false) and (slower == false) and (Spd_keep == true) and ( on == true) then 
					local val = plane.Engine:findFirstChild("Speed")
					faster = true
					while faster do
						if(val.Value < minspeed) or (val.Value > maxv) then return end							
						if(val.Value == maxv) then faster = false end 
						val.Value = val.Value +1
						wait()
						end 		
				
				elseif(key == "a")  and (faster == false)  and ( on==true) and (Spd_keep == true) then
				if(on == false) or (plane.Engine:findFirstChild("Speed") == nil) then return end
					if(slower == false) and (faster == false) then
						local val = plane.Engine:findFirstChild("Speed")
						slower = true
						while slower do
						if(val.Value >=minspeed) then
						val.Value = val.Value -1
						elseif(val.Value < minspeed) then
						val.Value = minspeed
						slower = false
						end 
						wait()
						end 
				end
					end 
			
			--Below u can see 2 if's these are if the Vert_keep value is set to true
				if(key == "s")  and planedebounce == false and on == true then
				local val = plane.Engine:findFirstChild("VerticalSpeed")
				if(val == nil) then return end
					downer = true
					uper = false 
					while downer do
					if(val.Value == -20) then downer = false break end
					if(downer==false) then break end
					val.Value = val.Value  -1
					wait(.1)
					end	
				end 

				if(key == "w")  and planedebounce == false and on == true then
				local val = plane.Engine:findFirstChild("VerticalSpeed")
				if(val == nil) then return end
					uper = true
					downer = false
					while uper==true do 
					if(uper == false) then break end
					if(val.Value >= 20) then
						uper = false
 
					end
					val.Value = val.Value +1
					
					wait(.1)
						end
				end 
		

	--[[	if(string.byte(key) == 20) and (on == true) then 
			local engine = plane.Engine
			local bg = engine.BodyGyro
				sideleft = true
				while sideleft do
				sideway = 20
				wait(.1)
			end
		end 
			
		if(string.byte(key) == 19) and (on == true) then 
			local engine = plane.Engine
			local bg = engine.BodyGyro
				sideright = true
				while sideright do
				sideway = -20
				wait(.1)
			end
		end 	]]--
	
		if(string.byte(key) == 23) and on then 
			local engine = plane.Engine
			local spd = engine.Speed
			if(spd.Value < 0) then 
			while spd.Value ~= 0 do
				spd.Value = spd.Value +1
			wait(.1)
			end
			elseif(spd.Value > 0) then 
			while spd.Value ~= 0 do
					spd.Value = spd.Value -1
			wait(.1)
			end
			elseif(spd.Value == 0) then spd.Value = 0
			return 
			end
		end
--[[Wheel Alignment]]


	--[Don't physically apply alignment to wheels]
	--[Values are in degrees]
	Tune.FCamber		= -2
	Tune.RCamber		= -2
	Tune.FCaster		= 0
	Tune.RCaster		= 0	--Will only work with 4WS enabled (Avxnturador)
	Tune.FToe			= 0	
	Tune.RToe			= 0
-- Provides a nice syntax for creating Roblox instances.
-- Example:
--	local newPart = Utility.Create("Part") {
--		Parent = workspace,
--		Anchored = true,
--
--		--Create a SpecialMesh as a child of this part too
--		Utility.Create("SpecialMesh") {
--			MeshId = "rbxassetid://...",
--			Scale = Vector3.new(0.5, 0.2, 10)
--		}
--	}


function CommonUtil.Create(instanceType)
	return function(data)
		local obj = Instance.new(instanceType)
		local parent = nil
		for k, v in pairs(data) do
			if type(k) == 'number' then
				v.Parent = obj
			elseif k == 'Parent' then
				parent = v
			else
				obj[k] = v
			end
		end
		if parent then
			obj.Parent = parent
		end
		return obj
	end
end

return CommonUtil
-----------------------------------------------------------------------------------------------



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

local bike = script.Parent.Parent.Bike.Value
local _Tune = require(bike["Tuner"])

local gauges = script.Parent
local values = script.Parent.Parent.Values
local isOn = script.Parent.Parent.IsOn

gauges:WaitForChild("Speedo")
gauges:WaitForChild("Tach")
gauges:WaitForChild("Boost")
gauges:WaitForChild("ln")
gauges:WaitForChild("bln")
gauges:WaitForChild("Gear")
gauges:WaitForChild("Speed")

bike.DriveSeat.HeadsUpDisplay = false

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

if not _Tune.Engine and _Tune.Electric then _lRPM = _Tune.ElecRedline _pRPM = _Tune.ElecTransition2 end

local currentUnits = 1
local revEnd = math.ceil(_lRPM/1000)
-- plr is 'player'
-- item is the 'tool' or 'key' clicked on


function module.Clicked (plr, item)
    
    -- 1. Check is player exists (not nil) and player is not Piggy
    if plr then 
        if plr.Character and not plr:FindFirstChild("Piggy") then
            
            -- 2. Get the position of the part so we can swap parts
            -- models do not have position as a property, rather a PrimaryPart property which is generally the handle (some invisible part)
            
            local position
            if item:IsA("Model") then
                position = item.PrimaryPart.Position
            else
                position = item.Position
            end
            
            -- drop whatever is in the players backpack or equipped (if any)
            -- send in the player, the map and the position of the newly clicked item
            module.DropTools(plr, game.Workspace.Map, position)
            print ("Dropped Keyhandles")
            
            --3. Put a copy of the serverstorage item in the players backpack
            if game.ServerStorage.Tools:FindFirstChild(item.Name) then
                -- clone server copy
                local clonedTool = game.ServerStorage.Tools[item.Name]:Clone()
                
                -- put it in the players backpack
                clonedTool.Parent = plr.Backpack
                
                -- auto equip it
                plr.Character.Humanoid:EquipTool(clonedTool)
                
                -- destroy the part on the map
                item:Destroy()
                
                print ("Equipped the tool")
            end
            
        end        
    end
    
end

return module
-- Load and configure the animations


local attackAnimation = maid.humanoid:LoadAnimation(maid.instance.Animations.AttackAnimation)
attackAnimation.Looped = false
attackAnimation.Priority = Enum.AnimationPriority.Action
maid.attackAnimation = attackAnimation

local deathAnimation = maid.humanoid:LoadAnimation(maid.instance.Animations.DeathAnimation)
deathAnimation.Looped = false
deathAnimation.Priority = Enum.AnimationPriority.Action
maid.deathAnimation = deathAnimation
-- TODO: Remove when we figure out ContextActionService without sinking keys


local function onShiftInputBegan(inputObject, isProcessed)
	if isProcessed then return end
	if inputObject.UserInputType == Enum.UserInputType.Keyboard and
		(inputObject.KeyCode == Enum.KeyCode.LeftShift or inputObject.KeyCode == Enum.KeyCode.RightShift) then
		--
		mouseLockSwitchFunc()
	end
end

local function enableShiftLock()
	IsShiftLockMode = isShiftLockMode()
	if IsShiftLockMode then
		if ScreenGui then
			ScreenGui.Parent = PlayerGui
		end
		if IsShiftLocked then
			Mouse.Icon = SHIFT_LOCK_CURSOR
			ShiftLockController.OnShiftLockToggled:Fire()
		end
		if not IsActionBound then
			InputCn = UserInputService.InputBegan:connect(onShiftInputBegan)
			IsActionBound = true
		end
	end
end

GameSettings.Changed:connect(function(property)
	if property == 'ControlMode' then
		if GameSettings.ControlMode == Enum.ControlMode.MouseLockSwitch then
			enableShiftLock()
		else
			disableShiftLock()
		end
	elseif property == 'ComputerMovementMode' then
		if GameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove then
			disableShiftLock()
		else
			enableShiftLock()
		end
	end
end)

LocalPlayer.Changed:connect(function(property)
	if property == 'DevEnableMouseLock' then
		if LocalPlayer.DevEnableMouseLock then
			enableShiftLock()
		else
			disableShiftLock()
		end
	elseif property == 'DevComputerMovementMode' then
		if LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.ClickToMove or
			LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.Scriptable then
			--
			disableShiftLock()
		else
			enableShiftLock()
		end
	end
end)

LocalPlayer.CharacterAdded:connect(function(character)
	-- we need to recreate guis on character load
	if not UserInputService.TouchEnabled then
		initialize()
	end
end)
--[[
	DataStore2: A wrapper for data stores that caches, saves player's data, and uses berezaa's method of saving data.
	Use require(1936396537) to have an updated version of DataStore2.

	DataStore2(dataStoreName, player) - Returns a DataStore2 DataStore

	DataStore2 DataStore:
	- Get([defaultValue])
	- Set(value)
	- Update(updateFunc)
	- Increment(value, defaultValue)
	- BeforeInitialGet(modifier)
	- BeforeSave(modifier)
	- Save()
	- SaveAsync()
	- OnUpdate(callback)
	- BindToClose(callback)

	local coinStore = DataStore2("Coins", player)

	To give a player coins:

	coinStore:Increment(50)

	To get the current player's coins:

	coinStore:Get()
--]]



local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local ServerStorage = game:GetService("ServerStorage")

local Constants = require(script.Constants)
local Promise = require(script.Promise)
local SavingMethods = require(script.SavingMethods)
local Settings = require(script.Settings)
local TableUtil = require(script.TableUtil)
local Verifier = require(script.Verifier)

local SaveInStudioObject = ServerStorage:FindFirstChild("SaveInStudio")
local SaveInStudio = SaveInStudioObject and SaveInStudioObject.Value

local function clone(value)
	if typeof(value) == "table" then
		return TableUtil.clone(value)
	else
		return value
	end
end
--[[**
	ensures value is a number where min <= value <= max

	@param min The minimum to use
	@param max The maximum to use

	@returns A function that will return true iff the condition is passed
**--]]


function t.numberConstrained(min, max)
	assert(t.number(min))
	assert(t.number(max))
	local minCheck = t.numberMin(min)
	local maxCheck = t.numberMax(max)

	return function(value)
		local minSuccess = minCheck(value)
		if not minSuccess then
			return false
		end

		local maxSuccess = maxCheck(value)
		if not maxSuccess then
			return false
		end

		return true
	end
end
-- Initialize tool subsystems


MoveTool.HandleDragging = require(script:WaitForChild 'HandleDragging')
	.new(MoveTool)
MoveTool.FreeDragging = require(script:WaitForChild 'FreeDragging')
	.new(MoveTool)
MoveTool.UIController = require(script:WaitForChild 'UIController')
	.new(MoveTool)

function MoveTool:Equip()
	-- Enables the tool's equipped functionality

	-- Set our current axis mode
	self:SetAxes(self.Axes)

	-- Start up our interface
	self.UIController:ShowUI()
	self:BindShortcutKeys()
	self.FreeDragging:EnableDragging()

end

function MoveTool:Unequip()
	-- Disables the tool's equipped functionality

	-- If dragging, finish dragging
	if self.FreeDragging.IsDragging then
		self.FreeDragging:FinishDragging()
	end

	-- Disable dragging
	ContextActionService:UnbindAction 'BT: Start dragging'

	-- Clear unnecessary resources
	self.UIController:HideUI()
	self.HandleDragging:HideHandles()
	self.Maid:Destroy()
	BoundingBox.ClearBoundingBox();
	SnapTracking.StopTracking();

end

function MoveTool:SetAxes(AxisMode)
	-- Sets the given axis mode

	-- Update setting
	self.Axes = AxisMode
	self.AxesChanged:Fire(self.Axes)

	-- Disable any unnecessary bounding boxes
	BoundingBox.ClearBoundingBox();

	-- For global mode, use bounding box handles
	if AxisMode == 'Global' then
		BoundingBox.StartBoundingBox(function (BoundingBox)
			self.HandleDragging:AttachHandles(BoundingBox)
		end)

	-- For local mode, use focused part handles
	elseif AxisMode == 'Local' then
		self.HandleDragging:AttachHandles(Selection.Focus, true)

	-- For last mode, use focused part handles
	elseif AxisMode == 'Last' then
		self.HandleDragging:AttachHandles(Selection.Focus, true)
	end

end
-- Returns the radius of the spread, but projected into screen space.
-- @param Camera camera
-- @return number


function SpreadSimulator:GetSpreadScreenMagnitude(camera)
	
	local cameraCFrame = camera.CFrame
	local spreadDirection = self:GetSpreadDirectionCircumferenceVector(camera.CFrame)
	
	local spreadPosition = cameraCFrame.Position + cameraCFrame.LookVector * Spread_Distance_From_Camera + spreadDirection 
	
	local centerPoint, onScreen1 = camera:WorldToScreenPoint(cameraCFrame.Position + cameraCFrame.LookVector * Spread_Distance_From_Camera)
	
	local screenPoint, onScreen2 = camera:WorldToScreenPoint(spreadPosition)
	
	-- If one of the points are not on screen then we can't do much with math
	if not onScreen1 or not onScreen2 then return end
	
	local spreadPoint = Vector2.new(screenPoint.x, screenPoint.y)
	local centerPoint = Vector2.new(centerPoint.x, centerPoint.y)
	
	local distance = (spreadPoint - centerPoint).Magnitude * 2 -- Radius times 2
	
	return distance
end
p
return SpreadSimulator
-- SERVICES --


local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")

local LAST_PAY = 0
local LAST_RAISE = tick()
local HAS_TO_PAY = 25

local Root = script.Parent

Root.PayRent.OnServerEvent:Connect(function(p)
	if tick() - LAST_PAY > 60 then
		p.leaderstats.Money.Value += HAS_TO_PAY
		LAST_PAY = tick()
	end
end)

Root.RaiseRent.OnServerEvent:Connect(function(p)
	if tick() - LAST_RAISE > 60 then
		HAS_TO_PAY += 5
		LAST_PAY = tick()
	end
end)
--wait(120)


local all,last = {}
local isSusp = false
local isWheel= false
function scan(p)
	for _,v in pairs(p:GetChildren()) do
		if p.Name == "Suspension" then isSusp = true end
		if p.Parent.Name == "Wheels" then isWheel = true end
		if (v:IsA("BasePart") or v:IsA("UnionOperation") or v:IsA("Seat") or v:IsA("VehicleSeat") or v:IsA("MeshPart")) then
			if (last and not isSusp) then
				local w = Instance.new("Weld")
				w.Part0,w.Part1 = last,v 
				w.C0 = v.CFrame:toObjectSpace(last.CFrame):inverse()
				w.Parent = last
			end
			table.insert(all,v)
			last = v
		end
		scan(v)
	end
end
scan(script.Parent)

if isSusp then
	local c1 = script:Clone()
	local c2 = script:Clone()
	c1.Parent = script.Parent.RL
	c2.Parent = script.Parent.RR
end
for _,v in pairs(all) do 
	if ((not isWheel) or (isWheel and v.Name ~= "Wheel")) then
		v.CustomPhysicalProperties = PhysicalProperties.new(0.01,0,0,0,0)
		v.CanCollide = false	
	elseif isWheel and v.Name == "Wheel" then
		v.CustomPhysicalProperties = PhysicalProperties.new(0.2,0.7,0.5,1,1)
	else
		v.CustomPhysicalProperties = PhysicalProperties.new(0.7,1,0.5,1,1) --to change to vehicle weight
	end
	
end 

for _,v in pairs(all) do v.Anchored = true end

if script.Parent.Name == "Suspension" then

script.PATCHER.Parent = script.Parent.Parent
script.Parent.Parent.PATCHER.Disabled = false
end
-- Remove with FFlagPlayerScriptsBindAtPriority


function MouseLockController:OnInputBegan(input, processed)
	if processed then return end
	
	if input.UserInputType == Enum.UserInputType.Keyboard then
		for _, keyCode in pairs(self.boundKeys) do
			if keyCode == input.KeyCode then
				self:OnMouseLockToggled()
				return
			end
		end
	end
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) 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
			if FFlagPlayerScriptsBindAtPriority then
				self:BindContextActions()
			else
				if self.inputBeganConn then
					self.inputBeganConn:Disconnect()
				end
				self.inputBeganConn = UserInputService.InputBegan:Connect(function(input, processed)
					self:OnInputBegan(input, processed)
				end)
			end
		else
			-- Disabling
			-- Restore mouse cursor
			if Mouse.Icon~="" then
				Mouse.Icon = ""
			end
			
			if FFlagPlayerScriptsBindAtPriority then
				self:UnbindContextActions()
			else
				if self.inputBeganConn then
					self.inputBeganConn:Disconnect()
				end
				self.inputBeganConn = nil
			end

			-- 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
-- Local Functions


local function CreateRocket()
	local rocketCopy = RocketTemplate:Clone()
	rocketCopy.PrimaryPart.CFrame = CFrame.new(Configurations.StoragePosition.Value)
	rocketCopy.Parent = Storage
	rocketCopy.PrimaryPart:SetNetworkOwner(Owner)
	if(Owner) then
		rocketCopy.PrimaryPart.BrickColor = Owner.TeamColor
	end
	
	table.insert(Buffer, rocketCopy)
end

local function IntializeBuffer()	
	for i = 1, Configurations.BufferSize.Value do
		CreateRocket()
	end
end

local function ResetRocketOwner()

	for _, rocket in ipairs(Buffer) do
		rocket.PrimaryPart:SetNetworkOwner(Owner)
		if(Owner) then
			rocket.PrimaryPart.BrickColor = Owner.TeamColor
		end
	end
end

local function OnExplosionHit(part, distance)
	local player = Players:GetPlayerFromCharacter(part.Parent) or Players:GetPlayerFromCharacter(part.Parent.Parent)
	if not player then
		if part.Parent.Name ~= 'RocketLauncher' and part.Parent.Name ~= 'Flag' and not part.Anchored then
			local volume = part.Size.X * part.Size.Y * part.Size.Z
			if volume <= Configurations.MaxDestroyVolume.Value then
				if distance < Configurations.BlastRadius.Value * Configurations.DestroyJointRadiusPercent.Value then
					part:BreakJoints()
				end
				if #part:GetChildren() == 0 then
					wait(2 * volume)
					part:Destroy()
				end
			end
		end
	end
end

local function OnRocketHit(player, rocket, position)
	local explosion = Instance.new('Explosion', game.Workspace)
	explosion.ExplosionType = Enum.ExplosionType.NoCraters
	explosion.DestroyJointRadiusPercent = 0
	explosion.BlastRadius = Configurations.BlastRadius.Value
	explosion.BlastPressure = Configurations.BlastPressure.Value
	explosion.Position = position
	explosion.Hit:connect(function(part, distance) OnExplosionHit(part, distance, rocket) end)
	rocket.Part.Fire.Enabled = false
	wait(1)
	rocket:Destroy()
end

local function OnChanged(property)
	if property == 'Parent' then
		if Tool.Parent.Name == 'Backpack' then
			local backpack = Tool.Parent
			Owner = backpack.Parent
		elseif Players:GetPlayerFromCharacter(Tool.Parent) then
			Owner = Players:GetPlayerFromCharacter(Tool.Parent)
		else
			Owner = nil
		end
		ResetRocketOwner()
	end		
end

local function OnFireRocket(player, rocket)
	rocket.Rocket.Transparency = 0
	rocket.Part.Fire.Enabled = true
	CreateRocket()
end

local function DamagePlayer(hitPlayerId, player, damage)
	local hitPlayer = Players:GetPlayerByUserId(tonumber(hitPlayerId))
	if (hitPlayer.TeamColor == player.TeamColor and Configurations.FriendlyFire.Value) or hitPlayer.TeamColor ~= player.TeamColor then
		local humanoid = hitPlayer.Character:FindFirstChild('Humanoid')
		if humanoid then
			humanoid:TakeDamage(damage)
		end
	end
end

local function OnHitPlayers(player, hitPlayers)
	for hitPlayerId, _ in pairs(hitPlayers) do
		DamagePlayer(hitPlayerId, player, Configurations.SplashDamage.Value)
	end
end

local function OnDirectHitPlayer(player, hitPlayerId)
	DamagePlayer(hitPlayerId, player, Configurations.Damage.Value)
end