01 | veh = game.Workspace:FindFirstChild(script.Parent.Parent.CarName.Value, true ) |
02 | airhorn = veh.lightbar 1. middle.Manual |
03 | function Click(mouse) |
04 | airhorn:Play() |
05 | veh.lightbar 1. middle.Yelp:Stop() |
06 | veh.lightbar 1. middle.Wail:Stop() |
07 | end |
08 | function Unclick(mouse) |
09 | airhorn:Stop() |
10 | end |
11 | script.Parent.MouseButton 1 Down:connect(Click) |
12 | script.Parent.MouseButton 1 Up: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).
Try doing :WaitForChild instead of :FindFirstChild, other than that, I have no idea. XD