local TeamBut = script.Parent:WaitForChild("TeamButton") local RadioBut = script.Parent:WaitForChild("RadioButton") local SettingsBut = script.Parent:WaitForChild("SettingsButton") local TeamF = script.Parent:WaitForChild("TeamFrame") local RE = game:GetService("ReplicatedStorage"):WaitForChild("TeamChangeE") local SettingsBckg = SettingsBut:WaitForChild("Bckg")
repeat wait() until #TeamF:GetChildren() >= 12 for i, v in pairs(TeamF:GetChildren()) do if v.ClassName == "TextButton" then v.MouseButton1Click:Connect(function() game.ServerStorage.ButtonSFX:Play() if TeamF.Position == UDim2.new(0,75,.146,190) then RE:FireServer(v.Name) end end) end end
TeamBut.MouseButton1Click:Connect(function() game.ServerStorage.Click:Play() if TeamF.Position == UDim2.new(0,-200,.146,190) then TeamF:TweenPosition(UDim2.new(0,75,.146,190),"Out","Back",.4) SettingsBut:TweenPosition(UDim2.new(0,-69,-.044,220),"Out","Back",.375) SettingsBckg:TweenPosition(UDim2.new(0,-185,0,-20),"Out","Back",.375) RadioBut:TweenPosition(UDim2.new(0,-69,.356,220),"Out","Back",.375) elseif TeamF.Position == UDim2.new(0,75,.146,190) then TeamF:TweenPosition(UDim2.new(0,-200,.146,190),"In","Back",.4) SettingsBut:TweenPosition(UDim2.new(0,10,-.044,220),"Out","Back",.375) RadioBut:TweenPosition(UDim2.new(0,10,.356,220),"Out","Back",.375) end end) SettingsBut.MouseButton1Click:Connect(function() game.ServerStorage.Click:Play() if SettingsBckg.Position == UDim2.new(0,-185,0,-20) then TeamF:TweenPosition(UDim2.new(0,-200,.146,190),"In","Back",.4) RadioBut:TweenPosition(UDim2.new(0,-69,.356,220),"Out","Back",.375) TeamBut:TweenPosition(UDim2.new(0,-69,.146,220),"Out","Back",.375) SettingsBckg:TweenPosition(UDim2.new(5.33,-185,0,-20),"Out","Back",.4) elseif SettingsBckg.Position == UDim2.new(5.33,-185,0,-20) then SettingsBckg:TweenPosition(UDim2.new(0,-185,0,-20),"Out","Back",.4) RadioBut:TweenPosition(UDim2.new(0,10,.356,220),"Out","Back",.375) TeamBut:TweenPosition(UDim2.new(0,10,.146,220),"Out","Back",.375) end end)
You cannot access ServerStorage or ServerScriptService from a local script. You should put "Click" in the ReplicatedStorage so that both the client and the sever can access it.