So Im trying to make it so that my spectate button spectates people with the InGame Value.

Next.MouseButton1Click:Connect(function()
	local max = #players
	num = num + 1
	if player.Name ~= script.Parent.Parent.Parent.Name and player.InGame then
		if num > max then
			num = 1
		end
		camera.CameraSubject = player.Character.Humanoid
		status.Text = player.Name
	else
		print("Can't spectate!")
		num = num + 1
		if num > max then
			num = 1
		end
		camera.CameraSubject = player.Character.Humanoid
		status.Text = player.Name
	end
end)

I have tried fixing it by putting

if player.Name ~= script.Parent.Parent.Parent.Name and player.InGame then

also script.Parent.Parent.Parent.Name is the player's name.

2 comments

0

Maybe try making a variable to the player and if player.Name?

0

Please provide a valid description. Errors,prints if applicable