Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How should I get the Players ledaerstats and what am i doing wrong?

Asked by 4 years ago

So i did a script for a dev product but i want to make sure the players get extra cash too. Im having trouble getting the player instance. Im not getting any error so how can i fix this and add cash to their stats?

01marketPlace = game:GetService("MarketplaceService")
02 productId = 1156445116
03 playerService = game:GetService("Players")
04local RS = game:GetService("ReplicatedStorage")
05Sword = RS:WaitForChild("Sword")
06local function processRecipt(ReciptInfo)
07local player = playerService:GetPlayerByUserId(ReciptInfo.PlayerId)
08if not player then
09return Enum.ProductPurchaseDecision.NotProcessedYet
10end
11if player then
12local char = game.Workspace:FindFirstChild(player.Name)
13local swordClone = Sword:Clone()
14swordClone.Parent = char
15player.leaderstats.Cash.Value = player.leaderstats.Cash.Value + 5555555555
View all 21 lines...
0
server script right? jerryisgod29 176 — 4y
0
yea server script bestshot123 38 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Works fine the script is correct, I had a script that i thought was disabled but wasn't, so it broke this one.

Ad

Answer this question