Im making a gui button that when i click on it, it puts my character in a certain team but if the team is full it will make the button blink and say its already filled, the thing is, when the said team is full, its not doing anything (not even printing the "wut" part). joining the team works and if its full it wont try to add more players than it should.
function OnClicked()
local w = script.Parent.Parent:WaitForChild("Main")
local _Main = require(script.Parent.Parent.Main)
local actual = script.Parent.Parent.Actual
local amount = game.ReplicatedStorage.Role:FindFirstChild(script.Parent.Name)
local color = script.Parent.BackgroundColor3
if actual.Value ~= script.Parent.Name then
if amount.Amount.Value >= amount.Max.Value then --its like this part doesnt exists
print("wut?")
script.Parent.Text = "Already Filled!"
for i= 1,3 do
script.Parent.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
wait(.2)
script.Parent.BackgroundColor3 = Color3.fromRGB(color)
wait(.2)
end
script.Parent.Text = script.Parent.Name
else -- but from here it works
actual.Value = script.Parent.Name
amount.Amount.Value = amount.Amount.Value+1
_Main.Play()
end
end
end
script.Parent.MouseButton1Click:Connect(OnClicked)

4 comments
Amount.Value is less than max value?
well it doesnt print it
ur script is rly confusing u should try arranging it maybe ull find the problem like that
it doesn't print anything after else so yeah