١١:١٧:٢١.٥٦١  
📊 بدء تحليل السكربتات التي أنشأها المطور مع عرض المحتوى 📊  -  Edit - Script:68
  ١١:١٧:٢١.٥٦١  ================================================================================  -  Edit - Script:69
  ١١:١٧:٢١.٥٧٢  
================================================================================  -  Edit - Script:50
  ١١:١٧:٢١.٥٧٢  🔹 اسم السكربت: Script  -  Edit - Script:51
  ١١:١٧:٢١.٥٧٢  📍 المسار: Workspace.StealsBoard.Main.SurfaceGui.MainFrame.ScrollingFrame.Script  -  Edit - Script:52
  ١١:١٧:٢١.٥٧٢  📄 النوع: Script  -  Edit - Script:53
  ١١:١٧:٢١.٥٧٢  🔢 مفعّل: true  -  Edit - Script:54
  ١١:١٧:٢١.٥٧٢  --------------------------------------------------------------------------------  -  Edit - Script:55
  ١١:١٧:٢١.٥٧٣  📝 محتوى السكربت:  -  Edit - Script:56
  ١١:١٧:٢١.٥٧٣  -- True Global Steals Leaderboard Server Script (DataStore-based) - FIXED VERSION
-- Place this script directly IN the ScrollingFrame (script.Parent = ScrollingFrame)

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

-- Configuration
local MAX_PLAYERS = 100
local UPDATE_INTERVAL = 30
local SAVE_INTERVAL = 15 -- Increased from 5 to 15 seconds to reduce DataStore load
local MIN_CHANGE_THRESHOLD = 1 -- Save even on small changes to ensure names are updated
local POSITION_COLORS = {
	[1] = Color3.fromRGB(255, 215, 0),   -- Gold
	[2] = Color3.fromRGB(192, 192, 192), -- Silver  
	[3] = Color3.fromRGB(205, 127, 50),  -- Bronze
}
local DEFAULT_COLOR = Color3.fromRGB(255, 255, 255)

-- DataStore setup
local stealsOrderedStore = DataStoreService:GetOrderedDataStore("GlobalStealsLeaderboard")
local playerDataStore = DataStoreService:GetDataStore("PlayerStealsData")

-- UI references
local scrollingFrame = script.Parent
local template = scrollingFrame:WaitForChild("Template")

-- Cache and state management
local playerTemplates = {}
local isUpdating = false
local lastUpdateTime = 0
local lastSaveTime = 0
local playerStealsCache = {}
local saveQueue = {}
local isSaving = false

-- Optimized number formatting with cached results
local formatCache = {}
local function formatNumber(num)
	num = tonumber(num) or 0

	if formatCache[num] then
		return formatCache[num]
	end

	local result
	if num >= 1000000000000000000 then
		result = string.format("%.1fQ", num / 1000000000000000000)
	elseif num >= 1000000000000000 then
		result = string.format("%.1fQa", num / 1000000000000000)
	elseif num >= 1000000000000 then
		result = string.format("%.1fT", num / 1000000000000)
	elseif num >= 1000000000 then
		result = string.format("%.1fB", num / 1000000000)
	elseif num >= 1000000 then
		result = string.format("%.1fM", num / 1000000)
	elseif num >= 1000 then
		result = string.format("%.1fK", num / 1000)
	else
		result = string.format("%.0f", num)
	end

	formatCache[num] = result
	return result
end

-- Get player steals value efficiently
local function getPlayerSteals(player)
	local leaderstats = player:FindFirstChild("leaderstats")
	if leaderstats then
		local steals = leaderstats:FindFirstChild("Steals")
		return steals and tonumber(steals.Value) or 0
	end
	return 0
end

-- Save player steals to DataStore with throttling
local function savePlayerSteals(player, steals)
	if steals <= 0 then return end

	local userId = player.UserId
	local key = "Player_" .. userId

	-- Add to save queue instead of immediate save
	saveQueue[userId] = {
		player = player,
		steals = steals,
		timestamp = tick()
	}
end

-- Process save queue with throttling
local function processSaveQueue()
	local queueSize = 0
	for _ in pairs(saveQueue) do queueSize = queueSize + 1 end

	if isSaving or queueSize == 0 then return end

	isSaving = true
	local processedCount = 0
	local maxProcessPerBatch = 3 -- Reduced to be more conservative

	for userId, data in pairs(saveQueue) do
		if processedCount >= maxProcessPerBatch then break end

		local player = data.player
		local steals = data.steals

		-- Ensure player is still valid
		if not player or not player.Parent then
			saveQueue[userId] = nil
			continue
		end

		-- Save both datastores together
		task.spawn(function()
			-- Save player info FIRST
			local success1, err1 = pcall(function()
				playerDataStore:SetAsync("Player_" .. userId, {
					UserId = tonumber(userId),
					Username = player.Name,
					DisplayName = player.DisplayName or player.Name,
					LastUpdate = tick()
				})
			end)

			-- Save steals value to OrderedDataStore
			local success2, err2 = pcall(function()
				stealsOrderedStore:SetAsync(userId, steals)
			end)

			if not success1 then
				warn("Failed to save player data for " .. player.Name .. ": " .. tostring(err1))
			end

			if not success2 then
				warn("Failed to save steals value for " .. player.Name .. ": " .. tostring(err2))
			end

			-- Remove from queue after processing
			saveQueue[userId] = nil
		end)

		processedCount = processedCount + 1
		task.wait(0.2) -- Increased delay to be more conservative
	end

	isSaving = false
end

-- Get top players from DataStore (global)
local function getGlobalTopPlayers()
	local success, result = pcall(function()
		return stealsOrderedStore:GetSortedAsync(false, MAX_PLAYERS)
	end)

	if success and result then
		local topPlayers = {}
		local page = result:GetCurrentPage()

		for _, entry in ipairs(page) do
			local userId = tonumber(entry.key)
			local steals = entry.value

			if steals and steals > 0 and userId then
				local username = "Loading..."
				local displayName = ""

				-- Try multiple methods to get the name
				local nameFound = false

				-- Method 1: Check saved data first
				local dataSuccess, savedData = pcall(function()
					return playerDataStore:GetAsync("Player_" .. userId)
				end)

				if dataSuccess and savedData and savedData.Username and savedData.Username ~= "" then
					username = savedData.Username
					displayName = savedData.DisplayName or ""
					nameFound = true
				end

				-- Method 2: Check if player is online
				if not nameFound then
					local livePlayer = Players:GetPlayerByUserId(userId)
					if livePlayer then
						username = livePlayer.Name
						displayName = livePlayer.DisplayName or ""
						nameFound = true

						-- Save their data for next time
						task.spawn(function()
							pcall(function()
								playerDataStore:SetAsync("Player_" .. userId, {
									UserId = userId,
									Username = livePlayer.Name,
									DisplayName = livePlayer.DisplayName or "",
									LastUpdate = tick()
								})
							end)
						end)
					end
				end

				-- Method 3: Use Roblox API (last resort)
				if not nameFound then
					local nameSuccess, nameResult = pcall(function()
						return Players:GetNameFromUserIdAsync(userId)
					end)

					if nameSuccess and nameResult and nameResult ~= "" then
						username = nameResult
						displayName = nameResult
						nameFound = true

						-- Save for next time
						task.spawn(function()
							pcall(function()
								playerDataStore:SetAsync("Player_" .. userId, {
									UserId = userId,
									Username = nameResult,
									DisplayName = nameResult,
									LastUpdate = tick()
								})
							end)
						end)
					end
				end

				-- Final fallback
				if not nameFound then
					username = "Player " .. userId
				end

				table.insert(topPlayers, {
					userId = userId,
					username = username,
					displayName = displayName,
					steals = steals
				})
			end
		end

		return topPlayers
	else
		warn("Failed to get global leaderboard: " .. tostring(result))
		return {}
	end
end

-- Get avatar URL
local function getPlayerAvatarUrl(userId)
	return "rbxthumb://type=AvatarHeadShot&id=" .. userId .. "&w=150&h=150"
end

-- Apply position colors
local function applyPositionColors(templateClone, position)
	local color = POSITION_COLORS[position] or DEFAULT_COLOR

	local elements = {"Value", "NameLabel", "PositionLabel"}
	for _, elementName in ipairs(elements) do
		local element = templateClone:FindFirstChild(elementName)
		if element then
			element.TextColor3 = color
		end
	end

	-- Add golden glow for #1 position
	if position == 1 then
		local avatarImage = templateClone:FindFirstChild("AvatarImage")
		if avatarImage and not avatarImage:FindFirstChild("UIStroke") then
			local uiStroke = Instance.new("UIStroke")
			uiStroke.Color = Color3.fromRGB(255, 215, 0)
			uiStroke.Thickness = 3
			uiStroke.Parent = avatarImage
		end
	end
end

-- Create or update template for global player
local function createOrUpdateGlobalTemplate(playerData, position)
	local userId = playerData.userId
	local templateClone = playerTemplates[userId]

	if not templateClone then
		templateClone = template:Clone()
		templateClone.Name = "GlobalPlayer_" .. userId
		templateClone.Visible = true
		templateClone.Parent = scrollingFrame
		playerTemplates[userId] = templateClone
	end

	templateClone.LayoutOrder = position - 1

	-- Update template elements
	local valueLabel = templateClone:FindFirstChild("Value")
	local avatarImage = templateClone:FindFirstChild("AvatarImage")
	local nameLabel = templateClone:FindFirstChild("NameLabel")
	local positionLabel = templateClone:FindFirstChild("PositionLabel")

	if valueLabel then
		valueLabel.Text = formatNumber(playerData.steals) .. " Steals"
	end

	if avatarImage then
		avatarImage.Image = getPlayerAvatarUrl(userId)
	end

	if nameLabel then
		local displayName = playerData.displayName
		if displayName and displayName ~= "" and displayName ~= playerData.username then
			nameLabel.Text = displayName
		else
			nameLabel.Text = playerData.username
		end
	end

	if positionLabel then
		positionLabel.Text = "#" .. position
	end

	applyPositionColors(templateClone, position)
	return templateClone
end

-- Cleanup unused templates
local function cleanupTemplates(activePlayerIds)
	for userId, templateClone in pairs(playerTemplates) do
		if not activePlayerIds[userId] then
			if templateClone and templateClone.Parent then
				templateClone:Destroy()
			end
			playerTemplates[userId] = nil
		end
	end
end

-- Update global leaderboard from DataStore
local function updateGlobalLeaderboard()
	local currentTime = tick()
	if isUpdating or (currentTime - lastUpdateTime) < UPDATE_INTERVAL then 
		return 
	end

	isUpdating = true
	lastUpdateTime = currentTime

	-- Get global top players from DataStore
	local globalTopPlayers = getGlobalTopPlayers()
	local activePlayerIds = {}

	-- Update templates for global top players
	for position, playerData in ipairs(globalTopPlayers) do
		if playerData.userId then
			activePlayerIds[playerData.userId] = true
			local success, err = pcall(createOrUpdateGlobalTemplate, playerData, position)
			if not success then
				warn("Template update error:", err)
			end
		end
	end

	-- Cleanup unused templates
	cleanupTemplates(activePlayerIds)

	-- Update canvas size
	local listLayout = scrollingFrame:FindFirstChild("UIListLayout")
	if listLayout then
		scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, listLayout.AbsoluteContentSize.Y + 10)
	end

	isUpdating = false
end

-- Save current server players' steals to DataStore with improved throttling
local function saveCurrentServerPlayers()
	local currentTime = tick()
	if (currentTime - lastSaveTime) < SAVE_INTERVAL then
		return
	end

	lastSaveTime = currentTime

	for _, player in pairs(Players:GetPlayers()) do
		if player and player.Parent then
			local steals = getPlayerSteals(player)
			local lastSteals = playerStealsCache[player.UserId] or 0

			-- Only save if steals changed significantly (reduces DataStore calls)
			if math.abs(steals - lastSteals) >= MIN_CHANGE_THRESHOLD then
				playerStealsCache[player.UserId] = steals
				savePlayerSteals(player, steals)
			end
		end
	end

	-- Process the save queue
	task.spawn(processSaveQueue)
end

-- Handle player events
local function onPlayerAdded(player)
	-- IMMEDIATELY save their name data
	task.spawn(function()
		local success, err = pcall(function()
			playerDataStore:SetAsync("Player_" .. player.UserId, {
				UserId = player.UserId,
				Username = player.Name,
				DisplayName = player.DisplayName or player.Name,
				LastUpdate = tick()
			})
		end)
		if not success then
			warn("Failed to save name data for " .. player.Name .. ": " .. tostring(err))
		end
	end)

	-- Save their initial steals after leaderstats loads
	task.spawn(function()
		task.wait(3) -- Wait for leaderstats to load
		local steals = getPlayerSteals(player)
		if steals > 0 then
			savePlayerSteals(player, steals)
		end
	end)

	-- Monitor steals changes
	local leaderstats = player:WaitForChild("leaderstats", 10)
	if leaderstats then
		local stealsValue = leaderstats:WaitForChild("Steals", 5)
		if stealsValue then
			stealsValue.Changed:Connect(function()
				local newSteals = tonumber(stealsValue.Value) or 0
				playerStealsCache[player.UserId] = newSteals
			end)
		end
	end
end

local function onPlayerRemoving(player)
	-- Final save before player leaves
	local steals = getPlayerSteals(player)
	if steals > 0 then
		savePlayerSteals(player, steals)
	end

	-- Clean up cache
	playerStealsCache[player.UserId] = nil

	-- Remove from templates if exists
	if playerTemplates[player.UserId] then
		if playerTemplates[player.UserId].Parent then
			playerTemplates[player.UserId]:Destroy()
		end
		playerTemplates[player.UserId] = nil
	end
end

-- UI setup
local function setupLeaderboardUI()
	template.Visible = false

	local listLayout = scrollingFrame:FindFirstChild("UIListLayout")
	if not listLayout then
		listLayout = Instance.new("UIListLayout")
		listLayout.SortOrder = Enum.SortOrder.LayoutOrder
		listLayout.Padding = UDim.new(0, 8)
		listLayout.FillDirection = Enum.FillDirection.Vertical
		listLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
		listLayout.VerticalAlignment = Enum.VerticalAlignment.Top
		listLayout.Parent = scrollingFrame
	end

	-- Auto canvas sizing
	listLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
		scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, listLayout.AbsoluteContentSize.Y + 10)
	end)
end

-- Main update loops
local function startUpdateLoop()
	while true do
		task.spawn(updateGlobalLeaderboard)
		task.wait(UPDATE_INTERVAL)
	end
end

local function startSaveLoop()
	while true do
		task.spawn(saveCurrentServerPlayers)
		task.wait(SAVE_INTERVAL)
	end
end

-- Event connections
Players.PlayerAdded:Connect(onPlayerAdded)
Players.PlayerRemoving:Connect(onPlayerRemoving)

-- Handle existing players
for _, player in pairs(Players:GetPlayers()) do
	onPlayerAdded(player)
end

-- Initialize
setupLeaderboardUI()

-- Start all systems
task.spawn(function()
	task.wait(5) -- Initial delay for leaderstats to load
	updateGlobalLeaderboard()
	startUpdateLoop()
end)

task.spawn(function()
	task.wait(8) -- Longer initial delay to stagger DataStore requests
	startSaveLoop()
end)  -  Edit - Script:57
  ١١:١٧:٢١.٥٧٣  ================================================================================  -  Edit - Script:58
  ١١:١٧:٢١.٥٧٤  
================================================================================  -  Edit - Script:50
  ١١:١٧:٢١.٥٧٤  🔹 اسم السكربت: Despawn  -  Edit - Script:51
  ١١:١٧:٢١.٥٧٤  📍 المسار: Workspace.DespawnBox.Despawn  -  Edit - Script:52
  ١١:١٧:٢١.٥٧٤  📄 النوع: Script  -  Edit - Script:53
  ١١:١٧:٢١.٥٧٤  🔢 مفعّل: true  -  Edit - Script:54
  ١١:١٧:٢١.٥٧٤  --------------------------------------------------------------------------------  -  Edit - Script:55
  ١١:١٧:٢١.٥٧٤  📝 محتوى السكربت:  -  Edit - Script:56
  ١١:١٧:٢١.٥٧٥  local box = script.Parent

local despawnPart = box:WaitForChild("Despawn")

despawnPart.Touched:Connect(function(otherPart: BasePart)
	local char = otherPart.Parent
	if char and char:HasTag("Character") then
		char:Destroy()
	end
end)  -  Edit - Script:57
  ١١:١٧:٢١.٥٧٥  ================================================================================  -  Edit - Script:58
  ١١:١٧:٢١.٥٨٠  
================================================================================  -  Edit - Script:50
  ١١:١٧:٢١.٥٨٠  🔹 اسم السكربت: BatScript  -  Edit - Script:51
  ١١:١٧:٢١.٥٨٠  📍 المسار: Workspace.SuperBatPurchases.SuperBatPurchase.SuperBat.BatScript  -  Edit - Script:52
  ١١:١٧:٢١.٥٨٠  📄 النوع: Script  -  Edit - Script:53
  ١١:١٧:٢١.٥٨٠  🔢 مفعّل: true  -  Edit - Script:54
  ١١:١٧:٢١.٥٨٠  --------------------------------------------------------------------------------  -  Edit - Script:55
  ١١:١٧:٢١.٥٨٠  📝 محتوى السكربت:  -  Edit - Script:56
  ١١:١٧:٢١.٥٨١  local RS = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local moduleScripts = RS:WaitForChild("ModuleScripts")
local Functions = require(moduleScripts:WaitForChild("Functions"))

local events = RS:WaitForChild("RemoteEvents")
local triggerWhackEvent = events:WaitForChild("TriggerWhack")

Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
local hitbox = Tool:WaitForChild("Hitbox")

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

local BaseUrl = "rbxassetid://"

Players = game:GetService("Players")
Debris = game:GetService("Debris")
RunService = game:GetService("RunService")

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

Sounds = {
	Swing = Handle:WaitForChild("Swing"),
	Hit = Handle:WaitForChild("Hit")
}

ToolEquipped = false

Tool.Enabled = true

local blowCooldown = false

local swinging = false

function Blow(Hit)
	if not swinging then return end
	if not CheckIfAlive() or not ToolEquipped then
		return
	end
	local character = Hit.Parent
	if not character or character == Character then
		return
	end
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	if not humanoid or humanoid.Health == 0 then
		return
	end
	local player = Players:GetPlayerFromCharacter(character)
	if not player then return end
	if blowCooldown then return end
	blowCooldown = true
	Sounds.Hit:Play()
	local rootPart : BasePart = character:FindFirstChild("HumanoidRootPart")
	local RootPart : BasePart = Character:FindFirstChild("HumanoidRootPart")
	if rootPart and RootPart then
		local direction = (rootPart.Position - RootPart.Position) + Vector3.new(0, 7, 0)
		triggerWhackEvent:FireClient(player, direction.Unit, true)
	end
	Functions.ReturnStolenCharacter(player)
end


function Attack()
	swinging = true
	Sounds.Swing:Play()

	if Humanoid then
		if Humanoid.RigType == Enum.HumanoidRigType.R6 then
			local Anim = Instance.new("StringValue")
			Anim.Name = "toolanim"
			Anim.Value = "Slash"
			Anim.Parent = Tool
		elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then
			local Anim = Tool:FindFirstChild("R15Slash")
			if Anim then
				local Track = Humanoid:LoadAnimation(Anim)
				Track:Play(0)
			end
		end
	end	
	wait(0.5)
	swinging = false
	blowCooldown = false
end

Tool.Enabled = true

function Activated()
	if not Tool.Enabled or not ToolEquipped or swinging or not CheckIfAlive() then
		return
	end
	Tool.Enabled = false
	local SlashAnim = (Tool:FindFirstChild("R15Slash") or Create("Animation"){
		Name = "R15Slash",
		AnimationId = BaseUrl .. Animations.R15Slash,
		Parent = Tool
	})
	Attack()
	Tool.Enabled = true
end

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

function Equipped()
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChildOfClass("Humanoid")
	Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart")
	if not CheckIfAlive() then
		return
	end
	ToolEquipped = true
end

function Unequipped()
	ToolEquipped = false
end

Tool.Activated:Connect(Activated)
Tool.Equipped:Connect(Equipped)
Tool.Unequipped:Connect(Unequipped)

hitbox.Touched:Connect(Blow)  -  Edit - Script:57
  ١١:١٧:٢١.٥٨١  ================================================================================  -  Edit - Script:58
  ١١:١٧:٢١.٥٨١  
================================================================================  -  Edit - Script:50
  ١١:١٧:٢١.٥٨١  🔹 اسم السكربت: BatScript  -  Edit - Script:51
  ١١:١٧:٢١.٥٨١  📍 المسار: Workspace.SuperBatPurchases.SuperBatPurchase.SuperBat.BatScript  -  Edit - Script:52
  ١١:١٧:٢١.٥٨١  📄 النوع: Script  -  Edit - Script:53
  ١١:١٧:٢١.٥٨١  🔢 مفعّل: true  -  Edit - Script:54
  ١١:١٧:٢١.٥٨١  --------------------------------------------------------------------------------  -  Edit - Script:55
  ١١:١٧:٢١.٥٨١  📝 محتوى السكربت:  -  Edit - Script:56
  ١١:١٧:٢١.٥٨١  local RS = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local moduleScripts = RS:WaitForChild("ModuleScripts")
local Functions = require(moduleScripts:WaitForChild("Functions"))

local events = RS:WaitForChild("RemoteEvents")
local triggerWhackEvent = events:WaitForChild("TriggerWhack")

Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
local hitbox = Tool:WaitForChild("Hitbox")

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

local BaseUrl = "rbxassetid://"

Players = game:GetService("Players")
Debris = game:GetService("Debris")
RunService = game:GetService("RunService")

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

Sounds = {
	Swing = Handle:WaitForChild("Swing"),
	Hit = Handle:WaitForChild("Hit")
}

ToolEquipped = false

Tool.Enabled = true

local blowCooldown = false

local swinging = false

function Blow(Hit)
	if not swinging then return end
	if not CheckIfAlive() or not ToolEquipped then
		return
	end
	local character = Hit.Parent
	if not character or character == Character then
		return
	end
	local humanoid = character:FindFirstChildOfClass("Humanoid")
	if not humanoid or humanoid.Health == 0 then
		return
	end
	local player = Players:GetPlayerFromCharacter(character)
	if not player then return end
	if blowCooldown then return end
	blowCooldown = true
	Sounds.Hit:Play()
	local rootPart : BasePart = character:FindFirstChild("HumanoidRootPart")
	local RootPart : BasePart = Character:FindFirstChild("HumanoidRootPart")
	if rootPart and RootPart then
		local direction = (rootPart.Position - RootPart.Position) + Vector3.new(0, 7, 0)
		triggerWhackEvent:FireClient(player, direction.Unit, true)
	end
	Functions.ReturnStolenCharacter(player)
end


function Attack()
	swinging = true
	Sounds.Swing:Play()

	if Humanoid then
		if Humanoid.RigType == Enum.HumanoidRigType.R6 then
			local Anim = Instance.new("StringValue")
			Anim.Name = "toolanim"
			Anim.Value = "Slash"
			Anim.Parent = Tool
		elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then
			local Anim = Tool:FindFirstChild("R15Slash")
			if Anim then
				local Track = Humanoid:LoadAnimation(Anim)
				Track:Play(0)
			end
		end
	end	
	wait(0.5)
	swinging = false
	blowCooldown = false
end

Tool.Enabled = true

function Activated()
	if not Tool.Enabled or not ToolEquipped or swinging or not CheckIfAlive() then
		return
	end
	Tool.Enabled = false
	local SlashAnim = (Tool:FindFirstChild("R15Slash") or Create("Animation"){
		Name = "R15Slash",
		AnimationId = BaseUrl .. Animations.R15Slash,
		Parent = Tool
	})
	Attack()
	Tool.Enabled = true
end

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

function Equipped()
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChildOfClass("Humanoid")
	Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart")
	if not CheckIfAlive() then
		return
	end
	ToolEquipped = true
end

function Unequipped()
	ToolEquipped = false
end

Tool.Activated:Connect(Activated)
Tool.Equipped:Connect(Equipped)
Tool.Unequipped:Connect(Unequipped)

hitbox.Touched:Connect(Blow)  -  Edit - Script:57
  ١١:١٧:٢١.٥٨٢  ================================================================================  -  Edit - Script:58
  ١١:١٧:٢١.٥٨٢  
================================================================================  -  Edit - Script:50
  ١١:١٧:٢١.٥٨٢  🔹 اسم السكربت: R6Animate  -  Edit - Script:51
  ١١:١٧:٢١.٥٨٢  📍 المسار: Workspace.WalkspeedPurchases.WalkspeedPurchase.Noob.R6Animate  -  Edit - Script:52
  ١١:١٧:٢١.٥٨٢  📄 النوع: Script  -  Edit - Script:53
  ١١:١٧:٢١.٥٨٢  🔢 مفعّل: true  -  Edit - Script:54
  ١١:١٧:٢١.٥٨٢  --------------------------------------------------------------------------------  -  Edit - Script:55
  ١١:١٧:٢١.٥٨٣  📝 محتوى السكربت:  -  Edit - Script:56
  ١١:١٧:٢١.٥٨٣  -- humanoidAnimatePlayEmote.lua

local Figure = script.Parent
local Torso = Figure:WaitForChild("Torso")
local RightShoulder = Torso:WaitForChild("Right Shoulder")
local LeftShoulder = Torso:WaitForChild("Left Shoulder")
local RightHip = Torso:WaitForChild("Right Hip")
local LeftHip = Torso:WaitForChild("Left Hip")
local Neck = Torso:WaitForChild("Neck")
local Humanoid = Figure:WaitForChild("Humanoid")
local pose = "Running"

local EMOTE_TRANSITION_TIME = 0.1

local userAnimateScaleRunSuccess, userAnimateScaleRunValue = pcall(function() return UserSettings():IsUserFeatureEnabled("UserAnimateScaleRun") end)
local userAnimateScaleRun = userAnimateScaleRunSuccess and userAnimateScaleRunValue

local function getRigScale()
	if userAnimateScaleRun then
		return Figure:GetScale()
	else
		return 1
	end
end

local currentAnim = ""
local currentAnimInstance = nil
local currentAnimTrack = nil
local currentAnimKeyframeHandler = nil
local currentAnimSpeed = 1.0
local animTable = {}
local animNames = {
	walk = 	{ 	
		{ id = "http://www.roblox.com/asset/?id=180426354", weight = 10 } 
	},
	run = 	{
		{ id = "run.xml", weight = 10 } 
	}
}

function configureAnimationSet(name, fileList)
	if (animTable[name] ~= nil) then
		for _, connection in pairs(animTable[name].connections) do
			connection:disconnect()
		end
	end
	animTable[name] = {}
	animTable[name].count = 0
	animTable[name].totalWeight = 0	
	animTable[name].connections = {}

	-- check for config values
	local config = script:FindFirstChild(name)
	if (config ~= nil) then
		--		print("Loading anims " .. name)
		table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
		table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
		local idx = 1
		for _, childPart in pairs(config:GetChildren()) do
			if (childPart:IsA("Animation")) then
				table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
				animTable[name][idx] = {}
				animTable[name][idx].anim = childPart
				local weightObject = childPart:FindFirstChild("Weight")
				if (weightObject == nil) then
					animTable[name][idx].weight = 1
				else
					animTable[name][idx].weight = weightObject.Value
				end
				animTable[name].count = animTable[name].count + 1
				animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
				--			print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
				idx = idx + 1
			end
		end
	end

	-- fallback to defaults
	if (animTable[name].count <= 0) then
		for idx, anim in pairs(fileList) do
			animTable[name][idx] = {}
		

هذا اولا
رتبهم لي عند الارسال