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

for some reason my script part wont work and says "Touched is not a valid member of Tool" why?

i tried to make my script work on touch by using

script.Parent.Touched:connect(onTouched)

but roblox tells me "Touched is not a valid member of Tool", i dont know why but it wont let me make my script work cause of it. What should i put instead of "script.Parent.Touched:connect(onTouched)"???

2 answers

Roblox is correct, touched is not a valid memeber of tool.

Instead, create a hitbox on the tool and do:

script.Parent.HitBox.Touched:Connect(function(hit)

If the handle is the hitbox, do:

script.Parent.Handle.Touched:Connect(function(hit)

Let me know if you have any problems

1 comment

0

bruh did you have to downvote me >:(

Tools cannot be touched. Only the handle inside of them can be. A tool is an instance inside your backpack. To make your script work, try:

script.Parent.Handle.Touched:Connect(onTouched)

Hope this helped!! :D

4 comments

0

lowercase connect is deprecated, use Connect() instead. Alos, that's not how parameters are defined. It's done by doing: Connect(function(onTouched)

0

it still works though

0

May cause some unwanted errors

0

STOP DOWNVOTING ME

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