Movelist GUI not working

I’m trying to make a movelist gui and so far I have been successful but whenever I change my stand the list doesn’t change

This is my script

for i,v in pairs(module.Movesets) do
	if not v.LeftShift or v.RightShift then
		v.LeftShift,v.RightShift = "Sprint","Sprint"
	end
	for i2,v2 in pairs(v) do
		for index,player in pairs(game.Players:GetPlayers()) do
			repeat wait() until player:FindFirstChild("Data") and player:FindFirstChild("Data"):FindFirstChild("Ability")
			local StandName = Stands[player.Data.Ability.Value]
			if i == StandName then
				local UI = player.PlayerGui:WaitForChild("UI")
				local ExampleButton = UI:WaitForChild("Gameplay"):WaitForChild("Moves"):WaitForChild("ExampleButton")
				local ExampleClone = ExampleButton:Clone()
				ExampleClone.Name = v2
				ExampleClone.Key.Text = i2
				ExampleClone.Label.Text = v2
				ExampleClone.Parent = UI:WaitForChild("Gameplay"):WaitForChild("Moves")
				player.Data.Ability.Changed:Connect(function(newVal)
					if i == StandName then
						local UI = player.PlayerGui:WaitForChild("UI")
						local ExampleButton = UI:WaitForChild("Gameplay"):WaitForChild("Moves"):WaitForChild("ExampleButton")
						local ExampleClone = ExampleButton:Clone()
						ExampleClone.Name = v2
						ExampleClone.Key.Text = i2
						ExampleClone.Label.Text = v2
						ExampleClone.Parent = UI:WaitForChild("Gameplay"):WaitForChild("Moves")
					end
				end)
			end
		end
	end
end

If you have ever made one especially for a jojo game please tell me how to fix it.

1 Like

I fixed it. For anyone who wants to know I created the index function into a local function and added it do a character added event and just before that a wait()

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.