Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

User input service is not printing anything, what i do?

Idk what is happening, but it doesnt prints anything. I wanted to use this for playing a animation, but idk what to do... /:

local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(Input)
	print("a") 
	if Input.KeyCode == Enum.KeyCode.H then
		print("a")
	end
end)

i've made other script too, but it works, and the first one don't.

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
	if input.KeyCode == Enum.KeyCode.G then
		mouse.Target:Destroy()
		print(mouse.Target)
	end
end)

2 answers

UserInputService doesn't work on the server. Make sure this is in a LocalScript

1 comment

0

it is

I tried changing the location too, ti was on StarterCharacterScrpits bcuz i wanted to do a animation on it. Tested on workspace and still not working

1 comment

0

it*

This discussion is preserved as it was. New answers, comments, and votes are closed.