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

Why isnt my script working in the actual game?

Asked by 5 years ago
game.Players.PlayerAdded:connect(function(plr)
    Screen = game.ServerStorage.ScreenGui:Clone()
    Screen.Parent = plr.PlayerGui

    plr.PlayerGui.ScreenGui.Frame.TextButton.MouseButton1Click:connect(function()
        a = plr.PlayerGui.ScreenGui.Frame.TextBox.Text
            for i, v in pairs(game.Workspace:GetChildren()) do
                print(a)
                if v.Name == a then
                    print("Q")
                    v.Transparency = 1 

                end
            end
        end)
    end)



It's a gui that you write in, let's say you write "Part" and press the go button, all the parts should go invisible. It works but only in studio and not the real game. Help?

0
Probably because you have Filtering Enabled on. With FE the server can't access the client. Also if this is a local script. Then you shouldn't use PlayerAdded as that will detect all players that join. Griffi0n 315 — 5y
0
FE is enabled and it is a server script. Thesquid13 301 — 5y
0
Manipulating GUI objects from the server is seen as bad practice. Use a LocalScript for that. T0XN 276 — 5y
0
A less important issue (that still needs to be addressed); ":connect()" is deprecated, use ":Connect()" instead. T0XN 276 — 5y
View all comments (2 more)
0
How would I get the GUI inside their PlayerGui without it interfering witth other GUIs then=? Thesquid13 301 — 5y
0
change PlayerGui to CoreGui but im not sure that will work because u might need more access to the server side but not sure XxTGLxX 7 — 5y

1 answer

Log in to vote
0
Answered by
Launderer 343 Moderation Voter
5 years ago

You cannot get PlayerGui from a script, that is what a localscript is for my friend. Use the FireClient() function in the script to tell the client to do whatever to it's stupid little playergui.

https://wiki.roblox.com/index.php?title=Remote_Functions_%26_Events
look for Server to Client for more information.

Ad

Answer this question