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.

ground.Touched:Connect(debounce(function(touch)
    if touch.Parent ~= car then
        print("stop")
        StopCar()
    elseif touch.Parent == car then
        print("star")
        StartCar()
    end
end))

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.

ground.Touched:Connect(debounce(function(touch)
    if touch.Parent ~= car then
        print("stop")
        StopCar()
    end
end))
car.PrimaryPart.Touched:Connect(debounce(function(touch)
    if touch.Parent ~= car then
        print("star")
        StartCar()
    end
end))
Ad

Answer this question