I have built a car with parts that act as "airbags". When something hits the "trigger" that's under the hood, the "airbags" then turn visible and cancollide is set to true. At the same time, the throttle is also set to "0" and high friction "brakes" under the car are then activated.
My question is, how do I get the "trigger" ,that the script below is in, to tell the difference between a player and a part. I don't want anything to happen when a player touches the "trigger" but when a part hits it, I want the script to run.
This is what I have. Yes its long and super basic.. sorry about that..
function onTouched(hit)
script.Parent.Parent.Part1.CanCollide = true
script.Parent.Parent.Part2.CanCollide = true
script.Parent.Parent.Part3.CanCollide = true
script.Parent.Parent.Part4.CanCollide = true
script.Parent.Parent.DriverSeat.Throttle = 0
script.Parent.Parent.Airbag1.Transparency = 0
script.Parent.Parent.Airbag2.Transparency = 0
script.Parent.Parent.Airbag3.Transparency = 0
script.Parent.Parent.Airbag4.Transparency = 0
script.Parent.Parent.Airbag1.CanCollide = true
script.Parent.Parent.Airbag2.CanCollide = true
script.Parent.Parent.Airbag3.CanCollide = true
script.Parent.Parent.Airbag4.CanCollide = true
end
script.Parent.Touched:connect(onTouched)
Any help on this would be very helpful to me and I would be very grateful, thanks :)

2 comments
Never mind, I got it to work. Sorry about that.. But thank you very much :)
No problem. I actually so far have done nothing but answer people's questions. That's mainly why I joined, was to help people new to scripting. And who downvoted this? Now I have a -1 rep. :/