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

.Touched script isnt working, im at dead ends!! Any help?

So i made this script but it isnt working. please take a look:

script.Parent.Touched:connect(function(hit)

if hit.Parent.Name == "B" then
	print("b touched")
		script.Parent.Parent.Parent.VechicleSeat.MaxSpeed = 0
		end
end)

The part B is touching it because ive seen it. Ive tried it with other stuff but it doesnt work still. I know it isnt working because its not printing anything. Ive also tried hit.Name and it still dont work. Any ideas?

4 comments

0

Is B a part or a model?

0

It is a part in a model

0

What is this script inside of?

0

A model. It is inside of workspace > a model > another model > and another model

2 answers

The reason is that you didn't put If hit.Parent:FindFirstChild("Humanoid") then

So Heres the step

1.Put the script into a brick then copy this into script

Part.Touched:connect(function(HIT)
	local H = HIT.Parent:FindFirstChild("Humanoid")
	if H then
		script.Parent.Parent.Parent.VechicleSeat.MaxSpeed = 0
	end
end)

There you go! If this helped then accept the Answer please.

1 comment

0

Still doesnt work. Im just gonna abandon it and just work it out another way

Ive given up so im just going to use wait inside the scripts

Thank you to everyone that tried to help :)

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