Script is not working for some strange reason

looking at the script below it should work, but for some reason the UserInputService is being underlined in red and I can’t see why

the script:

local UserInputService= game:GetService("UserInputService")
local keybind = Enum.KeyCode.C

local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local blastAnim = char:WaitForChild("Humanoid"):LoadAnimation(script:WaitForChild("ShieldAnim")

UserInputService.InputBegan:Connect(function(input,gameprocessed)
	if gameprocessed then return end
	if input.KeyCode == keybind then
		script.Fire:FireServer()
		blastAnim:Play()		
	end
end)```
1 Like

You forgot a bracket in

local blastAnim = char:WaitForChild("Humanoid"):LoadAnimation(script:WaitForChild("ShieldAnim")

Should be

local blastAnim = char:WaitForChild("Humanoid"):LoadAnimation(script:WaitForChild("ShieldAnim"))
3 Likes