im a beginner at scripting im having some trouble with tool.equipped. im trying to make a script where if they have a specific tool equipped then they can press R and it prints but if tool is not equipped then pressing R does nothing.
here is the script(i got rid of the stuff ive done with tool.equipped)
local replicatedStorage = game.ReplicatedStorage
local fireBlast = replicatedStorage.fireBlast
local function onKeyPress(input)
local direction = workspace.CurrentCamera.CFrame.LookVector
if input.KeyCode == Enum.KeyCode.R then
if isplaying == false then
isplaying = true
animplay:Play()
animplay.Stopped:Connect(function()
isplaying = false
end)
fireBlast:FireServer(direction)
end
end
end
userInputService.InputBegan:Connect(onKeyPress)