Roblox/luau_corpus huggingface dataset:
--//=================================\\
--|| SAZERENOS' ARTIFICIAL HEARTBEAT
--\\=================================//

ArtificialHB = Instance.new("BindableEvent", script)
ArtificialHB.Name = "ArtificialHB"

script:WaitForChild("ArtificialHB")

frame = 1/60
tf = 0
allowframeloss = false
tossremainder = false
lastframe = tick()
script.ArtificialHB:Fire()

game:GetService("RunService").Heartbeat:connect(function(s, p)
	tf = tf + s
	if tf >= frame then
		if allowframeloss then
			script.ArtificialHB:Fire()
			lastframe = tick()
		else
			for i = 1, math.floor(tf / frame) do
				script.ArtificialHB:Fire()
			end
		lastframe = tick()
		end
		if tossremainder then
			tf = 0
		else
			tf = tf - frame * math.floor(tf / frame)
		end
	end
end)

function PositiveAngle(NUMBER)
	if NUMBER >= 0 then
		NUMBER = 0
	end
	return NUMBER
end

function NegativeAngle(NUMBER)
	if NUMBER <= 0 then
		NUMBER = 0
	end
	return NUMBER
end

function Swait(NUMBER)
	if NUMBER == 0 or NUMBER == nil then
		ArtificialHB.Event:wait()
	else
		for i = 1, NUMBER do
			ArtificialHB.Event:wait()
		end
	end
end
--[[
Returns the exact decimal representation of double converted to decimal in array of table
with the length and scale by the power of ten
]]
function DoubleToDecimalConverter.ToExact(value: number): ({ number }?, number?, number?)
	value = tonumber(value)
	if not value then
		error("Argument #2 provided must be a number", 2)
	end
	value = math.abs(value)

	if value ~= value or value == 0 or value == math.huge then
		return nil, nil, nil
	end
	
	return bignum_dtoa(value, true)
end

return DoubleToDecimalConverter
--[[
	* Copyright (c) Roblox Corporation. All rights reserved.
	* Licensed under the MIT License (the "License");
	* you may not use this file except in compliance with the License.
	* You may obtain a copy of the License at
	*
	*     https://opensource.org/licenses/MIT
	*
	* Unless required by applicable law or agreed to in writing, software
	* distributed under the License is distributed on an "AS IS" BASIS,
	* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	* See the License for the specific language governing permissions and
	* limitations under the License.
]]
local Array = script.Parent.Parent
local Packages = Array.Parent.Parent
local types = require(Packages.ES7Types)
type Object = types.Object
type Array<T> = types.Array<T>
type Set<T> = types.Set<T>
type mapFn<T, U> = (element: T, index: number) -> U
type mapFnWithThisArg<T, U> = (thisArg: any, element: T, index: number) -> U

return function<T, U>(
	value: Set<T>,
	mapFn: (mapFn<T, U> | mapFnWithThisArg<T, U>)?,
	thisArg: Object?
	-- FIXME Luau: need overloading so the return type on this is more sane and doesn't require manual casts
): Array<U> | Array<T> | Array<string>
	local array = {}

	if mapFn then
		array = {}
		for i, v in value :: any do
			if thisArg ~= nil then
				(array :: Array<U>)[i] = (mapFn :: mapFnWithThisArg<T, U>)(thisArg, v, i)
			else
				(array :: Array<U>)[i] = (mapFn :: mapFn<T, U>)(v, i)
			end
		end
	else
		array = table.clone((value :: any)._array)
	end

	return array
end
--////////////////////////////////////////////////////////////////////////////////////////////
--///////////////////////////////////////////////// Code to hook client UI up to server events
--////////////////////////////////////////////////////////////////////////////////////////////

function DoChatBarFocus()
	if (not ChatWindow:GetCoreGuiEnabled()) then return end
	if (not ChatBar:GetEnabled()) then return end

	if (not ChatBar:IsFocused() and ChatBar:GetVisible()) then
		moduleApiTable:SetVisible(true)
		InstantFadeIn()
		ChatBar:CaptureFocus()
		moduleApiTable.ChatBarFocusChanged:fire(true)
	end
end

chatBarFocusChanged.Event:connect(function(focused)
	moduleApiTable.ChatBarFocusChanged:fire(focused)
end)

function DoSwitchCurrentChannel(targetChannel)
	if (ChatWindow:GetChannel(targetChannel)) then
		ChatWindow:SwitchCurrentChannel(targetChannel)
	end
end

function SendMessageToSelfInTargetChannel(message, channelName, extraData)
	local channelObj = ChatWindow:GetChannel(channelName)
	if (channelObj) then
		local messageData =
		{
			ID = -1,
			FromSpeaker = nil,
			SpeakerUserId = 0,
			OriginalChannel = channelName,
			IsFiltered = true,
			MessageLength = string.len(message),
			Message = trimTrailingSpaces(message),
			MessageType = ChatConstants.MessageTypeSystem,
			Time = os.time(),
			ExtraData = extraData,
		}

		channelObj:AddMessageToChannel(messageData)
	end
end

function chatBarFocused()
	if (not mouseIsInWindow) then
		DoBackgroundFadeIn()
		if (textIsFaded) then
			DoTextFadeIn()
		end
	end

	chatBarFocusChanged:Fire(true)
end
--	====================
--	SHOTGUN
--	Enable the gun to fire multiple bullet in one shot
--	====================

		ShotgunEnabled = false;
		BulletPerShot = 8;
		
		ShotgunReload = false; --Make user reloading like Shotgun, which user clipin shell one by one
		ShotgunClipinAnimationID = nil; --Set to "nil" if you don't want to animate
		ShotgunClipinAnimationSpeed = 1;
		ShellClipinSpeed = 0.5; --In second
--// Firemode Settings
	CanSelectFire = false;
	BurstEnabled = false;
	SemiEnabled = false;
	AutoEnabled = false;
	BoltAction = false;
	ExplosiveEnabled = false;
--[[ Constants ]]--
local DPAD_SHEET = "rbxasset://textures/ui/DPadSheet.png"
local COMPASS_DIR = {
	Vector3.new(1, 0, 0),			-- E
	Vector3.new(1, 0, 1).unit,		-- SE
	Vector3.new(0, 0, 1),			-- S
	Vector3.new(-1, 0, 1).unit,		-- SW
	Vector3.new(-1, 0, 0),			-- W
	Vector3.new(-1, 0, -1).unit,	-- NW
	Vector3.new(0, 0, -1),			-- N
	Vector3.new(1, 0, -1).unit,		-- NE
}
--[[

	LOWGames Studios
	Date: 27 October 2022
	by Elder
	
]]--

local u1 = nil;
coroutine.wrap(function()
	u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
end)();
return function(p1, p2)
	if not p1 then
		return u1.Print("1st argument is blank or nil", true);
	end;
	if not p2 then
		return u1.Print("2nd argument is blank or nil", true);
	end;
	if type(p1) == "userdata" then
		p1 = p1:GetChildren();
	end;
	for v1, v2 in ipairs(p1) do
		if p2(v2) then
			return v2;
		end;
	end;
end;
--[[
	Instance references
]]

local maid = Maid.new()
maid.instance = script.Parent

maid.humanoid = maid.instance:WaitForChild("Humanoid")
maid.head = maid.instance:WaitForChild("Head")
maid.humanoidRootPart = maid.instance:FindFirstChild("HumanoidRootPart")
maid.alignOrientation = maid.humanoidRootPart:FindFirstChild("AlignOrientation")
--// Things in the blacklist appear to not work under a normal security level
--// About could work but apparently no window was included for about :(

local IntroFrame = Gui:WaitForChild("IntroFrame")

local SideMenu = Gui:WaitForChild("SideMenu")
local OpenToggleButton = Gui:WaitForChild("Toggle")
local CloseToggleButton = SideMenu:WaitForChild("Toggle")
local OpenScriptEditorButton = SideMenu:WaitForChild("OpenScriptEditor")

local ScriptEditor = Gui:WaitForChild("ScriptEditor")

local SlideOut = SideMenu:WaitForChild("SlideOut")
local SlideFrame = SlideOut:WaitForChild("SlideFrame")
local Slant = SideMenu:WaitForChild("Slant")

local ExplorerButton = SlideFrame:WaitForChild("Explorer")
local SettingsButton = SlideFrame:WaitForChild("Settings")

local SelectionBox = Instance.new("SelectionBox")
SelectionBox.Parent = Gui

local ExplorerPanel = Gui:WaitForChild("ExplorerPanel")
local PropertiesFrame = Gui:WaitForChild("PropertiesFrame")
local SaveMapWindow = Gui:WaitForChild("SaveMapWindow")
local RemoteDebugWindow = Gui:WaitForChild("RemoteDebugWindow")

local SettingsPanel = Gui:WaitForChild("SettingsPanel")
local SettingsListener = SettingsPanel:WaitForChild("GetSetting")
local SettingTemplate = SettingsPanel:WaitForChild("SettingTemplate")
local SettingList = SettingsPanel:WaitForChild("SettingList")

local SaveMapCopyList = SaveMapWindow:WaitForChild("CopyList")
local SaveMapSettingFrame = SaveMapWindow:WaitForChild("MapSettings")
local SaveMapName = SaveMapWindow:WaitForChild("FileName")
local SaveMapButton = SaveMapWindow:WaitForChild("Save")
local SaveMapCopyTemplate = SaveMapWindow:WaitForChild("Entry")
local SaveMapSettings = {
	CopyWhat = {
		Workspace = true,
		Lighting = true,
		ReplicatedStorage = true,
		ReplicatedFirst = true,
		StarterPack = true,
		StarterGui = true,
		StarterPlayer = true
	},
	SaveScripts = true,
	SaveTerrain = true,
	LightingProperties = true,
	CameraInstances = true
}

local Love = IntroFrame:WaitForChild("Love")

local LoveQuotes = {
	"Inspect, our love knows no bounds",
	"Inspect, I will always be there for you",
	"Inspect, nothing is more powerful than our relationship",
	"Inspect, I always think about you when you get depressed",
	"Inspect, you will always have a special place in my heart"
}

Love.Text = LoveQuotes[math.random(1,#LoveQuotes)]
-- regular lua compatibility
local typeof = typeof or type

local function primitive(typeName)
	return function(value)
		local valueType = typeof(value)
		if valueType == typeName then
			return true
		else
			return false, string.format("%s expected, got %s", typeName, valueType)
		end
	end
end

local t = {}
-- Listener variables and events
local events = ReplicatedStorage.Events
local roundEnd = events.RoundEnd
local roundStart = events.RoundStart
-- Decompiled with the Synapse X Luau decompiler.

return {
	Sounds = {
		Dirt = 178054124, 
		Wood = 177940988, 
		Concrete = 277067660, 
		Grass = 4776173570, 
		Metal = 4790537991, 
		Sand = 4777003964, 
		Fabric = 4776951843, 
		Gravel = 4776998555, 
		Marble = 4776962643
	}, 
	MaterialMap = {
		Mud = "Dirt", 
		Pebble = "Dirt", 
		Ground = "Dirt", 
		Sand = "Sand", 
		Snow = "Sand", 
		Sandstone = "Sand", 
		Rock = "Gravel", 
		Basalt = "Gravel", 
		Asphalt = "Gravel", 
		Glacier = "Gravel", 
		Slate = "Gravel", 
		WoodPlanks = "Wood", 
		LeafyGrass = "Grass", 
		Ice = "Marble", 
		Salt = "Marble", 
		Marble = "Marble", 
		Pavement = "Marble", 
		Limestone = "Marble", 
		Foil = "Metal", 
		DiamondPlate = "Metal", 
		CorrodedMetal = "Metal"
	}, 
	RotationFactors = {
		Head = {
			Pitch = 0.8, 
			Yaw = 0.75
		}, 
		UpperTorso = {
			Pitch = 0.5, 
			Yaw = 0.5
		}, 
		LeftUpperArm = {
			Pitch = 0, 
			Yaw = -0.5
		}, 
		RightUpperArm = {
			Pitch = 0, 
			Yaw = -0.5
		}, 
		Torso = {
			Pitch = 0.4, 
			Yaw = 0.2
		}, 
		["Left Arm"] = {
			Pitch = 0, 
			Yaw = -0.5
		}, 
		["Right Arm"] = {
			Pitch = 0, 
			Yaw = -0.5
		}, 
		["Left Leg"] = {
			Pitch = 0, 
			Yaw = -0.2
		}, 
		["Right Leg"] = {
			Pitch = 0, 
			Yaw = -0.2
		}
	}
};
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------
	,VRecoil = {14,18}				--- Vertical Recoil
	,HRecoil = {6,9}				--- Horizontal Recoil
	,AimRecover = 1					---- Between 0 & 1
	
	,RecoilPunch = .35
	,VPunchBase = 6					--- Vertical Punch
	,HPunchBase = 2					--- Horizontal Punch
	,DPunchBase = 1 				--- Tilt Punch | useless
	
	,AimRecoilReduction = 1 		--- Recoil Reduction Factor While Aiming (Do not set to 0)
	,PunchRecover = 0.2
	,MinRecoilPower = 1
	,MaxRecoilPower = 3
	,RecoilPowerStepAmount = .5
	
	,MinSpread = 4					--- Min bullet spread value | Studs
	,MaxSpread = 40					--- Max bullet spread value | Studs
	,AimInaccuracyStepAmount = 2.5
	,WalkMultiplier = 0				--- Bullet spread based on player speed

	,SwayBase = 0.01				--- Weapon Base Sway | Studs
	,MaxSway =	1					--- Max sway value based on player stamina | Studs
-- Gyroscopic controller for mobile device (if enabled)
if UseGyroSteering.Value == true and UserInputService.TouchEnabled == true and UserInputService.GyroscopeEnabled == true then
--		print("Wha " .. pose)
		amplitude = 0.1
		frequency = 1
		setAngles = true
	end

	if (setAngles) then
		desiredAngle = amplitude * math.sin(time * frequency)

		RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
		LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
		RightHip:SetDesiredAngle(-desiredAngle)
		LeftHip:SetDesiredAngle(-desiredAngle)
	end

	-- Tool Animation handling
	local tool = getTool()
	if tool then
	
		animStringValueObject = getToolAnim(tool)

		if animStringValueObject then
			toolAnim = animStringValueObject.Value
			-- message recieved, delete StringValue
			animStringValueObject.Parent = nil
			toolAnimTime = time + .3
		end

		if time > toolAnimTime then
			toolAnimTime = 0
			toolAnim = "None"
		end

		animateTool()		
	else
		stopToolAnimations()
		toolAnim = "None"
		toolAnimTime = 0
	end
end
--[[
	Function called when the client is notified of a player state update.
]]
function UIController.onClientStateUpdated(currentState)
	if currentState == "pregame" then
		UIController.setView("pregame")
	elseif currentState == "warmup" then
		UIController.setView("warmup")
	elseif currentState == "game" then
		UIController.setView("game")
	elseif currentState == "spectating" then
		UIController.setView("spectating")
	elseif currentState == "finished" then
		UIController.setView("finished")
	elseif currentState == "dead" then
		UIController.setView("dead")
	elseif currentState == "postgame" then
		UIController.setView("postGame")
	end
end
--set color
function Color:SetColor(color : Color3)
	local hue,saturation,value = color:ToHSV()
	self.Color = color
	
	local wheelSize = self.Instance.Wheel.Image.AbsoluteSize
	local wheelMidPos = (wheelSize / 2)
	local maxDist = (wheelSize.X / 2)
	
	local vector = Vector2.new(0.5,0.5)
	
	local hueVector = Vector2.new(-1,0)
	hueVector = rotateVector(hueVector,hue * -360)
	hueVector = rotateVector(hueVector,180)
	
	vector -= hueVector * saturation * 0.5
	self.Instance.Wheel.Image.Select.Position = UDim2.fromScale(vector.X,vector.Y)
	self.Instance.Right.Value.Select.Position = UDim2.new(0,0,1 - value,0)
	
	self:UpdateColor()
	self:SetValueGradient(hue,saturation)
end

return Color
----------------------------------------------------------------------------------------------------
-------------------=[ PROJETIL ]=-------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
	,Distance = 10000
	,BDrop = .25
	,BSpeed = 2200

	,SuppressMaxDistance = 25	--- Studs
	,SuppressTime = 10			--- Seconds

	,BulletWhiz = true
	,BWEmitter = 25
	,BWMaxDistance = 200
	
	,BulletFlare = false
	,BulletFlareColor = Color3.fromRGB(255,255,255)

	,Tracer = true
	,TracerColor = Color3.fromRGB(255,255,255)
	,TracerLightEmission = 1
	,TracerLightInfluence = 0
	,TracerLifeTime = .2
	,TracerWidth = .1
	,RandomTracer = false
	,TracerEveryXShots = 5
	,TracerChance = 100
	
	,BulletLight = false
	,BulletLightBrightness = 1
	,BulletLightColor = Color3.fromRGB(255,255,255)
	,BulletLightRange = 10

	,ExplosiveHit = false
	,ExPressure = 500
	,ExpRadius = 25
	,DestroyJointRadiusPercent = 0	--- Between 0 & 1
	,ExplosionDamage = 100

	,LauncherDamage = 100
	,LauncherRadius = 25
	,LauncherPressure = 500
	,LauncherDestroyJointRadiusPercent = 0
-- Objects
local plr = playerService.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()
local settingsDir = script.Settings

function getSetting (name)
	return settingsDir and settingsDir:FindFirstChild(name) and settingsDir[name].Value
end

local normalSpeed = getSetting("Walking speed") or 18 -- The player's walking speed (Roblox default is 16)
local sprintSpeed = getSetting("Running speed") or 26 -- The player's speed while sprinting
local sprinting = false

inputService.InputBegan:Connect(function (key)
	if char.Humanoid.WalkSpeed == 0 then return end
	if key.KeyCode == Enum.KeyCode.LeftShift or key.KeyCode == Enum.KeyCode.RightShift then
		running = true
		if char:FindFirstChild("Humanoid") then	
			char.Humanoid.WalkSpeed = sprintSpeed
		end
	end
end)

inputService.InputEnded:Connect(function (key)
	if char.Humanoid.WalkSpeed == 0 then return end
	if key.KeyCode == Enum.KeyCode.LeftShift or key.KeyCode == Enum.KeyCode.RightShift then
		running = false
		if char:FindFirstChild("Humanoid") then	
			char.Humanoid.WalkSpeed = normalSpeed
		end
	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	= 9000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- 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		= false			-- 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
--// Damage Settings	
	BaseDamage = 35; -- Torso Damage
	LimbDamage = 25; -- Arms and Legs
	ArmorDamage = 20; -- How much damage is dealt against armor (Name the armor "Armor")
	HeadDamage = 1000; -- If you set this to 100, there's a chance the player won't die because of the heal script
--[[ Constants ]]--
local ZERO_VECTOR3 = Vector3.new(0,0,0)
local USE_STACKING_TRANSPARENCY = true	-- Multiple items between the subject and camera get transparency values that add up to TARGET_TRANSPARENCY
local TARGET_TRANSPARENCY = 0.75 -- Classic Invisicam's Value, also used by new invisicam for parts hit by head and torso rays
local TARGET_TRANSPARENCY_PERIPHERAL = 0.5 -- Used by new SMART_CIRCLE mode for items not hit by head and torso rays

local MODE = {
	--CUSTOM = 1, 		-- Retired, unused
	LIMBS = 2, 			-- Track limbs
	MOVEMENT = 3, 		-- Track movement
	CORNERS = 4, 		-- Char model corners
	CIRCLE1 = 5, 		-- Circle of casts around character
	CIRCLE2 = 6, 		-- Circle of casts around character, camera relative
	LIMBMOVE = 7, 		-- LIMBS mode + MOVEMENT mode
	SMART_CIRCLE = 8, 	-- More sample points on and around character
	CHAR_OUTLINE = 9,	-- Dynamic outline around the character
}

local LIMB_TRACKING_SET = {
	-- Body parts common to R15 and R6
	['Head'] = true,

	-- Body parts unique to R6
	['Left Arm'] = true,
	['Right Arm'] = true,
	['Left Leg'] = true,
	['Right Leg'] = true,

	-- Body parts unique to R15
	['LeftLowerArm'] = true,
	['RightLowerArm'] = true,
	['LeftUpperLeg'] = true,
	['RightUpperLeg'] = true
}

local CORNER_FACTORS = {
	Vector3.new(1,1,-1),
	Vector3.new(1,-1,-1),
	Vector3.new(-1,-1,-1),
	Vector3.new(-1,1,-1)
}

local CIRCLE_CASTS = 10
local MOVE_CASTS = 3
local SMART_CIRCLE_CASTS = 24
local SMART_CIRCLE_INCREMENT = 2.0 * math.pi / SMART_CIRCLE_CASTS
local CHAR_OUTLINE_CASTS = 24
--// Events
local L_105_ = L_20_:WaitForChild('Equipped')
local L_106_ = L_20_:WaitForChild('ShootEvent')
local L_107_ = L_20_:WaitForChild('DamageEvent')
local L_108_ = L_20_:WaitForChild('CreateOwner')
local L_109_ = L_20_:WaitForChild('Stance')
local L_110_ = L_20_:WaitForChild('HitEvent')
local L_111_ = L_20_:WaitForChild('KillEvent')
local L_112_ = L_20_:WaitForChild('AimEvent')
local L_113_ = L_20_:WaitForChild('ExploEvent')
local L_114_ = L_20_:WaitForChild('AttachEvent')
local L_115_ = L_20_:WaitForChild('ServerFXEvent')
local L_116_ = L_20_:WaitForChild('ChangeIDEvent')
--- FUNCTIONS ---

frame:WaitForChild("Paper").MouseEnter:Connect(function()
	connection = frame.Paper.MouseLeave:Connect(function()
		connection:Disconnect()
		tween:Create(frame.Paper, TweenInfo.new(1), {Position = UDim2.new(0.5,0,2,0)}):Play()
		tween:Create(frame.Paper, TweenInfo.new(1), {BackgroundTransparency = 1}):Play()
		tween:Create(frame.Paper, TweenInfo.new(1), {ImageTransparency = 1}):Play()
		
		task.wait(1)
		frame.Paper:ClearAllChildren()
	end)
end)
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------

Collapse.OnServerEvent:Connect(function(player)

	local Human = player.Character.Humanoid
	local Dor = Human.Parent.Saude.Variaveis.Dor
	local Sangue = Human.Parent.Saude.Variaveis.Sangue
	local IsWounded = Human.Parent.Saude.Stances.Caido


	if (Sangue.Value <= 3500) or (Dor.Value >= 200)  or (IsWounded.Value == true) then -- Man this Guy's Really wounded,
		IsWounded.Value = true
		Human.PlatformStand = true
		Human.AutoRotate = false	
	elseif (Sangue.Value > 3500) and (Dor.Value < 200) and (IsWounded.Value == false) then -- YAY A MEDIC ARRIVED! =D
		Human.PlatformStand = false
		IsWounded.Value = false
		Human.AutoRotate = true	
		
	end
end)

Reset.OnServerEvent:Connect(function(player)

local Human = player.Character.Humanoid
local target = Human.Parent.Saude.Variaveis.PlayerSelecionado

target.Value = "N/A"
end)
--run this first so if there is a 'white' team it is switched over
if not Settings['AutoAssignTeams'] then
	local teamHire = Instance.new('Team', Teams)
	teamHire.TeamColor = BC.new('White')
	teamHire.Name = "For Hire"
end

for i,v in pairs(script.Parent:WaitForChild('Tycoons'):GetChildren()) do
	Tycoons[v.Name] = v:Clone() -- Store the tycoons then make teams depending on the tycoon names
	if returnColorTaken(v.TeamColor) then
		--//Handle duplicate team colors
		local newColor;
		repeat
			wait()
			newColor = BC.Random()
		until returnColorTaken(newColor) == false
		v.TeamColor.Value = newColor
	end
	--Now that there are for sure no duplicates, make your teams
	local NewTeam = Instance.new('Team',Teams)
	NewTeam.Name = v.Name
	NewTeam.TeamColor = v.TeamColor.Value
	if not Settings['AutoAssignTeams'] then
		NewTeam.AutoAssignable = false
	end
	v.PurchaseHandler.Disabled = false
end

function getPlrTycoon(player)
	for i,v in pairs(script.Parent.Tycoons:GetChildren()) do
		if v:IsA("Model") then
			if v.Owner.Value == player then
				return v
			end
		end
	end
	return nil
end

game.Players.PlayerRemoving:connect(function(player)
	local plrStats = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
	if plrStats ~= nil then
		plrStats:Destroy()
	end
	local tycoon = getPlrTycoon(player)
	if tycoon then
		local backup = Tycoons[tycoon.Name]:Clone()
		tycoon:Destroy()
		wait()
		backup.Parent=script.Parent.Tycoons
	end
end)
--- Defense
   Defense.Value = Defense1:GetAsync(Plr.UserId) or Defense.Value
	   Defense1:SetAsync(Plr.UserId, Defense.Value)
      Defense.Changed:connect(function()
	   Defense1:SetAsync(Plr.UserId, Defense.Value)
   end)