Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago
Edited 5 years ago

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.

0
You might wanna put use the :waitforchild? The_sandwic 14 — 6y
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... ElVolKo 1 — 6y
0
Is FilteringEnabled on? If the sounds were created by a local script, then the server won't recognise that. Otherwise, try using WaitForChild. UgOsMiLy 1074 — 6y
0
Yes, FE is on and the sounds are placed in StarterGui, i'll try WaitForChild... ElVolKo 1 — 6y
View all comments (2 more)
0
You should be using RemoteEvents for communicating with the server and client. Impacthills 223 — 6y
0
You need a server and client script for FE The_sandwic 14 — 6y

1 answer

Log in to vote
0
Answered by 5 years ago

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

Ad

Answer this question