killerderp7
killerderp7

Reputation: 118

User Input Service's Input Began not firing

I am working with User Input Service to make a snake game within Roblox, and the event, Input Began, is not firing. I even copied code from the official Roblox website to teach how to script, and nothing happened. What could be going wrong?

Upvotes: 0

Views: 472

Answers (1)

Kylaaa
Kylaaa

Reputation: 7188

UserInputService only works in LocalScripts, and according to the docs :

A LocalScript will only run Lua code if it is a descendant of one of the following objects:

  • A Player’s Backpack, such as a child of a Tool
  • A Player’s character model
  • A Player’s PlayerGui
  • A Player’s PlayerScripts.
  • The ReplicatedFirst service

Double check that your LocalScript is in one of those locations and that it is not Disabled.

Upvotes: 1

Related Questions