Ive been trying to make someone have a price when they get a certain amount of leaderstat's Value. Here is what I came up with
local Player = game.Players.LocalPlayer
local stats = Player:FindFirstChild("leaderstats"):FindFirstChild("Money")
game.Players.PlayerAdded:connect(function()
if stats.Value == 2010 then
game.ReplicatedStorage["AK-47"]
["AK-47"].Parent = Player.Backpack
end
end)
It's a script in Workspace...

5 comments
You should be giving tools on the server and not allowing clients to access them
I don't think clients will access them, this is on the server. If it were to be on the client side, then yes they would have access to it. You can also put the AK-47 on ServerStorage, so that clients do not download the contents unless called to.
Pretty sure that line 7 has to be "game.ReplicatedStorage["AK-47"].Parent" and, why would you put the parent of AK-47 in the backpack?? Isn't it's parent Replicated Storage?? -- Sorry if it doesnt work, im a beginner.
@iiDogeLegend I'm trying to put it in their inventory...
I need an exact script.