I'm trying to make a backpack/inventory shop similar to the one in Mining Simulator. I'm now trying to script exiting the shop, which I'm doing by firing a remote event. However, upon clicking the exit button, the ScreenGui updates on the server side but not the client side. I am scripting this in a local script located in ServerScriptService. Here's my local script:
exitbuttonevent = game.ReplicatedStorage.ExitButtonClicked
cam = workspace.CurrentCamera
local function exitbuttonclicked()
local inventory = game.Players.LocalPlayer.PlayerGui:WaitForChild("inventory")
inventory:WaitForChild("InventoryShopFrame").Visible = false
inventory:WaitForChild("Storage"):WaitForChild("OpenInventory").Parent = inventory
inventory:WaitForChild("Storage"):WaitForChild("inventorylabel").Parent = inventory
inventory:WaitForChild("Storage"):WaitForChild("Shop").Parent = inventory
cam.CameraType = Enum.CameraType.Custom
cam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
end
exitbuttonevent.OnServerEvent:Connect(exitbuttonclicked)
Can I have some help on this? Also, please ignore the camera stuff, if that doesn't work I'll test it later. I'm more worried about the GUI. Thank you!

4 comments
Open and close the shop on the client. Purchases should be on the server
I don't understand what you mean
You're trying to make a shop right?
Oh, I understand what you mean now!