Does anyone know how to make a script where when someone is sitting in a car seat and they press a key of my choosing it triggers a animation.
Insert a Localscript
in StarterGui and paste the following:
local AnimationID = " " --The ID of the animation you want to play local UIS = Game:GetService("UserInputService") -- The input service local Player = game.Players.Local local Character = Player.Character or Player.CharacterAdded:Wait() local Anim = Instance.new("Animation") -- Creates an Animation Anim.AnimationId = AnimationID -- Sets the AnimationID local Main = Character:WaitForChild("Humanoid"):LoadAnimation(Anim) --Loads UIS.InputBegan:Connect(function(input) -- When an Input starts if input.UserInputType = Enum.UserInputType.Keyboard then if input.KeyCode == Enum.KeyCode.E then--Change key to what you like Main:Play() -- Plays the previously loaded animation end end end)