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

Equip is not a valid member of Tool. Can anyone help?

Roblox says Equip is not a valid member of tool, but it clearly is. This is the script that changes the BoolValue of Equipt:

local tool = script.Parent
 
local function onEquip()
	tool.Equip = true
end
 
local function onUnequip()
	tool.Equip = false
end
 
local function onActivate()
end
 
local function onDeactivate()
end
 
tool.Equipped:Connect(onEquip)
tool.Unequipped:Connect(onUnequip)
tool.Activated:Connect(onActivate)
tool.Deactivated:Connect(onDeactivate)

Here's Equip being a valid member of Tool: I would really appreciate if someone could help me with this.

2 comments

0

By tool.Equip = true, you are just accessing the instance and setting it to true or false which makes no sense. You should set its value to true or false. There is a property of the instance called Value that is the one you should be modifying. So tool.Equip.Value = true

1 answer

✓ Accepted answer

To change the value of a BoolValue, or any other value object, you need to change the Value property. If you think about it, directly overriding the object itself would not work, and should not be expected to work.

To fix your script, simply append .Value to the object when changing or accessing its value:

tool.Equip.Value = true

5 comments

0

AKA what I said in the comments, also maybe his Equip BoolValue hasn't been loaded yet so he might want to use :WaitForChild().

0

your comment wasn't there when i began answering mr vamik

0

^ I know I did not complain.

0

has happened to me before ¯_(?)_/¯

0

Thanks, I totally forgot about .Value :)

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