My client ability script isnt working!

So my ability system is not working. What it does is that it checks for the player’s selected boots, then looks through a table to find the ability. Then it will require the module script that’s name is similar to the ability. When i switch my selected boots, it still does inf jump when the ability is double jump!

My Script :

local attributes = {
	["Default"] = {
		["Ability"] = "DoubleJump",
	},
	["Developer"] = {
		["Ability"] = "InfJump",
	},
}

local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")

function abilityUse(ability)
	
	require(ability)
	
end

player:WaitForChild("SelectedBoots"):GetPropertyChangedSignal("Value"):Connect(function()
	
	if attributes[player:WaitForChild("SelectedBoots").Value] then
		
		local ability = script[attributes[player:WaitForChild("SelectedBoots").Value].Ability]
		abilityUse(ability)

	end
	
end)

abilityUse(script[attributes[player:WaitForChild("SelectedBoots").Value].Ability])
2 Likes