My script to move a car works, but only once?..
Everything works in my script, the player presses W and the car moves, then I let go of W and it stops. But it only works once, I press W then let go, it works then after I press W for the second time after I let go, and nothing works....
03 | local Plr = game.Players.LocalPlayer |
04 | local Mouse = Plr:GetMouse() |
05 | local Car = game.Workspace:FindFirstChild( "" ..Plr.Name.. "'s_Car" ) |
10 | Mouse.KeyDown:connect( function (Key) |
12 | if WIsDown = = false then |
14 | local Force = Instance.new( "BodyForce" ) |
15 | Force.Parent = Car.Hitbox |
16 | Force.force = Car.Hitbox.CFrame.lookVector * Speed |
22 | Mouse.KeyUp:connect( function (Key) |
24 | if WIsDown = = true then |
25 | Car.Hitbox.WForce:Destroy() |
It's in a local script and output says: 10:38:16.793 - WForce is not a valid member of Part
10:38:16.794 - Script 'Players.Player.PlayerGui.WScript', Line 26