If statement not working

Hey scripters,

I have ran into an issue that I cant seem to figure out how to fix. My goal is when the button is clicked, the name would update in the slot. Instead, it doesn’t do anything at all without any errors.

script.Parent.MouseButton1Up:Connect(function()
	for i, v in pairs(script.Parent.Parent.Parent.Our:GetChildren()) do
		if v:IsA("TextButton") then
			if v.Taken == false then
				v.Taken = true
				print('inside')
				v.Text = script.Parent.Text
				script.Parent:Destroy()
			end
		end
	end
end)

You have to read the value (assuming it is a bool value instance that you are using)

if v.Taken.Value == false then
    v.Taken.Value = true
    print('inside')
	v.Text = script.Parent.Text
	script.Parent:Destroy()
end

Better get used to checking for that … or it will happen all the time … :unamused:

It is a bool and it is set to false

Sorry, I don’t understand what you are saying

Ohhh can’t believe I forgot about that, thank you!

1 Like

lol, wrong string … my bad … and now i have to get to 30 letters

Is this a Server script or a local script?