script.Parent.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local player = game.Players:GetPlayerFromCharacter(hit.Parent) player:WaitForChild("PlayerGui"):FindFirstChild("Shop").Open.Value = true end end)
This script will make a boolvalue to true and another localscript will make a gui open if the boolvalue is true. But it attempted to a nil value. What does that mean?
I see from the comments that you are using a server script to change the GUI.
Due to filtering enabled, client objects will not get replicated to the server, if you want to access the player's gui, you would have to manually clone them to their PlayerGui when they join, then the server made this change and you can change it on the server as well.
I recommend that you, however, instead use a LocalScript on the client and use a RemoteEvent or RemoteFunction, and then fire those events from the server and tell the client to do something.
Check the example below, note that it is not to be used in a production game, it's just an example of how you would do this.
-- // Server code local ReplicatedStorage = game:GetService("ReplicatedStorage"); local GUIToggler = ReplicatedStorage:WaitForChild("GUIToggler"); -- "PlayerHere" is the player instance GUIToggler:FireClient(PlayerHere, "open"); -- // Client code local ReplicatedStorage = game:GetService("ReplicatedStorage"); local GUIToggler = ReplicatedStorage:WaitForChild("GUIToggler"); GUIToggler.OnClientEvent:Connect( function (action) print("Request received from the server"); if action == "open" then -- Open the gui else -- Close the gui end end)