Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

My team changing gui script wont work, am I even close?

Everything else in my script works other than the team changing bit. I don't have much experience with teams and just came up with this with a few tutorials I found.

local btn = script.Parent
local yes = btn.Parent.QuizOptY
local no = btn.Parent.QuizOptN
local player = game:GetService("Players").LocalPlayer -- you can ignore everything except for this and where it says yes.Mousebutton...

btn.MouseButton1Up:Connect(function()
	yes.Visible = true
	no.Visible = true
	btn.Visible = false
end)

yes.MouseButton1Up:Connect(function() --this is where im having problems
	yes.Visible = false
	no.Visible = false
	btn.Visible = true
	player.Team = Teams["Employer"] -- here specifically
end)

no.MouseButton1Up:Connect(function()
	yes.Visible = false
	no.Visible = false
	btn.Visible = true
	
end)

If you know how to help or know of a tutorial that can help. Please let me know. Thank you!

1 answer

When defining the player's team, you need to do

player.Team = game.Teams["Employer"] -- here specifically

You only used teams, but Teams is a child of game, so you must use game.Teams

1 comment

0

I haven't tested but i think this is the problem

This discussion is preserved as it was. New answers, comments, and votes are closed.