as you can see from the title, the script doesn’t let me use :FireServer()
for some reason and gives me an error saying attempt to index nil with 'FireServer'
.
all help is appreciated!
here’s the script:
-- services and variables
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = game.Players.LocalPlayer
local character = player.Character
local mouse = player:GetMouse()
local debounce = false
local FireBlast = script:FindFirstChild("FireBlast")
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://8277263227"
-- code
UserInputService.InputBegan:Connect(function(input, gameprocessed)
if gameprocessed then return end
if input.KeyCode == Enum.KeyCode.Q then
local animation = character.Humanoid:LoadAnimation(animation)
debounce = true
FireBlast:FireServer(mouse.Hit.p)
task.wait(1.5)
debounce = false
end
end)