So here is my script,
local GUI = script.Parent
local Button = GUI:WaitForChild("Open/Close")
local TButton = Button.Frame.Frame["N/A"]
local State = "Closed"
local DB = false
Button.MouseButton1Down:Connect(function()
if DB == false then
DB = true
spawn(function()
if State == "Closed" then
State = "Opened"
Button.Frame.Frame:TweenPosition(UDim2.new(0,0,0,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,1,true)
elseif State == "Opened" then
State = "Closed"
Button.Frame.Frame:TweenPosition(UDim2.new(0,0,-1,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quint,1,true)
end
end)
wait(.6)
DB = false
end
end)
local Teams = {
[1]={
Label="Class-D"
},
[2]={
Label="Foundation Personnel"
},
[3]={
Label="Security Department"
},
[4]={
Label="Mobile Task Forces"
},
[5]={
Label="Department of External Affairs"
},
[6]={
Label="Engineering and Technical"
},
[7]={
Label="Ethics Committee"
},
[8]={
Label="Intelligence Agency"
},
[9]={
Label="Internal Security Department"
},
[10]={
Label="Medical Department"
},
[11]={
Label="Rapid Response Team"
},
[12]={
Label="Scientific Department"
},
}
local tindex = Teams[0]
for _,B in pairs(Button.Frame.Frame:GetChildren()) do
if B:IsA("TextButton") then
B.MouseButton1Down:Connect(function()
if B.Name == "Up" then
TButton.Name = tindex + 1 .. ".Label"
TButton.Text = tindex + 1 .. ".Label"
elseif B.Name == "Down" then
TButton.Name = tindex - 1 .. ".Label"
TButton.Text = tindex + 1 .. ".Label"
else
game.ReplicatedStorage.updateTeam:FireServer(B.Name)
end
end)
end
end
It is a team script that should change your teams with the GUI but it does not..
And I am getting the error of:
Players.bt6k.PlayerGui.TeamGUI.LocalScript:72: attempt to perform arithmetic (sub) on nil and number
I am quite new to lua, and was wondering what might cause it?

4 comments
Does not seem to be working...
Does it still error?
Yes. Same exact thing.
i do not know what is wrong.