So i have trying to do this script but i keep getting this error pls help me
script.Parent.MouseButton1Click:connect(function()
local RS = game:GetService("ReplicatedStorage")
local item = RS:WaitForChild("Gravity Coil")
local price = 50
local player = game.Players.LocalPlayer
local stats = player:WaitForChild("leaderstats")
if stats.Points.Value == price then
stats.Points.Value = stats.Points.Value - price
local cloned = item:Clone()
local cloned2 = item:Clone()
cloned2.Parent = player.Backpack
cloned.Parent = player.StarterGear
end
end)

3 comments
are you using a local script
also instead of doing stats.Points.Value == price, I would do stats.Points.Value >= price so it can be equal to or greater than otherwise it always has to be equal to
I was gonna post a question asking how to do that, thank you!