-
What do you want to achieve?
I am trying to make it so when the player presses the Play button on my Menu GUI they go from the team Lobby to Playing. -
What is the issue?
When the player presses the Play button they do not change to the Playing team and stay on the Lobby team with the current script that I am using.
There isnt any error from it in Output. -
What solutions have you tried so far?
I tried putting the code below into its own script which also did not work.
When trying this solution I recieve this error in Output.
Here is the code that I tried using.
script.Parent.MouseButton1Click:Connect(function(player)
player.Team = game.Teams.Playing
print("Team set to Playing")
end)
Here is the full script.
local TweenService = game:GetService("TweenService")
local TweenSpeed = 1
local Info = TweenInfo.new(TweenSpeed, Enum.EasingStyle.Quad, Enum.EasingDirection.In, 0)
local load = script.Parent.Parent.Parent.Parent.LoadingGui
script.Parent.MouseButton1Click:Connect(function(player)
player.Team = game.Teams.Playing
print("Team set to Playing")
end)
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.Play.PlayScript.Disabled = true
script.Parent.Parent.Rules.PopupScript.Disabled = true
script.Parent.Parent.Settings.PopupScript.Disabled = true
script.Parent.Parent.Shop.PopupScript.Disabled = true
script.Parent.Parent.News.PopupScript.Disabled = true
script.Parent.Parent.Credits.PopupScript.Disabled = true
TweenService:Create(load.MainFrame, Info, {BackgroundTransparency = 0}):Play()
TweenService:Create(load.MainFrame.Image, Info, {ImageTransparency = 0}):Play()
TweenService:Create(load.MainFrame.TextLabel, Info, {TextTransparency = 0}):Play()
TweenService:Create(load.MainFrame.BarHold, Info, {BackgroundTransparency = 0}):Play()
TweenService:Create(load.MainFrame.BarHold.Bar, Info, {BackgroundTransparency = 0}):Play()
load.Preload.Disabled = false
end)