Help with my script

Is there anything wrong with my script?
i cant figure out why it don’t work

	wait(1)
	local num = math.random(1,10)
	local Notif = game.ServerStorage.Notif2
	local clone = Notif:Clone()
	local Player = game:GetService("Players").LocalPlayer

print(num)
	if num == 4 then
		clone.Parent = Player.PlayerGui
	end
end

Heres the output error:
snippet

Can’t access the ServerStorage if this is in a LocalScript, put it inside ReplicatedStorage instead so that it’s visible across both sides

omg that would make sense becuase in the output i would get an error saying something about not having acsess to “notif2”

Definitely tell us the errors next time please.

look at the edit, i uploaded a output message

i have a output error image, in the edit

Is the script a local script or server script?

i think its a server script, its not a local script and also the script is in serverscriptservice

Maybe you should reference StarterGui

You cant get the local player from the server make sure the script is a local script

yeah i would do that but i want this line of code to happen to all players

Remove the local player from your script

Try to find a way to implement this into your code

for index, player in pairs(game.Players:GetPlayers()) do
	if player then
		wait(1)
		local num = math.random(1, 10)
		local Notif = game.ServerStorage.Notif2
		local clone = Notif:Clone()
		
	print(num)
		if num == 4 then
			clone.Parent = player:WaitForChild("PlayerGui")
		end
	end
end

does this use tables? i dont know how that top part works, lol sry but if you could explain what that does then i would be happy

game.Players:GetPlayers() return a table of the players in the game. the top part is looping through the players in the game

	if player then
		local notif = game.ServerStorage.Notif2
		local clone = notif:Clone()
		clone.Parent = player.PlayerGui
		end
	end

Would i be doing this the right way?

Yes if it doesn’t work can you show me more of the script

It seems that this script doesnt work either (the one i quoted)

is that your entire script? or are you showing a portion of it

well im trying to run that as a test script but yeah thats what i got right now