The code sample documented on the UserInputService.AccelerometerEnabled property page has multiple issues which prevent the script from running.
Issue lies on the third and fifth line of the code sample.
Third line: local accelerometerEnabled = UserInputService:AccelerometerEnabled()
Should be: local accelerometerEnabled = UserInputService.AccelerometerEnabled
Fifth line: if accelerometerEnabled
Should be: if accelerometerEnabled then
Error
Code sample w/ correct changes
local UserInputService = game:GetService("UserInputService")
local accelerometerEnabled = UserInputService.AccelerometerEnabled
if accelerometerEnabled then
print("The device has an enabled accelerometer!")
else
print("The device does not have an enabled accelerometer!")
end