local plr = game.Players.LocalPlayer local rp = game:GetService('ReplicatedStorage') local notification = game.StarterGui.Notification script.Parent.MouseButton1Click:connect(function() if plr.Backpack:FindFirstChild('PirateSword') or plr.StarterGear:FindFirstChild('PirateSword')or game.Workspace[plr.Name]:FindFirstChild('PirateSword') then notification.Base.Visible = true notification.Base.Text = 'You Already Purchased This' wait(1.5) notification.Base.Visible = false else if plr.leaderstats.Coins.Value >= 50 then rp.PirateSword:Clone().Parent = plr.Backpack rp.PirateSword:Clone().Parent = plr.StarterGear plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value - (50) else local cashrequired = 50 - plr.leaderstats.Coins.Value notification.Base.Visible = true notification.Base.Text = 'You Need '..cashrequired..' More Coins To Buy This!' wait(1.5) notification.Base.Visible = false end end end)
When player joins the game, folder where all his guis are kept is named PlayerGui. Path to your notification will be:
game.Players.LocalPlayer.PlayerGui.Notification
so with your variable it will be:
plr.PlayerGui.Notification