Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I interconnect function according to the touch?

Asked by
brok4d 77
6 years ago

Hi, I'm messed up I've changed everything to if I have a new thread, I have two functions in one that plays the car and another stops and a debounce function until everything is fine, but when I try to change the function, start with the stop it is touching the ground, and the movement of the car comes out, I know it will be something simple, but I do not hit the key. Thank you.

1ground.Touched:Connect(debounce(function(touch)
2    if touch.Parent ~= car then
3        print("stop")
4        StopCar()
5    elseif touch.Parent == car then
6        print("star")
7        StartCar()
8    end
9end))

1 answer

Log in to vote
0
Answered by
brok4d 77
6 years ago

I change it for this, if it works but only the sound the fire keeps going.

01ground.Touched:Connect(debounce(function(touch)
02    if touch.Parent ~= car then
03        print("stop")
04        StopCar()
05    end
06end))
07car.PrimaryPart.Touched:Connect(debounce(function(touch)
08    if touch.Parent ~= car then
09        print("star")
10        StartCar()
11    end
12end))
Ad

Answer this question