So, me and my friend were trying to make a crafting script using "Number Values." We looked at the code, but it showed no errors. We can't figure out what's wrong, please help!
local stat1 = "Wood" local stat1value = 1 local stat2 = "Vines" local stat2value = 1 local final = game.ServerStorage:WaitForChild("Wood Sword") game.Players.PlayerAdded:Connect(function(plr) local statfolder = plr:WaitForChild("stats") script.Parent.MouseButton1Down:Connect(function() if statfolder:FindFirstChild(stat1).Value >= stat1value and statfolder:FindFirstChild(stat2).Value >= stat2value then statfolder:FindFirstChild(stat1).Value = statfolder:FindFirstChild(stat1).Value - stat1value statfolder:FindFirstChild(stat2).Value = statfolder:FindFirstChild(stat2).Value - stat2value local tool = final:Clone() tool.Parent = plr.StarterGear end end) end)
`
Try put the tool in the player backpack also
line 14: StarterGear is not a member of plr. In the plr StarterGear is called Backpack.
so, line 14: tool.Parent = plr.Backpack