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

[Solved] Sound1 is not a valid member of PlayerGui ?

Here's the script : it is placed in an union in Workspace.

script.Parent.Touched:connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") and game.Players[hit.Parent.Name].PlayerGui.Sound1.IsPlaying==false then
		game.Players[hit.Parent.Name].PlayerGui.Sound1:Play()
	end
	if hit.Parent:FindFirstChild("Humanoid") and game.Players[hit.Parent.Name].PlayerGui.Sound2.IsPlaying==true then
		game.Players[hit.Parent.Name].PlayerGui.Sound2:Stop()
	end
end)

Studio Play & Play Here : works Local Server | 1 Player : does not works InGame Does not works

With a output script I managed to see this : Sound1 is not a valid member of PlayerGui

BTW : before doing an anti virus scan and removing models in my game : the script above was entirely replaced by :

69

Now it no longer does it.

6 comments

0

You might wanna put use the :waitforchild?

0

And why would i use it anyway ? If someone touch the part and I do find first child humanoid then it will continue the stack if it finds the humanoid, else it won't continue...

0

Is FilteringEnabled on? If the sounds were created by a local script, then the server won't recognise that. Otherwise, try using WaitForChild.

0

Yes, FE is on and the sounds are placed in StarterGui, i'll try WaitForChild...

0

You should be using RemoteEvents for communicating with the server and client.

0

You need a server and client script for FE

1 answer

Well, that was one year ago, but I can confirm. Using RemoteEvents with FE really helped me there. That's all.

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