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....
wait(0.1)
local Plr = game.Players.LocalPlayer
local Mouse = Plr:GetMouse()
local Car = game.Workspace:FindFirstChild(""..Plr.Name.."'s_Car")
local Speed = 1000000
WIsDown = false
Mouse.KeyDown:connect(function(Key)
if Key == "w" then
if WIsDown == false then
WIsDown = true
local Force = Instance.new("BodyForce")
Force.Parent = Car.Hitbox
Force.force = Car.Hitbox.CFrame.lookVector * Speed
Force.Name = "WForce"
end
end
end)
Mouse.KeyUp:connect(function(Key)
if Key == "w" then
if WIsDown == true then
Car.Hitbox.WForce:Destroy()
end
end
end)
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

2 comments
I didn't notice that, lol. ty
No problem c: