Story Frame only opens once

hello everyone
i am working on a zombie game based on Apocalypse Rising 1
and i have made pages scattered around the map to add some lore
i also have a script inside the StoryGui that checks if any frame got clicked if it has been clicked then it closes
it also doesent fire any error.

here is the script that opens the page

this is a ServerScript

local Paper = script.Parent

Paper.ProximityPrompt.Triggered:Connect(function(playerWhoTriggered)
	playerWhoTriggered.PlayerGui:FindFirstChild("StoryGui"):FindFirstChild(Paper.Name).Visible = true
	playerWhoTriggered.Character:FindFirstChildWhichIsA("Humanoid").WalkSpeed = 0
end)

here is the script that closes the page

this is a ClientScript

local StoryFolder = workspace.StoryFolder
local Player = game.Players.LocalPlayer
local Gui = script.Parent

for _, i in pairs(Gui:GetChildren()) do
	if i:IsA("ImageButton") then
		i:GetPropertyChangedSignal("Visible"):Connect(function()
			Gui.PaperSound:Play()
		end)
		i.MouseButton1Click:Connect(function()
			Gui.PaperSound:Play()
			i.Visible = false
			Gui.ChangeWalkSpeedEvent:FireServer()
		end)
	end
end

sorry for my bad english it isint my first laungauge.

So is the issue that after the first time they interact with a page (activate the proximity prompt and then click on the page to close it) then the next time they interact with that same page it isn’t visible?

yes that is the error in the script but i cant seem to find it

Have you tried putting a print statement or a debug breakpoint in the server script that’s trying to set visible = true to make sure it’s getting triggered the second time?

And is the hierarchy of your GUI just something like:

PlayerGui
    -StoryGui
        -Page1(ImageButton)
        -Page2(ImageButton)

i havent tried to add a print statement i will do that right away

the server script is firing the print statements that i have added

so it meight be the client script then, if the server script it firing the prints

Ok, I setup a sample test and confirmed that there is weird behavior in the replication of the PlayerGui from server to client. I kind of surprised changing the visibility on the server side works the first time.

What I would switch to is for the server to fire a RemoteEvent to that player, that the Client script is listening for.
Something like
game.ReplicatedStorage.Remotes.ShowPage:FireClient(PlayerWhoTriggered, Paper.Name)

and on the client

game.ReplicatedStorage.Remotes.ShowPage.OnClientEvent:Connect(function(PageName)
  StoryGui:FindFirstChild(PageName).Visible = true
end)

This whole method is not made very well. You could utilize RemoteEvents to simply put it all on the client side instead of setting the gui visibility on the server. Heres an example ServerScript:

local Paper = script.Parent

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PaperEvent = ReplicatedStorage:FindFirstChild("PaperPickup")

Paper.ProximityPrompt.Triggered:Connect(function(playerWhoTriggered)

	PaperEvent:FireClient()

	playerWhoTriggered.Character:FindFirstChildWhichIsA("Humanoid").WalkSpeed = 0

end)

And the localscript:

local StoryFolder = workspace.StoryFolder
local Player = game.Players.LocalPlayer
local Gui = script.Parent

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PaperEvent = ReplicatedStorage:FindFirstChild("PaperPickup")

PaperEvent.OnClientEvent:Connect(function()
	Gui.Visible = true
	Gui.PaperSound:Play()

	for _, i in pairs(Gui:GetChildren()) do
	i.MouseButton1Click:Connect(function()
		Gui.PaperSound:Play()
		i.Visible = false
		Gui.ChangeWalkSpeedEvent:FireServer() -- This is seperate from what I'm helping you with, although you dont pass any data for who the walkspeed should be changed for.
	end)
	end
end)

this is also a great solution i only wish that i can also mark this as a solution, thanks alot from both of you!