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

Tool not printing when clicked?

Hello! I am relatively new to scripting, and have been trying to learn more, and grasp more everyday! Today I have made a tool, in which is a script and a click detector. When you click, it's supposed to print a text, however, on click, nothing happens.

Here's the code:

function Click

	 if script.Parent Click = true then print "test completed!"
	
	end
end

Thank you!

1 answer

✓ Accepted answer

Hello.

You have to use the Activated event and a LocalScript.

script.Parent.Activated:Connect(function()
     print("Click!")
end)

script is the Local Script.

Parent it's the Script Parent (The Tool.)

Activated it's an event of the Tool.

If you do not have a handle for your tool, make sure you set false tool's property RequiresHandle .

Everything between script.Parent.Activated:Connect(function() and end) will run when you activate the tool (click.)

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