How would I go about detecting inputs in plugins

I want to detect inputs in plugins

input service doesn’t work for this and I don’t know what else to use

inputservice.InputBegan:Connect(function(input)
		if input.KeyCode == Enum.KeyCode.R then
			moving = true
		end
	end)
	inputservice.InputEnded:Connect(function(input)
		if input.KeyCode == Enum.KeyCode.R then
			moving = false
			local parts = game.Workspace.DrawingFolder:GetChildren()
			local target = mouse.Target
			local union = target:SubtractAsync(parts)
			union.Parent = mouse.Target.Parent
			target:Destroy()
		end
	end)
1 Like

inputservice should work, only thing i can think of is that if this is a server script, since inputservice works only in localscripts