Im needing help on a system where if you press E in the vehicle seat the maxSpeed + 1 and you can do this until it hits 25 maxspeed
ive tried it and heres what i came up with the problem was it was building up scripts in starterplayerscripts and for every vehicleseat i would be a pain:
local uis = game:GetService("UserInputService")
aa = true
uis.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.E and game.Players.LocalPlayer.Character:WaitForChild("Humanoid").SeatPart.Name == "Driver" then
print("ELLO!")
-- type here speed +1--
end
end)
uis.InputEnded:Connect(function(key)
if key.KeyCode == Enum.KeyCode.E and game.Players.LocalPlayer.Character:WaitForChild("Humanoid").SeatPart.Name == "Driver" then
print("hello!")
--type here +1 speed whatever--
end
end)
ive looked all over the forum and cant seem to find help and i really need this so if you can help would be great!
So the script ive shown above is currentley in a localscript in starterplayerscripts but id prefer it to be in the vehicleseat itself if possible. The script from starterplayerscripts links up to the vehicleseat by a HumanoidDescription but like i said if i could just get all of it in the vehicle seat would be good.