Nikita
Nikita

Reputation: 1

How to create script for roblox studio? (footbal game)

How to create a script in which when you press a key, for example "e", shoot the soccer ball. If it's not difficult for you, can you write how to make the animation of raising the leg on impact?)

Vector3 dont work.(

Upvotes: -4

Views: 454

Answers (1)

Thomas Wong
Thomas Wong

Reputation: 50

You need to use the UserInputService. First create a LocalScript in StarterPlayerScripts, which is in the StarterPlayer folder visible to the explorer. And type this.

local UserInputService = game.UserInputService 

function Press()
if UserInputService.KeyCode = Enum.KeyCode.E then
  —type in the things you want it to do after clicking E
    end
end

UserInputService.InputBegin:Connect(Press)

Upvotes: -2

Related Questions