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

How to fix gui showing up for all players?

Asked by 6 years ago
Edited 6 years ago
1---error
211:44:47.790 - hm is not a valid member of PlayerGui
311:44:47.790 - Stack Begin
411:44:47.791 - Script 'Workspace.Clues.Knife.Part.Script', Line 13
511:44:47.791 - Stack End

So this what happend to me since I'm working on a Horror,Multiplayer game the script doesn't work since It's says hm is not valid member of PlayerGui. this is the script

01---Actual script
02script.Parent.ClickDetector.MouseClick:Connect(function()
03script.Parent:Destroy()
04for i,v in pairs(game.Players:GetPlayers()) do
05    local Clue = v.PlayerGui.hm.Clue
06    for i=0, 100 do
07        Clue.TextStrokeTransparency = Clue.TextStrokeTransparency - 0.01
08        Clue.TextTransparency = Clue.TextTransparency - 0.01
09    end
10    wait(6)
11    for i=0, 100 do
12        Clue.TextStrokeTransparency = Clue.TextStrokeTransparency + 0.1
13        Clue.TextTransparency = Clue.TextTransparency + 0.1
14    end
15end
16end)

Can anyone explain what is going on?

1 answer

Log in to vote
1
Answered by 6 years ago

You cannot access a player's gui via a server script unfortunely.. You have either to use a LocalScript inside the player or use remove events.

These will help you understand, they made everything clear for me. It's not complicated.

https://wiki.roblox.com/index.php?title=Remote_Functions_%26_Events

https://www.youtube.com/watch?v=wic-N4JiFss

0
Thank you wiktormont 14 — 6y
Ad

Answer this question