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)
UserInputService doesn't work on the server. Make sure this is in a LocalScript