It's a localscript. It works in test mode, but not online or in a server.
MainButtons = script.Parent.MainButtons
TeamsFrame = script.Parent.Teams
Store = script.Parent.Store
Credits = script.Parent.Credits
PlayGame = MainButtons.PlayGame
-- Open Teams Frame
function onClickedChangeTeam()
if TeamsFrame.Visible == true then
-- TeamsFrame is visible, close it
TeamsFrame:TweenPosition(UDim2.new(0.3,0,1,0), 'Out', 'Sine', 1)
TeamsFrame.Visible = false
elseif Store.Visible == false and Credits.Visible == false then
-- if everything is closed, open it
TeamsFrame.Visible = true
TeamsFrame:TweenPosition(UDim2.new(0.3,0,.35,0), 'Out', 'Sine', 1)
elseif Store.Visible == true or Credits.Visible == true then
-- somethings open
if Store.Visible == true then
--make the store invisible, flashy exit
-- flashy exit
Store.Visible = false
--enter TeamsFrame
TeamsFrame.Visible = true
TeamsFrame:TweenPosition(UDim2.new(0.3,0,.35,0), 'Out', 'Sine', 1)
else
--must be the Credits that are open, eh?
-- flashy exit
Credits.Visible = false
--enter TeamsFrame
TeamsFrame.Visible = true
TeamsFrame:TweenPosition(UDim2.new(0.3,0,.35,0), 'Out', 'Sine', 1)
end
end
end
-- Open Store Frame
function onClickedOpenStore()
if Store.Visible == true then
-- Store is visible, close it
Store:TweenPosition(UDim2.new(0.3,0,1,0), 'Out', 'Sine', 1)
Store.Visible = false
elseif TeamsFrame.Visible == false and Credits.Visible == false then
-- if everything is closed, open it
Store.Visible = true
Store:TweenPosition(UDim2.new(0.3,0,.35,0), 'Out', 'Sine', 1)
elseif TeamsFrame.Visible == true or Credits.Visible == true then
-- somethings open
if TeamsFrame.Visible == true then
--make the store invisible, flashy exit
-- flashy exit
TeamsFrame.Visible = false
--enter TeamsFrame
Store.Visible = true
Store:TweenPosition(UDim2.new(0.3,0,.35,0), 'Out', 'Sine', 1)
else
--must be the Credits that are open, eh?
-- flashy exit
Credits.Visible = false
--enter TeamsFrame
Store.Visible = true
Store:TweenPosition(UDim2.new(0.3,0,.35,0), 'Out', 'Sine', 1)
end
end
end
----
--
MainButtons.ChangeTeam.MouseButton1Click:connect(onClickedChangeTeam)
MainButtons.Store.MouseButton1Click:connect(onClickedOpenStore)
--[[
PLAY SOUND IF HOVER
--]]
function PlaySound()
script.Parent.Select:Play()
end
MainButtons.ChangeTeam.MouseEnter:connect(PlaySound)
MainButtons.Store.MouseEnter:connect(PlaySound)
MainButtons.Credits.MouseEnter:connect(PlaySound)
MainButtons.PlayGame.MouseEnter:connect(PlaySound)

2 comments
try using a normal script then?
Ye, just use a server script