Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

W006: Statement spans multiple lines?

Asked by
DogeIXX 172
4 years ago
Edited 4 years ago

Hey. I am currently trying to create a function that disables Movement Input. But when I try that, the error "W006: Statement spans multiple lines" comes up. That is my code:

Edit: Did not post the whole code, I am stupid ik.

local ContextActionService = game:GetService("ContextActionService")
local FREEZE_ACTION = "freezeMovement"


function Freeze()
    ContextActionService:BindAction(
    FREEZE_ACTION, --This is where the error comes up.
    function() return Enum.ContextActionResult.Sink end,
    false,
    unpack(Enum.PlayerActions:GetEnumItems())
)
end

function UnFreeze()
ContextActionService:UnbindAction(FREEZE_ACTION)    
end

1 answer

Log in to vote
0
Answered by 4 years ago

The message 'spans across multiple lines' is not an error. It's just informing you that the statement "spans across multiple lines". Running this code would differ no differently when its all in one line. Should you want to remove the 'warning', this is how I'd do it.

ContextActionService:BindAction(FREEZE_ACTION, function()
    return Enum.ContextActionResult.Sink
end, false, unpack(Enum.PlayerActions:GetEnumItems()))
Ad

Answer this question