I am still new to roblox lua
i was trying to make shop
local rs = game:GetService("ReplicatedStorage")
local buytool = rs:WaitForChild("buytool")
buytool.OnServerEvent:Connect(function(plr,tool)
print(tool.Name)
if plr.Character:FindFirstChild(tool.Name) then
return
end
if plr.Backpack:FindFirstChild(tool.Name) then
return
end
if plr.leaderstats.kills.Value >= tool.Price.Value then
local giveTool = rs.ShopItems[tool.Name]:Clone()
giveTool.Parent = plr.Backpack
local giveTool = rs.ShopItems[tool.Name]:Clone()
giveTool.Parent = plr.StarterGear
end
end)
local leader = Instance.new("Folder")
leader.Name = "leaderstats"
leader.Parent = plr
local kills = Instance.new("IntValue")
kills.Name= ("Kills")
kills.Parent = leader
kills.Value = 500
local xp = Instance.new("IntValue")
xp.Name= ("xp")-- change ("Cash")
xp.Parent = leader
xp.Value = 500
end)
error
Server - buyscript:7
23:05:40.608 kills is not a valid member of Folder "Players.xprogamerdfg.leaderstats" error is on line script:24