Teleport script not making gui visible

I have a function inside my script that is parented to ServerScriptService, and it only makes the sound to stop except making the “Vignette” visible. The print says its visible, but when I go to the player and view the properties of Vignette, its not visible. Please help me with this problem.

		for i, player in pairs(players) do
			if player.Character then
				local character = player.Character
				local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
				if humanoidRootPart then
					print("spawn")
					if character:FindFirstChild("Enemy") then
						character.Humanoid.WalkSpeed = 9
					else
						character.Humanoid.WalkSpeed = 8
					end
					humanoidRootPart.CFrame = mapSpawns.CFrame
					humanoidRootPart.Anchored = false
					game.StarterGui.MainMenu.Theme:Stop()
					player.PlayerGui.MainMenu.Vignette.Visible = true
					if player.PlayerGui.MainMenu.Vignette.Visible == true then
						print("visible")
					else
						print("invisible")
					end
				end
			end
		end
	end```
3 Likes

are you accidentally checking startergui instead of playergui?

Ive tried doing game.StarterGui also but it still wont work

try doing this on the client, and also i was asking if you were checking in studio via startergui by accident

Now I have fixed the gui, but the Theme song is still playing

if not player.Character:FindFirstChild("Enemy") and workspace.GameFolder.MapPhase.Value == 0 then
				player.Character:PivotTo(workspace:FindFirstChild(tostring(v34)):FindFirstChild("Spawns"):FindFirstChild("PlayerSpawn").CFrame)
				game.StarterGui.MainMenu.Theme:Stop()
				player.PlayerGui.MainMenu.Vignette.Visible = false
				if player.PlayerGui.MainMenu.Vignette.Visible == true then
					print("visible")
				else
					print("invisible")
				end
				return```
1 Like

I have finally fixed both the gui and audio. I have fixed it by using a remote event instead.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.