Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
2

How to fix gui showing up for all players?

Asked by 6 months ago
Edited 6 months ago
---error
11:44:47.790 - hm is not a valid member of PlayerGui
11:44:47.790 - Stack Begin
11:44:47.791 - Script 'Workspace.Clues.Knife.Part.Script', Line 13
11: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

---Actual script
script.Parent.ClickDetector.MouseClick:Connect(function()
script.Parent:Destroy()
for i,v in pairs(game.Players:GetPlayers()) do
    local Clue = v.PlayerGui.hm.Clue
    for i=0, 100 do
        Clue.TextStrokeTransparency = Clue.TextStrokeTransparency - 0.01
        Clue.TextTransparency = Clue.TextTransparency - 0.01
    end
    wait(6)
    for i=0, 100 do
        Clue.TextStrokeTransparency = Clue.TextStrokeTransparency + 0.1
        Clue.TextTransparency = Clue.TextTransparency + 0.1
    end
end
end)

Can anyone explain what is going on?

1 answer

Log in to vote
1
Answered by 6 months 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 — 6mo
Ad

Answer this question