(Solved)How can I know what I need to deactivate the particles when it touches the ground?
Asked by
6 years ago Edited 6 years ago
Hello, well that I want the particles of fire to be deactivated when it touches the ground, I have tried many ways, but without result, how could I do it? I'm very stuck Thank you
01 | local UserInputService = game:GetService( "UserInputService" ) |
02 | local ground = game.Workspace.ground |
03 | local car = game.Workspace.car |
04 | local sound = Instance.new( "Sound" , script.Parent) |
07 | local wheel 1 = game.Workspace.car [ "FrontR" ] |
08 | local wheel 2 = game.Workspace.car [ "FrontL" ] |
13 | local fire = game.Workspace.car.fire.Fire |
17 | if car.PrimaryPart ~ = nil then |
19 | car.PrimaryPart.Touched:Connect( function (touched) |
20 | if touched.Parent ~ = nil then |
21 | UserInputService.InputBegan:Connect( function (input) |
22 | if input.KeyCode = = Enum.KeyCode.W or input.KeyCode = = Enum.KeyCode.A or input.KeyCode = = Enum.KeyCode.D or input.KeyCode = = Enum.KeyCode.Up or input.KeyCode = = Enum.KeyCode.Left or input.KeyCode = = Enum.KeyCode.Right then |
26 | UserInputService.InputEnded:Connect( function (inputEnd) |
27 | if inputEnd.KeyCode = = Enum.KeyCode.W or inputEnd.KeyCode = = Enum.KeyCode.A or inputEnd.KeyCode = = Enum.KeyCode.D or inputEnd.KeyCode = = Enum.KeyCode.Up or inputEnd.KeyCode = = Enum.KeyCode.Left or inputEnd.KeyCode = = Enum.KeyCode.Right then |
37 | car.PrimaryPart.Touched:Connect( function (touch) |
39 | if touch.Parent ~ = ground then |
46 | local wlsp = ((wheel 2. RotVelocity + wheel 1. RotVelocity)/ 2 ).magnitude |
47 | local wlsp 2 = ((wlsp / 200 ) + idlespeed) * mult |
48 | if wlsp 2 < maxpitch then |
51 | sound.Pitch = maxpitch |
57 | ground.Touched:Connect( function (touch) |
62 | if touch.Parent ~ = car then |