I don't know what it is about these lines of code, but the server just doesn't agree with them or something. I can even check while testing the game whether or not the "pressEgui" is in PlayerGui ; it is! Im so flabbergasted i need help.
--// Variables \\-- local part = game.Workspace.Part local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() --gui variables local eGui = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui").pressEgui.eGui local basic = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui").ChooseDifficulty.BasicButton --// Actions \\-- part.Touched:Connect(function() if plr.Seated == true then eGui.Visible = true end end) mouse.KeyDown:Connect(function(Key) if Key == "e" then basic.Visible = true end end) basic.MouseButton1Click:Connect(function() basic.Visible = false end)
Tysm! error ; pressEgui is not a valid member of playergui
By what I currently see, you are trying to define Player by using "LocalPlayer" in a server script, I don't know why you'd even do that, but that is incorrect, there's also no way to get the mouse object while server-sided.
You also shouldn't expect changes to GUIs or even new GUIs created by the client to be replicated over to the server, so any changes you do VIA a LocalScript will stay local in this case.
The issue here is that your script can't find pressEgui because it does not instantly go to the PlayerGui when the script fires. On line 13 and 15, where you have,
:WaitForChild("PlayerGui")
this WaitForChild function is not necessary to use on "PlayerGui" because it already exists within the player. To fix your error, you should move your WaitForChild function to right after the PlayerGui. Example:
plr.PlayerGui:WaitForChild("pressEgui")
this should fix the entire issue, but just to be safe you can do the same with line 15. Hope this helps!