This is what the script does: it is supposed to change a value in their stats. but it doesnt work though. (its supposed to be a normal script, not local, but when i do localscript, it does work, but normal script don't)
local player = game.Players.LocalPlayer
local points = player.stats:FindFirstChild("Points")
local swordz = player.stats.swords
local sword = swordz.Default
local price = 0
script.Parent.MouseButton1Click:Connect(function()
if points.Value >= price then
sword.Value = true
sword.Eq.Value = true
swordz.Linked.Eq.Value = false
end
end)

2 comments
is script.Parent a GUI? in this case, it will only work in a local script because GUIs can only be manipulated through a local script. You would need to set up remote events to handle the point changing from the server side if this is the case.
I would also like to point out that LocalPlayer is undefined in a server script, because the script is available to everyone in the game, and not localized to one specific player (the client), like local scripts do.