Roblox/luau_corpus huggingface dataset:
-- init
game.ReplicatedStorage.RE.marketPlace.OnServerEvent:Connect(function(player, name)
	spawn(function()
		local product, class = getAsset(name)
		if not product then
			print("Not product //"..name)
			return
		end
		
		local data = Datastore:GetData(player)
		
		local t = MarketplaceService:UserOwnsGamePassAsync(player.UserId,product.Id)

		if data and table.find(data.Gamepasses or {}, product.Id) then
			return onProductPurchased(player, product.Id) -- already owned
		end
		
		if t then
			return onProductPurchased(player, product.Id) 
		end
		game.ReplicatedStorage.RE.GamepassNotification:FireClient(player)
		if class == "Passes" then
			MarketplaceService:PromptGamePassPurchase(player, product.Id)
		elseif class == "Products" then
			MarketplaceService:PromptProductPurchase(player, product.Id)
		end
	end)
end)



game.Players.PlayerAdded:Connect(function(player)
	local data

	while not Datastore do
		Datastore = shared.Datastore
		wait()
	end

	while not data do
		if not player.Parent then 
			return
		end

		data = Datastore:GetData(player)
		wait(1)
	end

	local gamepasses = data.Gamepasses or {}
	for i, module in pairs(script.Passes:GetChildren()) do
		local pass = getAsset(module.Name)
		local id = pass.Id

		local found = table.find(gamepasses, id)
		if found or MarketplaceService:UserOwnsGamePassAsync(player.UserId, id) then
			if not found then
				table.insert(data.Gamepasses, id)
			end
			if pass.onJoined then
				pass.onJoined(player)
			end

			game.ReplicatedStorage.RE.gamepassUpdate:FireClient(player, getNameFromID(id))
		end
	end
end)
--[[ @brief Copies a table.
     @param t The table to copy.
     @return The copied table.
--]]
function module.ShallowTableCopy(t)
	local s = {};
	for i, v in pairs(t) do
		s[i] = v;
	end
	return s;
end

function module.ArrayCopyOnCondition(t, c)
	local s = {};
	for i, v in pairs(t) do
		if c(v) then
			table.insert(s, v);
		end
	end
	return s;
end

module.ShallowCopy = module.ShallowTableCopy;
-- DONT TOUCH ANYTHING

function ChangeMe(hit)
	if hit.Parent == nil then return end
	if (hit.Parent:findFirstChild("Humanoid") == nil) then return end
	local human = hit.Parent:findFirstChild("Humanoid") 
	local char = hit.Parent
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if (human ~= nil) and debounce == false then
		debounce = true
		originals = char:getChildren()
		for w = 1, #originals do
			if originals[w].className == "CharacterMesh" then
				originals[w]:remove()
			end
		end
		meshes = script:getChildren()
		for y = 1, #meshes do
			copy = meshes[y]:clone()
			copy.Parent = char
		end
	end
	wait(0)
	debounce = true
end

script.Parent.Touched:connect(ChangeMe)
--//Setup//--
local Holder = script.Parent

local Button = Holder.IconButton

local SettingsMenu = Holder.Parent.Parent.SettingMenuHolder
-- organises springs by speed and damping, for batch processing
local springBuckets: {[number]: {[number]: Types.Set<Spring>}} = {}
--Please do not touch anything below unless you know what you're doing

script.Parent.Parent:WaitForChild("CarSeat")
local seat = script.Parent.Parent.CarSeat.Value

function find(i)
	for _,v in pairs(i:GetChildren()) do
		if v.Name == "Hitbox" then v.CanCollide = true end
		find(v)
	end
end

find(seat.Parent)
-- Define the function to open or close the window with gene-alike effect
local function toggleWindow()
	if window.Visible then
		-- Close the window by tweening back to the button position and size
				window.Visible = false
	end
end
--------LEFT DOOR --------

game.Workspace.doorleft.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value)

game.Workspace.doorleft.l43.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l31.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)

game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
--- Sets the command bar visible or not
function Window:SetVisible(visible)
	Gui.Visible = visible

	if visible then
		Entry.TextBox:CaptureFocus()
		self:SetEntryText("")
	else
		Entry.TextBox:ReleaseFocus()
		self.AutoComplete:Hide()
	end
end
--Tweening Size Function
local tweenSize = function(part, duration, direction, goal)
	
	local tween = tweenService:Create(part,
		TweenInfo.new(duration, Enum.EasingStyle.Sine, direction),
		{Size = goal}
	)
	
	tween:Play()
	
	return tween
end
--[=[
	@param name string
	@param inboundMiddleware ServerMiddleware?
	@param outboundMiddleware ServerMiddleware?
	@return RemoteSignal

	Creates a signal that can be used to fire data to the clients
	or receive data from the clients.

	```lua
	local mySignal = serverComm:CreateSignal("MySignal")

	-- Examples of firing in different ways (see docs for RemoteSignal for further info):
	mySignal:Fire(somePlayer, "Hello world")
	mySignal:FireAll("Hi there")
	mySignal:FireExcept(somePlayer, "Hello everyone except " .. somePlayer.Name)
	mySignal:FireFilter(function(player) return player.Team == someCoolTeam end, "Hello cool team")

	-- Example of listening for clients to send data:
	mySignal:Connect(function(player, message)
		print("Got a message from " .. player.Name .. ":", message)
	end)
	```
]=]
function ServerComm:CreateSignal(name: string, inboundMiddleware: Types.ServerMiddleware?, outboundMiddleware: Types.ServerMiddleware?)
	return Comm.CreateSignal(self._instancesFolder, name, inboundMiddleware, outboundMiddleware)
end
--Kills users even if they have a shield

function module:ExecuteBehaviour(brickTouched, character)
	if character:FindFirstChild("Humanoid") ~= nil then
		if character.Humanoid.Health > 0 then
			character.Humanoid.Health = 0
		end
	end
end

return module
--For R15 avatars
Animations = {
	R15Slash = 522635514,
	R15Lunge = 522638767
}

Damage = DamageValues.BaseDamage

Sounds = {
	Slash = Handle:WaitForChild("SwordSlash"),
	Lunge = Handle:WaitForChild("SwordLunge"),
	Unsheath = Handle:WaitForChild("Unsheath")
}

ToolEquipped = false
--------------------------------------------------------------------------------

local Tooltip = {}

function Tooltip:Set(Text: string)
	ChangeId += 1
	
	Frame:WaitForChild("TextLabel").Text = Text
	Frame.GroupTransparency = 1
	Frame.Visible = true
	Tween:Play(Frame, {0.3, "Exponential"}, {GroupTransparency = 0})
	Tween:Play(Frame:WaitForChild("UIStroke"), {0.3, "Exponential"}, {Transparency = 0})
end

function Tooltip:Clear()
	local Id = ChangeId
	
	Tween:Play(Frame:WaitForChild("UIStroke"), {0.3, "Exponential"}, {Transparency = 1})
	Tween:Play(Frame, {0.3, "Exponential"}, {GroupTransparency = 1}).Completed:Once(function()
		if ChangeId == Id then
			Frame.Visible = false
		end
	end)
end

local function GetTooltipPosition(): UDim2
	local MouseLocation = UserInputService:GetMouseLocation()
	local ViewportSize = workspace.CurrentCamera.ViewportSize
	local TooltipSize = Frame:WaitForChild("TextLabel").AbsoluteSize
	
	return UDim2.fromOffset(
		math.clamp(MouseLocation.X + 16, 0, ViewportSize.X - (TooltipSize.X+24)),
		math.clamp(MouseLocation.Y + 16, 0, ViewportSize.Y - (TooltipSize.Y+24))
	)
end
--------------------------CHARACTER CONTROL-------------------------------
local CurrentIgnoreList

local function GetCharacter()
	return Player and Player.Character
end

local function GetTorso()
	local humanoid = findPlayerHumanoid(Player)
	return humanoid and humanoid.RootPart
end

local function getIgnoreList()
	if CurrentIgnoreList then
		return CurrentIgnoreList
	end
	CurrentIgnoreList = {}
	table.insert(CurrentIgnoreList, GetCharacter())
	return CurrentIgnoreList
end
--//R//--
if script.Parent.Gear.Value == -1 then
if carSeat.Throttle == 1 then
carSeat.Parent.Parent.RFW.VS.Throttle = -1
carSeat.Parent.Parent.LFW.VS.Throttle = -1
carSeat.Parent.Parent.RRW.VS.Throttle = -1
carSeat.Parent.Parent.LRW.VS.Throttle = -1	
carSeat.Parent.Parent.RFW.VS.MaxSpeed = 20
carSeat.Parent.Parent.LFW.VS.MaxSpeed = 20
carSeat.Parent.Parent.RRW.VS.MaxSpeed = 20
carSeat.Parent.Parent.LRW.VS.MaxSpeed = 20
else
carSeat.Parent.Parent.RFW.VS.Throttle = 0
carSeat.Parent.Parent.LFW.VS.Throttle = 0
carSeat.Parent.Parent.RRW.VS.Throttle = 0
carSeat.Parent.Parent.LRW.VS.Throttle = 0
carSeat.Parent.Parent.RFW.VS.MaxSpeed = 20
carSeat.Parent.Parent.LFW.VS.MaxSpeed = 20
carSeat.Parent.Parent.RRW.VS.MaxSpeed = 20
carSeat.Parent.Parent.LRW.VS.MaxSpeed = 20
end
	

if carSeat.Throttle == 1 then	
carSeat.Parent.Parent.RRW.VS.Torque = tq.Value/2
carSeat.Parent.Parent.RFW.VS.Torque = tq.Value*2.4
carSeat.Parent.Parent.LRW.VS.Torque = tq.Value/2
carSeat.Parent.Parent.LFW.VS.Torque = tq.Value*2.4
elseif carSeat.Throttle == 0 and carSeat.Steer == 0 then
carSeat.Parent.Parent.RRW.VS.Torque = cst.Value
carSeat.Parent.Parent.RFW.VS.Torque = cst.Value
carSeat.Parent.Parent.LRW.VS.Torque = cst.Value
carSeat.Parent.Parent.LFW.VS.Torque = cst.Value
	end
end
--Let the world load before starting
wait(1)


function Render(Character)

	ViewPort:ClearAllChildren()
	--Render the character
	local Char = instance("Model")
		Char.Name = ""
		Char.Parent = ViewPort
	RenderHumanoid(Character,Char)
end



function module:MakeDupe (Character, V)
	--Handle changes 
	-- These cause disapear
	--Character.DescendantAdded:Connect(Render)
	--Character.DescendantRemoving:Connect(Render)
	
	--Initialize
	
	if (V) then
		ViewPort = V;
		ViewPort.CurrentCamera = Camera;
	end
	
	Render(Character);
	
	local CameraUpdater = RunService.Heartbeat:Connect(function()
		Character = Player.Character;
		if Character:FindFirstChild("HumanoidRootPart") then
			Camera.CFrame =  cf(Character.HumanoidRootPart.CFrame:toWorldSpace(Offset).p, Character.HumanoidRootPart.CFrame.p)
		end
	end)
	
end

return module;
--Handles behaviours
local function characterTouchedBrick(partTouched)
	local behaviours = partTouched:FindFirstChild("Behaviours")
	if behaviours ~= nil then
		behaviours = behaviours:GetChildren()
		for i = 1, #behaviours do
			if behaviours[i].Value == true then
				game.ReplicatedStorage.RemoteEvents.ExecuteBehaviour:FireServer(player.Character, partTouched, behaviours[i].Name)
			end
		end
	end
end
--

run_service.RenderStepped:Connect(function()
	tween_service:Create(bound, info, {Position = UDim2.new(.5, mouse.X / 40, .1,  mouse.Y / 8)}):Play()
end)

frame.MouseEnter:Connect(function()
	inui = true 
end)
	
frame.MouseLeave:Connect(function()
	inui = false 
end)
--[[

Dax,

See the MeleeScript.

]]

local canmelee = true;
local tool = script.Parent;

function onKeyDown(key)
	key:lower();
	if key == "v" then
		if canmelee == false then
			return;
		end

		tool.Melee:play()

		canmelee = false;

		local rgrip = tool.Parent["Right Arm"].RightGrip;

		script.melee.Value = true;

		for i = 1,6 do
			rgrip.C1 = rgrip.C1 * CFrame.fromEulerAnglesXYZ(-0.55,0,0);
			wait();
		end

		wait(0.25);

		for i = 1, 6 do
			rgrip.C1 = rgrip.C1 * CFrame.fromEulerAnglesXYZ(0.55,0,0);
			wait();
		end

		script.melee.Value = false;

		wait(0.5);

		canmelee = true;
	end
end

function onSelect(mouse)
	mouse.KeyDown:connect(onKeyDown);
end


function blow(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	if not humanoid then return end
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
	if humanoid ~= hum and hum ~= nil and game.Players:playerFromCharacter(humanoid.Parent) and game.Players:playerFromCharacter(humanoid.Parent).TeamColor~=cc then
		tagHumanoid(humanoid, vPlayer)
		humanoid:TakeDamage(300)
		wait(1)
		untagHumanoid(humanoid)
	end
end


tool.Equipped:connect(onSelect);
--Activate Function
tool.Activated:connect(function()
	--Activate Function 1
	if not debounce then
		debounce = true
		tool.TimeStopSFX.Playing = true
		tool.TimeStop.Playing = true
		color.Enabled = true
		wait(5)
		tool.TimeResumeSFX.Playing = true
		wait(0.5)
		tool.TimeResume.Playing = true
		wait(1.5)
		color.Enabled = false
		debounce = false
		wait(5)
		debounce = true
	end
end)
-- Change cooldown based on speed
humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function()
    if humanoid.WalkSpeed <= 16 then
        cooldown = defaultcooldown
    else
        cooldown = defaultcooldown / 2
    end
end)
--Core Helicopter Parts--
local body = script.Parent.Body
local myRoot = script.Parent.HumanoidRootPart
local myHuman = script.Parent.Humanoid
while myHuman:GetState() ~= Enum.HumanoidStateType.Physics do
	myHuman:ChangeState(Enum.HumanoidStateType.Physics)
	wait()
end
--[[Weight and CG]]
	Tune.Weight			= 1500		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		3.5		,
	 --[[Length]]		14		}
	Tune.WeightDist		= 100		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= 1		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .1		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- Rear Wheel Density
	Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
	Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]
	
	Tune.AxleSize		= 2			-- Size of structural members (larger = more stable/carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members
--DO NOT DELETE, THIS WILL BREAK THE GUN

function Stick(x, y)
	local W = Instance.new("Weld")
	W.Part0 = x
	W.Part1 = y
	local CJ = CFrame.new(x.Position)
	local C0 = x.CFrame:inverse()*CJ
	local C1 = y.CFrame:inverse()*CJ
	W.C0 = C0
	W.C1 = C1
	W.Parent = x
end

function Get(A)
	if A.ClassName == ("Part") then
		Stick(script.Parent.Handle, A)
		--A.Anchored = false
	else
		local C = A:GetChildren()
		for i=1, #C do
		Get(C[i])
		end
	end
end

function Finale()
	Get(script.Parent)
end

script.Parent.Equipped:connect(Finale)
script.Parent.Unequipped:connect(Finale)
Finale()
-- Remote Functions Client -> Server
	-- Getters
		RF_getPlayerData.OnServerInvoke = function(player)
			local cahced = database.GetCachedProfile(player.UserId) 
			return cahced
		end
		RF_vehicleSpawnRequest.OnServerInvoke = function(player) return vehicles.SpawnPlayerVehicle(player, 1) end
		RF_vehicleRemoveRequest.OnServerInvoke = function(player) return vehicles.RemovePlayerVehicle(player) end
		RF_redeemCode.OnServerInvoke = function(player, code) return twitter.RedeemCode(player, code)  end
		
		-- Weapons
		RF_GetUnlockedWeapons.OnServerInvoke = function(player) return weapons.GetUnlockedWeapons(player)  end
		RF_GetWeaponInfo.OnServerInvoke = function(player, weaponID) return weapons.GetWeaponInfo(player, weaponID) end
		RF_GetEquipedWeapon.OnServerInvoke = function(player) return weapons.GetEquipedWeapon(player) end
		
		RF_EquipWeapon.OnServerInvoke = function(player,weaponID) return weapons.EquipWeapon(player, weaponID) end
		RF_UnEquipWeapon.OnServerInvoke = function(player) return weapons.UnEquipWeapon(player) end
		RF_BuyWeapon.OnServerInvoke = function(player, weaponID) return weapons.BuyWeapon(player, weaponID) end
		-- Bullet
		RF_DamageVehicle.OnServerInvoke = function(player, bullet, hitVehicle) return damageReplicator.ApplyDamageToVehicle(bullet,hitVehicle) end
-- stops all playin anims
module.stopalltracks = function(hum, fold)
	local AnimationTracks = hum:GetPlayingAnimationTracks()
	local Fold =  fold
	
	local tab = {}
	
	if Fold then
		
		--
		for i, track in pairs (Fold:GetDescendants()) do
			if track:IsA('Animation') then
				tab[track.Name] = track.Name
				--table.insert(tab, track.Name)
			end
		end
		
		--print(tab)
		-- action
		for i, v in pairs(hum.Animator:GetPlayingAnimationTracks()) do
			if Fold:FindFirstChild(v.Name) and v.Name == Fold:FindFirstChild(v.Name).Name then
				v:Stop()
				--print("Fold found match: ",v," Table found ->", tab[v])
			end
		end
		
	else
		for i, track in pairs (AnimationTracks) do
			track:Stop()
		end
	end
	

end

module.StopAnim = function(hum,name)
	for i, v in pairs(hum.Animator:GetPlayingAnimationTracks()) do
		if v.Name == name then
			v:Stop()
		end
	end
end

module.LoadTrack = function(hum, anim)
	local animationTrack
	if hum:FindFirstChild("Animator") then
		animationTrack = hum.Animator:LoadAnimation(anim)
	else
		animationTrack = hum:LoadAnimation(anim)
	end
	
	--animationTrack:Play()


	return animationTrack
end

module.play = function(hum, anim)
	local char = hum.Parent
	
	local animationTrack = hum.Animator:LoadAnimation(anim)
	animationTrack:Play()
	
	
	return animationTrack
	
end
--[[
	Manually respawns characters when they die, used because
	Players.CharacterAutoLoads is false so that we can wait to spawn the character
	until their data is fully loaded.
--]]

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

local PlayerObjectsContainer = require(ServerStorage.Source.PlayerObjectsContainer)

local CharacterSpawner = {}

function CharacterSpawner.onPlayerAdded(player: Player)
	local characterLoadedWrapper = PlayerObjectsContainer.getCharacterLoadedWrapper(player)
	task.spawn(function()
		while player:IsDescendantOf(Players) do
			player:LoadCharacter()
			characterLoadedWrapper.died:Wait()
		end
	end)
end

return CharacterSpawner
--[=[
	Connects a handler to a ScriptSignal object.

	```lua
	ScriptSignal:Connect(function(text)
		print(text)
	end)

	ScriptSignal:Fire("Something")
	ScriptSignal:Fire("Something else")

	-- "Something" and then "Something else" are printed
	```

	@param handler (...: any) -> ()
	@return ScriptConnection
	@ignore
]=]
function ScriptSignal:Connect(
	handler: (...any) -> ()
): ScriptConnection

	assert(
		typeof(handler) == 'function',
		"Must be function"
	)

	if self._active ~= true then
		return setmetatable({
			Connected = false,
			_node = nil
		}, ScriptConnection)
	end

	local _head: ScriptConnectionNode? = self._head

	local node: ScriptConnectionNode = {
		_signal = self :: Class,
		_connection = nil,
		_handler = handler,

		_next = _head,
		_prev = nil
	}

	if _head ~= nil then
		_head._prev = node
	end

	self._head = node

	local connection = setmetatable({
		Connected = true,
		_node = node
	}, ScriptConnection)

	node._connection = connection

	return connection :: ScriptConnection
end
--[[Dependencies]]

	local player = game.Players.LocalPlayer
	local mouse = player:GetMouse()
	local UserInputService = game:GetService("UserInputService")
	local bike = script.Parent.Bike.Value
	local _Tune = require(bike.Tuner)
--	1 : Object to check collisions on, 2 : part name to look for.
local newZone = flagZone.new(script.Parent, "Sphere", script.Parent.Hill.Flag, script.Parent.Hill.FlagLowerPoint, 0.1, 30)
-- So in the example above, the door will move thirty times, with a distance of 0.1 every 0.01 seconds.
-- Feel free to mess around with values to try and get the door moving as smoothly as possible.
-- Remember, if the door is say 3 studs wide, you will have to move it 3 studs, like in the example above 0.1 x 30 = 3
	
		wait(1) -- How long the door will remain open

		for i=1, 30 do
				p.CFrame = p.CFrame + Vector3.new(0, 0, -0.1)
				wait(.01) 
				end
-- productKey = "<Player.UserId>_<Number<PurchaseId>>"
local function processReceipt(receiptInfo: receiptInfo)
	local playerProductKey, purchased = `{receiptInfo.PlayerId}_{receiptInfo.PurchaseId}`, false
	local success, errorMessage

	success, errorMessage = pcall(function()
		purchased = purchaseHistoryStore:GetAsync(playerProductKey)
	end)

	assert(success, `Data store error: {errorMessage}`)

	if success and purchased then
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
	
	local success, isPurchaseRecorded = pcall(function()
		return purchaseHistoryStore:UpdateAsync(playerProductKey, function(alreadyPurchased): boolean?
			if alreadyPurchased then return true end

			local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
			if not player then return end

			local success, result = pcall(
				Functions.products[receiptInfo.ProductId], 
				receiptInfo, 
				player
			)

			assert((success and result), `Failed to process a product purchase for ProductId: {receiptInfo.ProductId} Player: {player} Error: {result}`)

			return true
		end)
	end)

	assert(success, 'Failed to process receipt due to data store error.')

	if isPurchaseRecorded then
		return Enum.ProductPurchaseDecision.PurchaseGranted
	end
	return Enum.ProductPurchaseDecision.NotProcessedYet
end

MarketplaceService.ProcessReceipt = processReceipt

return module
--local DataStoreService = game:GetService("DataStoreService") -- The data saving service
--local banSave = DataStoreService:GetDataStore("BannedPlayers") -- Our ban save

local hammer = script.Parent -- The tool
---SG Is  Here---
---Please Dont Change Anything Can Dont Work If You Change--

local Part = script.Parent
Part.Touched:Connect(function(HIT)
	local H = HIT.Parent:FindFirstChild("Humanoid")	
	if H then
		local player = game.Players:GetPlayerFromCharacter(HIT.Parent)	
if player then
	local leaderstats = player:WaitForChild("leaderstats")
	local Currency = leaderstats:WaitForChild("Coins")
	local Selling = leaderstats:WaitForChild("Clicks") 
		if Selling.Value > 0 then
			Currency.Value = Currency.Value + Selling.Value
			Selling.Value = 0
		end
end
end
end)