local plyr = game.Players.LocalPlayer local character plyr.CharacterAdded:Connect(function(c) character = c end) local gui = plyr:WaitForChild("PlayerGui") local ui = gui:WaitForChild("ui") local assetObject = script:WaitForChild("Assets") local assets = {} for a,b in next,assetObject:GetChildren() do assets[b.Name] = b end local teams = game:GetService("Teams") local tS = game:GetService("TweenService") local lighting = game.Lighting function tween(t,s,d,p,o) return tS:Create(o,TweenInfo.new(t,Enum.EasingStyle[s],Enum.EasingDirection[d]),p) end local rep = game.ReplicatedStorage local events = rep:WaitForChild("Events") local event = events:WaitForChild("event") function teamChoose() local chooseUI = assets.teamChoose:Clone() chooseUI.Parent = ui tween(1,"Sine","Out",{Size = 24},lighting.Blur):Play() local finished local workerDown,residentDown = chooseUI.worker.MouseButton1Down:Connect(function() event:FireServer({reason = "changeTeam"; team = teams.Worker}) finished = true end),chooseUI.resident.MouseButton1Down:Connect(function() event:FireServer({reason = "changeTeam"; team = teams.Resident}) finished = true end) repeat wait() until finished tween(0.5,"Sine","Out",{Size = 0},lighting.Blur):Play() workerDown:disconnect() residentDown:disconnect() chooseUI:Destroy() end teamChoose()