Issue with GUI opening

I’m trying to make a spinning system where players can spin and get a random power, it generates through random numbers and then shows what you got, it works the first time but then when you spin again the gui that says what you got doesn’t show up again after you click the close button, these are my scripts:

Local Script:
local db = false
script.Parent.MouseButton1Click:Connect(function()
if not db then
db = true
script.RemoteEvent:FireServer()
wait()
db = false
end
end)

Normal Script:
script.Parent.RemoteEvent.OnServerEvent:Connect(function(plr)
local char = plr.Character
local root = char.HumanoidRootPart
local hum = char.Humanoid
local plrgui = plr.PlayerGui
local screen = plrgui.LuckSpinGUI.SpinButton
local p = game.Lighting.PowerScripts
local val = screen.LuckScript.Object
local gui = plrgui.PrizeScreenGUI
local text = gui.CongratsText
local prize = gui.PrizeText
local yg = gui.YouGotText
local close = gui.Close

for i = 1,40,1 do
	local r = math.random(1,11)
	val.Value = r
	script.Parent.Parent.Text = r
	wait(0.01)
end


if val.Value == 1 then
	p.AwakenScript:Clone().Parent = char
	text.Visible = true
	prize.Visible = true
	yg.Visible = true
	close.Visible = true
	prize.Text = "Full Cowling!"
elseif val.Value == 2 then
	p.FirstDarkScript:Clone().Parent = char
	text.Visible = true
	prize.Visible = true
	yg.Visible = true
	close.Visible = true
	prize.Text = "Darkness!"
elseif val.Value == 3 then
	p.GodSpeed:Clone().Parent = char
	prize.Visible = true
	yg.Visible = true
	close.Visible = true
	text.Visible = true
	prize.Text = "GodSpeed!"
elseif val.Value == 4 then
	p.PainPull:Clone().Parent = char
	prize.Visible = true
	yg.Visible = true
	close.Visible = true
	text.Visible = true
	prize.Text = "Pain's Pull!"
elseif val.Value == 5 then
	p.PunchSlam:Clone().Parent = char
	prize.Visible = true
	yg.Visible = true
	close.Visible = true
	text.Visible = true
	prize.Text = "Super Strength!"
elseif val.Value == 6 then
	p.SharinganActivScript:Clone().Parent = char
	prize.Visible = true
	yg.Visible = true
	close.Visible = true
	text.Visible = true
	prize.Text = "Sharingan"
elseif val.Value == 7 then
	p.Sixfold:Clone().Parent = char
	prize.Visible = true
	yg.Visible = true
	close.Visible = true
	text.Visible = true
	prize.Text = "Sixfold!"
elseif val.Value == 8 then
	p.SpiritBombScript:Clone().Parent = char
	prize.Visible = true
	yg.Visible = true
	close.Visible = true
	text.Visible = true
	prize.Text = "Spirit Bomb!"
elseif val.Value == 9 then
	p.TitanShift:Clone().Parent = char
	prize.Visible = true
	yg.Visible = true
	close.Visible = true
	text.Visible = true
	prize.Text = "Titan Shifting!"
elseif val.Value == 10 then
	p.mountscript:Clone().Parent = char
	prize.Visible = true
	yg.Visible = true
	close.Visible = true
	text.Visible = true
	prize.Text = "Ice Powers!"
elseif val.Value == 11 then
	p.GojoScripts.CollapsingBlue:Clone().Parent = char
	p.GojoScripts.HollowPurpleAc:Clone().Parent = char
	p.GojoScripts.ReversalRedAc:Clone().Parent = char
	prize.Visible = true
	yg.Visible = true
	close.Visible = true
	text.Visible = true
	prize.Text = "Gojo!"
end

end)

Close Button Script:
local frame = script.Parent.Parent

script.Parent.MouseButton1Click:Connect(function()

frame.CongratsText.Visible = false

frame.PrizeText.Visible = false

frame.Close.Visible = false

frame.YouGotText.Visible = false

end)

I appreciate any help I get and I hope whoever’s reading this has a great day!

is there any error outputs? if so can you show us?

There is no output errors but it doesnt work

in the script. The object you introduce as “frame” should be visible, because those below it will be affected.

the frame is actually the screengui it is inside of (in the close script at least)