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

[Solved]This Script Works, but Doesn't Work!

The following script only works in PlaySolo, but not in an actual server.

while true do
	wait()	
	if game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Visible==false then
		game.Workspace.Sound:Play()
		break
	end
end

The problem was solved by somebody on the ROBLOX forums! Thnx wazap!

1 answer

You can't get LocalPlayer from a normal script, that's what it looks like you're trying to do.

local fr = game.Players["Azarth"]:WaitForChild("PlayerGui").ScreenGui.Frame
fr.Changed:connect(function(ob)
	if ob == "Visible" then 
		if not fr.Visible then
			Workspace["Sound"]:Play()
		end
	end
end)

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