Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

W006: Statement spans multiple lines?

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

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()))

This discussion is preserved as it was. New answers, comments, and votes are closed.