How do i make it so you can't equip two items on a gui

in the buy button

Isn’t the buy button in a textlabel, like the last time I saw?

yes

script.Parent = Button and script.Parent.Parent = textlabel… so script.Parent.Parent.Parent is shopframe?

yes

@NotZylon

fixed
local cost = 5
local titleVal = Instance.new("StringValue")
local player = script.Parent.Parent.Parent.Parent.Parent.Parent
if player:WaitForChild("Check")[tostring(script.Parent.Parent.Name)].Value == true then
	script.Parent.Text = "Equip"
end
script.Parent.MouseButton1Down:Connect(function()
	if player.Check[tostring(script.Parent.Parent.Name)].Value == true then
		if script.Parent.Text == "Equip" then
			wait(1)
			script.Parent.Text = "Equipped"
			player.Character:WaitForChild("Head").NameTag.LowerText.Text = script.Parent.Parent.Name
			player.Character:WaitForChild("Head").NameTag.LowerText.TextColor3 = Color3.new(script.Parent.Parent.BackgroundColor3)
			player.Character:WaitForChild("Head").NameTag.LowerText.LocalScript.Disabled = true
			player.EquippedTitle.Value = script.parent.Parent.Name
			wait()
			for i, text in pairs(script.Parent.Parent.Parent:GetChildren()) do local first = text:FindFirstChildOfClass("TextButton") if first then if player:WaitForChild("Check")[tostring(first.Parent.Name)].Value == true then first.Text = "Equip" end
				script.Parent.Text = "Unequip"
			end end
		else
			if script.Parent.Text == "Unequip" then
				wait()
				player.Character:WaitForChild("Head").NameTag.LowerText.Text = "Guest"
				player.Character:WaitForChild("Head").NameTag.LowerText.TextColor3 = Color3.new(218, 218, 218)
				player.Character:WaitForChild("Head").NameTag.LowerText.LocalScript.Disabled = true
				player.EquippedTitle.Value = ""
				script.Parent.Text = "Equip"
			end end
		end
	end)

script.Parent.MouseButton1Click:Connect(function()
	if player.leaderstats.Wins.Value >= cost then
		if player:WaitForChild("Check")[tostring(script.Parent.Parent.Name)].Value == false then
			player.leaderstats.Wins.Value = player.leaderstats.Wins.Value - cost

			wait()
			script.Parent.Text = "Bought"
			titleVal.Name = script.Parent.Parent.Name

			wait()
			script.Parent.Text = "Equip"

			print("You bought this title")
			player.Check[tostring(script.Parent.Parent.Name)].Value = true

		end
	end
end)

ah yes, thanks for your help.

And delete the boolvalue (Equipped). It’s irrelevant.

strange thing is everything works except the tags aren’t the right color, should i make a seperate post about that? Well they are but if ii equip another the colors like mix or something

No. But you can give me edit access so I can check the colours and stuff.

you have edits

Can you exit the scripts, so I can edit the updated versions?

alright

Go into drafts and commit all __

it says this

The Devforum isn’t meant to give people codes it’s to teach what can be tought…

but if i didn’t show the script how would i apply it to my actual script?

I just mean by posting the entire script doesn’t teach anything.

Oh, i guess you have a point

Oh whoops you made the post… Sorry, I thought you made a script for the post maker to use… My bad