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

My touched script doesnt work and i dont understand what the problem is. Any help?

script.Parent.Touched:Connect(function(hit)
	
	local humanoid = hit.Parent:FindFirstChild("Humanoid")

	if humanoid then
		
		print("touched by a humanoid")
		
	end

end)

This is a server script, parented to a part in the workspace and i dont understand why this isnt working. At first i thought it may be because of the condition in the if statement but i dont understand why it can be wrong

Any help is apriciated

1 comment

0

i copy&pasted the script into my studio and it works fine

1 answer

✓ Accepted answer

What i guess is you have to say that humanoid is EQUAL to hit so if thats the case then


if humanoid == hit then 
print("A humanoid touched the part")

3 comments

0

Im not sure about it though but hope it helps.

0

nope no output

0

got it to work

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