Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why isn't this tool script not increasing a int value?

so I want to make a tool when I click while holding the tool but it's not increasing the int value (Energy) which is in the workspace

Here's the script

local energy = game.Workspace.Energy


script.Parent.Equipped:Connect(function(mouse)
	mouse.Button1Down:Connect(function()
		energy.Value = energy.Value + 1
	end)
end)

1 answer

✓ Accepted answer

You don't need to have the code be that complicated. All you need to do is this:

local energy = game.Workspace.Energy


script.Parent.Activated:Connect(function()
	energy.Value = energy.Value + 1
end)

1 comment

0

Yeah, exactly

This discussion is preserved as it was. New answers, comments, and votes are closed.