I have a script which adds a leaderstat value when a click detector is clicked, except it changes the leaderstat value for all players in the game instead of the player who clicked it?
local MS = game:GetService("MarketplaceService")
local VIPID = 8110615
local clickDetector = script.Parent.ClickDetector
local RS = game:GetService("ReplicatedStorage")
game.Players.PlayerAdded:Connect(function(plr)
if MS:UserOwnsGamePassAsync(plr.UserId,VIPID) then
clickDetector.MouseClick:Connect(function()
plr.leaderstats.Potatoes.Value = plr.leaderstats.Potatoes.Value + 1
end)
end
end)
(Ignore the gamepass)

1 comment
L0L