#How to disable combat during dialogue

1 messages · Page 1 of 1 (latest)

remote sleet
#

Roblox provides a super handy property for this UserInputService:GetFocusedTextBox() or checking input.UserInputType & input.UserInputState along with input:IsDescendantOf().

But here’s the best general fix
local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end -- UI was clicked, don't attack

if input.UserInputType == Enum.UserInputType.MouseButton1 then
    -- Run your M1 combat attack logic here
    print("M1 Attack!")
end

end) Use gameProcessed to ignore clicks on UI, and maybe set a manual flag like inDialogue if needed. That’ll keep combat and UI cleanly separated.

ember basin
#

oh thanks man i completely forgot about the processed argument

#

imma use this

#

but I want to add a screen cover so clicking anywhere on the screen during dialogue would be processed, would I just create a frame and set interactable to true?