Purchase UI showing for everybody

Howdy, so for some reason, when you go to press the prompt, the UI shows with no problem. However, it shows for everybody in the server, instead of just the person who opened it. How would I go about fixing this? I believe something in this script is the root of the problem.

local player = game.Players.LocalPlayer

game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function()
	script.Parent.Frame.Visible = true
end)

script.Parent.Frame.Purchase.MouseButton1Click:Connect(function()
	if player.leaderstats.Money.Value >= 350000 then
		game.ReplicatedStorage.RemoteEvent2:FireServer(player)
		script.Parent.Frame.Visible = false
	else
		script.Parent.Frame.Purchase.Text = "Sorry! You don't have enough money!"
		wait(2)
		script.Parent.Frame.Visible = false
		script.Parent.Frame.Purchase.Text = "Purchase"
	end
end)

script.Parent.Frame.Cancel.MouseButton1Click:Connect(function()
	script.Parent.Frame.Visible = false
end)

Maybe try getting the parameter for the specific player for

game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function()
	script.Parent.Frame.Visible = true
end)