veh = game.Workspace:FindFirstChild(script.Parent.Parent.CarName.Value, true)
airhorn = veh.lightbar1.middle.Manual
function Click(mouse)
airhorn:Play()
veh.lightbar1.middle.Yelp:Stop()
veh.lightbar1.middle.Wail:Stop()
end
function Unclick(mouse)
airhorn:Stop()
end
script.Parent.MouseButton1Down:connect(Click)
script.Parent.MouseButton1Up:connect(Unclick)
I get error cannot index veh. I have a script giving the cars a unique random name and the CarName value matches it (I checked and that works).

4 comments
Please put your code in a code block (the blue "Lua" button at the top of the question box)
I have put it in the code block now.
Is
vehnil? What's the error? Are you sure this script is running after the model exists, is named, and afterCarName.Valueis set? Have youprint()d anything to verify that?I figured it out, the Value of the object was being changed more than once.