-- obtain goals based on Center part

center.BodyPosition.position = beacon.Center.Position
teamColor = center.Color
vel = center.BodyVelocity

healerIsResting = false

function restHealer()
	healerIsResting = true
	wait(5)
	healerIsResting = false
end

local Team = Instance.new("Team")
Team.TeamColor = BrickColor.new(teamColor)
Team.Name = Team.TeamColor.Name
Team.AutoAssignable = false
function joinTeam(humanoid)
	
	local team = Instance.new("Color3Value")
	team.Value = teamColor
	team.Name = "Team"
	team.Parent = humanoid
	
	local vCharacter = humanoid.Parent
	if vCharacter then
		Team.Parent = game:GetService("Teams")
		local vPlayer = game.Players:GetPlayerFromCharacter(vCharacter) 
		if vPlayer then
			vPlayer.Neutral = false
			vPlayer.TeamColor = BrickColor.new(teamColor)
			
			spawn(function()
				local message = Instance.new("Message")
				message.Text = string.format("You're now on the %s team!", Team.Name)
				message.Parent = vPlayer
				wait(5)
				message.Text =  "Touch the beacon again to heal you!"
				wait(5)
				message:Destroy()
			end)
		end
	end
	
	
	