i want to make shop but this error messes up everything. Help PLS!!!!
script.Parent.MouseButton1Click:connect(function() local RS = game:GetService("ReplicatedStorage") local item = RS:WaitForChild("Stick") local price = 10 -- Change Your Price Here local player = game.Players.LocalPlayer local stats = player:WaitForChild("leaderstats")
if stats.Money.Value >= price then -- Change the Money to your Currency Name stats.Money.Value = stats.Money.Value - price local cloned = item:Clone() local cloned = item:Clone() cloned.Parent = player.Backpack cloned.Parent = player.StarterGear end end)
local stats = player:WaitForChild("leaderstats") it is line with error
It's because you haven't created an instance to actually insert the leaderstats into the player. You are trying to wait for something that isn't there.
Go to this article for help on creating leaderstats:
https://developer.roblox.com/en-us/articles/Leaderboards
Closed as Too Broad by JesseSong, marine5575, and youtubemasterWOW
This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.
Why was this question closed?