Hi i took your script and altered it.
--serverscript local part = workspace.Part local remoteEvent = game.ReplicatedStorage.RemoteEvent local gui = game.StarterGui.ScreenGui.Frame part.Touched:Connect(function(objectThatTouchedMe) if objectThatTouchedMe.Parent:FindFirstChild("Humanoid") then local client = game.Players:GetPlayerFromCharacter(objectThatTouchedMe.Parent) gui.Visible = false remoteEvent:FireClient(client) end end)
--localscript local remotevent = game.ReplicatedStorage.RemoteEvent local gui = game.StarterGui.ScreenGui.Frame local function visiblegui () print("recieved remote call") end remotevent.OnClientEvent:Connect(visiblegui)
doesnt work can you tell why?
it prints 'recieved remote call' but the frame doesnt disappear.
defining the frame in StarterGui and changing its visibility does nothing. It makes sense that every player has their own GUI so what I mean is that StarterGui is a container that will copy its descendants and parent them to PlayerGui in the PlayerObject.
So instead of this
local GUI = game.StarterGui.ScreenGui.Frame
You want to define the PlayerGui and define the Frame from the PlayerGui
local client = game.Players.LocalPlayer local GUI = client.PlayerGui.ScreenGui.Frame
Do this in the LocalScript
So if you look in your explorer and start the game
-Players
[Player.Name] PlayerGui ScreenGui Frame