Don't mind the messy and useless variables, I'm too lazy I need help, I'm trying to make a :Equipped Animation that whenever:Equipped their walk speed in their humanoid is 0. Whenever its :UnEquipped I want it to make their walk speed normal, but whenever people have bought the 2x Speed game pass for my game, their walk speed will be normal! What I am saying or implying, I want it so it will check if they have the gamepass and their WalkSpeed will be 50 instead of 16.

I didnt make a variable for the MPService, I'll make it later on

Thank you!

local tool = script.Parent
local active = false
local anim = Instance.new("Animation")
local anim2 = Instance.new("Animation")
anim.AnimationId = "rbxassetid://5303291613"
anim2.AnimationId = "rbxassetid://5652791809"
local track
local track2
local gamepassId = 10042655
local player = game.Players.LocalPlayer
tool.Equipped:Connect(function()
	active = true
	track2 = script.Parent.Parent.Humanoid:LoadAnimation(anim2)
	track2.Priority = Enum.AnimationPriority.Action
	track2.Looped = false
	track2:Play()
	script.Parent.Parent.Humanoid.WalkSpeed = 0
end)
tool.Activated:Connect(function()
	track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
	track.Priority = Enum.AnimationPriority.Action
	track.Looped = false
	track:Play()
	
	
end)
tool.Unequipped:Connect(function()
	if track2.IsPlaying == true then track2:Stop()
		player.Character.Humanoid.WalkSpeed = 16
	
	
		end
	end
end)