Hey, guys!
So I'm trying to make a crop system for my tycoon game, but I am having trouble doing so. I know how to make the crops grow, and I have an idea on how to remove their cash when they purchase the crop, but whenever I run the script, it says "attempt to index nil with 'Value'".
I think that it's important to note that I am using "Zednov's Tycoon Kit" and the money system in the tycoon kit is different than the one that I'm used to, well at least from what the output has told me. I am going to provide the part of the script that the output is bringing me to when it says "attempt to index nil with 'Value'".
I've been trying to fix it on and off for a couple months now and it's getting pretty annoying, so I thought that I'd come here to get some help. Please let me know if there's any way that I could fix this and make it where it takes away the cash when you purchase it in the tycoon kit! Please note for "plr.Value", it doesn't work when I put "plr.Cash.Value".
script.Parent.ClickDetector.MouseClick:Connect(function(click) local plr = game.ServerStorage.PlayerMoney:FindFirstChild(click.Parent.Name) if plr.Value >= script.Price.Value then -- This is where the issue is occurring. plr.Value = plr.Value - 30 -- here is where I put the script that makes the crops grow else plr.Value = plr.Value - 0 script.Parent.SurfaceGui.Name = "Need More Money!" wait(2) script.Parent.SurfaceGui.Name = "Wheat" end end)
I've also tried "LocalPlayer", but it's not working. It's just saying that I need to "indel nil with Value". I'm not sure what that means and I've tried several ways that didn't work. Does anyone have any idea on how I could fix it? If so, I'd appreciate a response!