Value is not a valid member of TextLabel (ToolShop)

Hi,

I made a toolshop, but when I try to click the buy button, it shows this in output:

When I click on the error, it leads to this script:

local Tool = script.Parent.Tool.Value

script.Parent.MouseButton1Click:Connect(function(player)
	if game.Players.LocalPlayer.leaderstats.Money.Value >= script.Parent.Cost.Value then
		game.Players.LocalPlayer.leaderstats.Money.Value = game.Players.LocalPlayer.leaderstats.Money.Value - script.Parent.Cost.Value
		game.ReplicatedStorage.Events.RemoteEvent:FireServer(Tool, player)
		script.Parent.ToolName.Text = "Success!"
		wait(3)
		script.Parent.ToolName.Text = "Bread"
	else
		script.Parent.ToolName.Text = "Not enough coins!"
		wait(3)
		script.Parent.ToolName.Text = "Bread"
	end
end)

It’s referring to this intvalue:
Screenshot 2022-09-19 at 15.19.21

There are 2 Costs, change the name of 1 and in the script and try again

2 Likes