I am trying to make a tool where it changes the value of a bool value. When I click the tool, it prints "Can mine", but the BoolValue does not change to true?

There are no errors in the put. I am using a normal script.

local tool = script.Parent
local canMine = tool.Mining

function onMined()
	local str = Instance.new("StringValue")
	str.Name = "toolanim"
	str.Value = "Slash"
	str.Parent =  tool
	canMine.Value = true
	print("Can mine")
end
tool.Activated:Connect(onMined)

3 comments

0

May I know where are you checking the bool value? In the backpack of the player or the place where you stored it

0

I put the boolvalue in the starterpack

1

Then don't check the bool value in StarterPack. Go to Players > Name > Backpack > ToolName > Mining and then check its value